use of org.eclipse.pde.core.plugin.IPluginElement in project dsl-devkit by dsldevkit.
the class CheckContextsExtensionTest method testIsExtensionUpdateRequiredFalse.
/**
* Test if isExtensionUpdateRequired returns false if a correct extension already exists.
*
* @throws CoreException
* the core exception
*/
@Test
public void testIsExtensionUpdateRequiredFalse() throws CoreException {
IPluginExtension extension = contextsUtil.addExtensionToPluginBase(pluginModel, catalog, ExtensionType.CONTEXTS, null);
Iterable<IPluginElement> elements = Iterables.filter(Lists.newArrayList(extension.getChildren()), IPluginElement.class);
assertFalse("No extension update is required ", contextsUtil.isExtensionUpdateRequired(catalog, extension, elements));
}
use of org.eclipse.pde.core.plugin.IPluginElement in project dsl-devkit by dsldevkit.
the class CheckContextsExtensionTest method testIsExtensionUpdateRequiredTrue.
/**
* Test if isExtensionUpdateRequired is true, if the file path attribute is not as expected.
*
* @throws CoreException
* the core exception
*/
@Test
public void testIsExtensionUpdateRequiredTrue() throws CoreException {
IPluginExtension extension = createErroneousExtension();
Iterable<IPluginElement> elements = Iterables.filter(Lists.newArrayList(extension.getChildren()), IPluginElement.class);
assertTrue("Extension update is required", contextsUtil.isExtensionUpdateRequired(catalog, extension, elements));
}
use of org.eclipse.pde.core.plugin.IPluginElement in project dsl-devkit by dsldevkit.
the class CheckTocExtensionTest method testIsExtensionUpdateRequiredTrue.
/**
* Tests if isExtensionUpdateRequired returns true if only an erroneous extension exists for the check catalog.
*
* @throws CoreException
* the core exception
*/
@Test
public void testIsExtensionUpdateRequiredTrue() throws CoreException {
IPluginExtension extension = createErroneousTocExtension();
Iterable<IPluginElement> elements = Iterables.filter(Lists.newArrayList(extension.getChildren()), IPluginElement.class);
assertTrue("Toc extension update is required", tocUtil.isExtensionUpdateRequired(catalog, extension, elements));
}
use of org.eclipse.pde.core.plugin.IPluginElement in project dsl-devkit by dsldevkit.
the class CheckMarkerHelpExtensionHelper method createMarkerHelpElement.
/**
* Creates the marker help element.
*
* @param extension
* the extension
* @param check
* the check
* @param contextId
* the context id
* @return the i plugin element
* @throws CoreException
* the core exception
*/
private IPluginElement createMarkerHelpElement(final IPluginExtension extension, final Check check, final String contextId) throws CoreException {
IPluginElement element = extension.getModel().getFactory().createElement(extension);
element.setName(MARKERHELP_ELEMENT);
element.setAttribute(CONTEXT_ID_ATTRIBUTE_TAG, contextId);
element.setAttribute(MARKERTYPE_ATTRIBUTE_TAG, getCheckType(check));
return element;
}
Aggregations