use of org.eclipse.xtext.parser.partialParsingTestUtil.CrossResourceContainerManyChildren in project xtext-core by eclipse.
the class CrossContainmentTest method testCrossContainment_01.
@Test
public void testCrossContainment_01() {
XtextResourceSet resourceSet = get(XtextResourceSet.class);
resourceSet.setClasspathURIContext(getClass());
Resource resource = resourceSet.createResource(URI.createFileURI("container.xmi"));
Resource childResource = resourceSet.createResource(URI.createFileURI("child.xmi"));
CrossResourceContainerManyChildren container = PartialParsingTestUtilFactory.eINSTANCE.createCrossResourceContainerManyChildren();
resource.getContents().add(container);
Grammar grammar = XtextFactory.eINSTANCE.createGrammar();
childResource.getContents().add(grammar);
assertNull(grammar.eContainer());
container.getChildren().add(grammar);
assertSame(container, grammar.eContainer());
assertSame(childResource, grammar.eResource());
assertSame(resource, container.eResource());
}
use of org.eclipse.xtext.parser.partialParsingTestUtil.CrossResourceContainerManyChildren in project xtext-core by eclipse.
the class PartialParserCrossContainmentMultiTest method setCrossResourceContainer.
@Override
protected void setCrossResourceContainer(XtextResource resource) {
ResourceSet resourceSet = resource.getResourceSet();
Resource containerResource = resourceSet.createResource(URI.createFileURI("sample.xmi"));
CrossResourceContainerManyChildren container = PartialParsingTestUtilFactory.eINSTANCE.createCrossResourceContainerManyChildren();
containerResource.getContents().add(container);
container.getChildren().addAll(resource.getContents());
}
Aggregations