Search in sources :

Example 56 with Model

use of de.micromata.opengis.kml.v_2_2_0.Model in project xtext-core by eclipse.

the class Bug299395Test method testSerialization_08.

@Test
public void testSerialization_08() {
    Model model = Bug299395Factory.eINSTANCE.createModel();
    SubModel subModel = Bug299395Factory.eINSTANCE.createSubModel();
    model.setSubModel(subModel);
    subModel.getStrings().add("s1");
    subModel.getStrings().add("s2");
    String serialized = getSerializer().serialize(model);
    assertEquals("subModel 1 2 \"s1\" 1 2 \"s2\"", serialized);
}
Also used : Model(org.eclipse.xtext.parsetree.reconstr.bug299395.Model) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) Test(org.junit.Test)

Example 57 with Model

use of de.micromata.opengis.kml.v_2_2_0.Model in project xtext-core by eclipse.

the class Bug299395Test method testSerialization.

@Test
public void testSerialization() {
    Model model = Bug299395Factory.eINSTANCE.createModel();
    String serialized = getSerializer().serialize(model);
    assertEquals("", serialized);
}
Also used : Model(org.eclipse.xtext.parsetree.reconstr.bug299395.Model) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) Test(org.junit.Test)

Example 58 with Model

use of de.micromata.opengis.kml.v_2_2_0.Model in project xtext-core by eclipse.

the class Bug299395Test method testSerialization_04.

@Test
public void testSerialization_04() {
    Model model = Bug299395Factory.eINSTANCE.createModel();
    model.getKeys().add("Key1");
    model.getValues().add("Value1");
    model.getKeys().add("Key2");
    model.getValues().add("Value2");
    String serialized = getSerializer().serialize(model);
    assertEquals("[ \"Key1\" \"Value1\" \"Key2\" \"Value2\" ]", serialized);
}
Also used : Model(org.eclipse.xtext.parsetree.reconstr.bug299395.Model) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) Test(org.junit.Test)

Example 59 with Model

use of de.micromata.opengis.kml.v_2_2_0.Model in project xtext-core by eclipse.

the class Bug311337Test method testNoCyclicLinkingException.

@Test
public void testNoCyclicLinkingException() throws Exception {
    Model model = (Model) getModel("/************************************/\n" + "(def) local :\n" + "   (child) local_Child : def_depth1\n" + "   (ref) local_Child:depth1_Child\n" + "\n" + "/************************************/\n" + "\n" + "(def) def_depth1 :\n" + "   (child) depth1_Child : def_depth2\n" + "\n" + "/************************************/\n" + "\n" + "(def) def_depth2 :\n" + "   (child) depth2_Child :\n");
    assertTrue(model.eResource().getErrors().isEmpty());
}
Also used : Model(org.eclipse.xtext.linking.lazy.bug311337.Model) Test(org.junit.Test)

Example 60 with Model

use of de.micromata.opengis.kml.v_2_2_0.Model in project xtext-core by eclipse.

the class Bug362902Test method testNoExceptionUncaught.

@Test
public void testNoExceptionUncaught() throws Exception {
    String modelAsString = "Hello max ! Hello peter! favourite peter";
    Model model = (Model) getModelAndExpect(modelAsString, 2);
    EList<Diagnostic> errors = model.eResource().getErrors();
    Diagnostic diagnosticSyntax = errors.get(0);
    Diagnostic diagnosticLinking = errors.get(1);
    assertTrue(diagnosticSyntax instanceof XtextSyntaxDiagnostic);
    assertTrue(diagnosticLinking instanceof XtextLinkingDiagnostic);
}
Also used : XtextLinkingDiagnostic(org.eclipse.xtext.linking.impl.XtextLinkingDiagnostic) XtextSyntaxDiagnostic(org.eclipse.xtext.resource.XtextSyntaxDiagnostic) Model(org.eclipse.xtext.linking.bug362902.Model) XtextSyntaxDiagnostic(org.eclipse.xtext.resource.XtextSyntaxDiagnostic) XtextLinkingDiagnostic(org.eclipse.xtext.linking.impl.XtextLinkingDiagnostic) Diagnostic(org.eclipse.emf.ecore.resource.Resource.Diagnostic) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)47 Model (org.eclipse.xtext.valueconverter.bug250313.Model)30 ICompositeNode (org.eclipse.xtext.nodemodel.ICompositeNode)16 ILeafNode (org.eclipse.xtext.nodemodel.ILeafNode)11 Model (org.eclipse.xtext.parsetree.reconstr.bug299395.Model)9 SubModel (org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel)9 BoolExpr (com.microsoft.z3.BoolExpr)7 Model (com.microsoft.z3.Model)7 EPackage (org.eclipse.emf.ecore.EPackage)6 Action (org.eclipse.xtext.Action)6 Parameter (org.eclipse.xtext.Parameter)6 ParserRule (org.eclipse.xtext.ParserRule)6 Status (com.microsoft.z3.Status)3 Model (de.micromata.opengis.kml.v_2_2_0.Model)3 Model (org.sbolstandard.core2.Model)3 Context (com.microsoft.z3.Context)2 Solver (com.microsoft.z3.Solver)2 Kml (de.micromata.opengis.kml.v_2_2_0.Kml)2 Location (de.micromata.opengis.kml.v_2_2_0.Location)2 HashSet (java.util.HashSet)2