@Test public void testCrossResourceContainment() throws Exception { Element parent = CrossContainmentFactory.eINSTANCE.createElement(); Element child = CrossContainmentFactory.eINSTANCE.createElement(); parent.getContainment().add(child); Resource resource0 = new XMIResourceImpl(URI.createFileURI("test0.xmi")); resource0.getContents().add(parent); DefaultTransientValueService defaultTransientValueService = new DefaultTransientValueService(); assertTrue(defaultTransientValueService.isTransient(child, CrossContainmentPackage.Literals.ELEMENT__CONTAINER, 0)); Resource resource1 =new XMIResourceImpl(URI.createFileURI("test0.xmi")); resource1.getContents().add(child); assertEquals(parent, child.getContainer()); assertFalse(defaultTransientValueService.isTransient(child, CrossContainmentPackage.Literals.ELEMENT__CONTAINER, 0)); }
public Class<? extends ITransientValueService> bindITransientValueService() { return DefaultTransientValueService.class; }