Search in sources :

Example 1 with Model

use of org.eclipse.xtext.serializer.contextFinderTest.Model in project xtext-core by eclipse.

the class ContextFinderTest method testNodeExclusion1List.

@Test
public void testNodeExclusion1List() throws Exception {
    Model model = parseHelper.parse("#8 'myname' myname");
    proxify(model.getNodeExclusionList(), ContextFinderTestPackage.Literals.NODE_EXCLUSION_LIST__REF);
    assertEquals("NodeExclusion1List", findContextsByContents(model.getNodeExclusionList()));
}
Also used : Model(org.eclipse.xtext.serializer.contextFinderTest.Model) Test(org.junit.Test)

Example 2 with Model

use of org.eclipse.xtext.serializer.contextFinderTest.Model in project xtext-core by eclipse.

the class ContextFinderTest method testValueExclusionTest2.

@Test
public void testValueExclusionTest2() throws Exception {
    Model model = parseHelper.parse("#6 lit2");
    assertEquals("ValueExclusionTest2", findContextsByContents(model.getValueExclusion()));
}
Also used : Model(org.eclipse.xtext.serializer.contextFinderTest.Model) Test(org.junit.Test)

Example 3 with Model

use of org.eclipse.xtext.serializer.contextFinderTest.Model in project xtext-core by eclipse.

the class ContextFinderTest method testRootContainer.

@Test
public void testRootContainer() throws Exception {
    Model model = parseHelper.parse("#0 model #1 kw1 bar");
    assertEquals("Model", findContextsByContentsAndContainer(model));
    assertEquals("Model2", findContextsByContentsAndContainer(model.getModel()));
}
Also used : Model(org.eclipse.xtext.serializer.contextFinderTest.Model) Test(org.junit.Test)

Example 4 with Model

use of org.eclipse.xtext.serializer.contextFinderTest.Model in project xtext-core by eclipse.

the class ContextFinderTest method testNestedTypeRecursiveTest2.

@Test
public void testNestedTypeRecursiveTest2() throws Exception {
    Model model = parseHelper.parse("#3 kw2 . .");
    assertEquals("NestedTypeRecursiveTest2, NestedTypeRecursiveTest2_NestedTypeRecursiveTest_2_0", findContextsByContents(model.getNestedTypeRecursiveTest2()));
}
Also used : Model(org.eclipse.xtext.serializer.contextFinderTest.Model) Test(org.junit.Test)

Example 5 with Model

use of org.eclipse.xtext.serializer.contextFinderTest.Model in project xtext-core by eclipse.

the class ContextFinderTest method testParentRefTest1.

@Test
public void testParentRefTest1() throws Exception {
    Model model = parseHelper.parse("#4 kw1 foo");
    ParentRefTestChild child1 = ((ParentRefTest1) model.getParentRef()).getChild1();
    assertEquals("ParentRefTestChild1", findContextsByContentsAndContainer(child1));
}
Also used : ParentRefTestChild(org.eclipse.xtext.serializer.contextFinderTest.ParentRefTestChild) Model(org.eclipse.xtext.serializer.contextFinderTest.Model) ParentRefTest1(org.eclipse.xtext.serializer.contextFinderTest.ParentRefTest1) Test(org.junit.Test)

Aggregations

Model (org.eclipse.xtext.serializer.contextFinderTest.Model)23 Test (org.junit.Test)20 ParentRefTestChild (org.eclipse.xtext.serializer.contextFinderTest.ParentRefTestChild)5 ParentRefTest1 (org.eclipse.xtext.serializer.contextFinderTest.ParentRefTest1)3 ParentRefTest2 (org.eclipse.xtext.serializer.contextFinderTest.ParentRefTest2)3 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)2 EPackage (org.eclipse.emf.ecore.EPackage)1 Action (org.eclipse.xtext.Action)1 Parameter (org.eclipse.xtext.Parameter)1 ParserRule (org.eclipse.xtext.ParserRule)1 AttributeExclusionTest (org.eclipse.xtext.serializer.contextFinderTest.AttributeExclusionTest)1 NestedTypeChild1 (org.eclipse.xtext.serializer.contextFinderTest.NestedTypeChild1)1 NestedTypeChild2 (org.eclipse.xtext.serializer.contextFinderTest.NestedTypeChild2)1 NestedTypeRecursiveTest (org.eclipse.xtext.serializer.contextFinderTest.NestedTypeRecursiveTest)1 NestedTypeRecursiveTest1 (org.eclipse.xtext.serializer.contextFinderTest.NestedTypeRecursiveTest1)1 NestedTypeRecursiveTest2 (org.eclipse.xtext.serializer.contextFinderTest.NestedTypeRecursiveTest2)1 NestedTypeTest (org.eclipse.xtext.serializer.contextFinderTest.NestedTypeTest)1 NodeExclusion (org.eclipse.xtext.serializer.contextFinderTest.NodeExclusion)1 NodeExclusionList (org.eclipse.xtext.serializer.contextFinderTest.NodeExclusionList)1 QuantityExclusionTest (org.eclipse.xtext.serializer.contextFinderTest.QuantityExclusionTest)1