use of org.eclipse.xtext.builder.clustering.CopiedResourceDescription in project xtext-eclipse by eclipse.
the class GenericResourceDescriptionManagerTest method testCreateDeltaAndIsAffected.
@Test
public void testCreateDeltaAndIsAffected() {
GenericResourceDescriptionManager manager = getEmfResourceDescriptionsManager();
EClass eClass = EcoreFactory.eINSTANCE.createEClass();
eClass.setName("Test");
eClass.getESuperTypes().add(EcorePackage.Literals.EPACKAGE);
Resource resource = new XMIResourceImpl(URI.createFileURI("test.ecore"));
resource.getContents().add(eClass);
EPackage copyOfEPackage = EcoreUtil.copy(EcorePackage.eINSTANCE);
Resource ecoreResource = new XMIResourceImpl(URI.createURI(copyOfEPackage.getNsURI()));
ecoreResource.getContents().add(copyOfEPackage);
IResourceDescription oldDescription = new CopiedResourceDescription(manager.getResourceDescription(ecoreResource));
oldDescription.getExportedObjects();
copyOfEPackage.setName("ecore_new");
IResourceDescription newDescription = manager.getResourceDescription(ecoreResource);
Delta delta = manager.createDelta(oldDescription, newDescription);
assertTrue(delta.haveEObjectDescriptionsChanged());
IResourceDescription referrerDescription = manager.getResourceDescription(resource);
assertTrue(manager.isAffected(delta, referrerDescription));
}
use of org.eclipse.xtext.builder.clustering.CopiedResourceDescription in project xtext-eclipse by eclipse.
the class Bug334456Test method testNoCopiedResourceDescription.
@Test
public void testNoCopiedResourceDescription() throws Exception {
createPluginProject("foo");
build();
IResourceDescriptions descriptions = BuilderUtil.getBuilderState();
assertFalse(Iterables.isEmpty(descriptions.getAllResourceDescriptions()));
for (IResourceDescription description : descriptions.getAllResourceDescriptions()) {
if (description instanceof CopiedResourceDescription) {
fail("Did not expect an instance of copied resource description in builder state");
}
}
}
Aggregations