Search in sources :

Example 6 with Model

use of io.opentelemetry.exporter.jaeger.proto.api_v2.Model in project xtext-core by eclipse.

the class Bug362902SemanticSequencer method sequence.

@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
    EPackage epackage = semanticObject.eClass().getEPackage();
    ParserRule rule = context.getParserRule();
    Action action = context.getAssignedAction();
    Set<Parameter> parameters = context.getEnabledBooleanParameters();
    if (epackage == Bug362902Package.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug362902Package.GREETING:
                sequence_Greeting(context, (Greeting) semanticObject);
                return;
            case Bug362902Package.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Greeting(org.eclipse.xtext.linking.bug362902.Greeting) Action(org.eclipse.xtext.Action) Model(org.eclipse.xtext.linking.bug362902.Model) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage)

Example 7 with Model

use of io.opentelemetry.exporter.jaeger.proto.api_v2.Model in project xtext-core by eclipse.

the class Bug299395Test method testSerialization_03.

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

Example 8 with Model

use of io.opentelemetry.exporter.jaeger.proto.api_v2.Model in project xtext-core by eclipse.

the class Bug299395Test method testSerialization_07.

@Test
public void testSerialization_07() {
    Model model = Bug299395Factory.eINSTANCE.createModel();
    SubModel subModel = Bug299395Factory.eINSTANCE.createSubModel();
    model.setSubModel(subModel);
    subModel.getStrings().add("s1");
    String serialized = getSerializer().serialize(model);
    assertEquals("subModel 1 2 \"s1\"", 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 9 with Model

use of io.opentelemetry.exporter.jaeger.proto.api_v2.Model in project xtext-core by eclipse.

the class Bug299395Test method testSerialization_05.

@Test
public void testSerialization_05() {
    Model model = Bug299395Factory.eINSTANCE.createModel();
    model.getStrings().add("Unused");
    model.getKeys().add("Key1");
    model.getValues().add("Value1");
    model.getKeys().add("Key2");
    model.getValues().add("Value2");
    String serialized = getSerializer().serialize(model);
    assertEquals("{ \"Unused\" } [ \"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 10 with Model

use of io.opentelemetry.exporter.jaeger.proto.api_v2.Model in project xtext-core by eclipse.

the class Bug299395Test method testSerialization_06.

@Test
public void testSerialization_06() {
    Model model = Bug299395Factory.eINSTANCE.createModel();
    SubModel subModel = Bug299395Factory.eINSTANCE.createSubModel();
    model.setSubModel(subModel);
    String serialized = getSerializer().serialize(model);
    assertEquals("subModel", 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)

Aggregations

Test (org.junit.Test)47 Model (org.eclipse.xtext.valueconverter.bug250313.Model)30 AutoMlClient (com.google.cloud.automl.v1.AutoMlClient)16 Model (com.google.cloud.automl.v1.Model)16 ICompositeNode (org.eclipse.xtext.nodemodel.ICompositeNode)16 ILeafNode (org.eclipse.xtext.nodemodel.ILeafNode)11 Model (com.microsoft.z3.Model)10 BoolExpr (com.microsoft.z3.BoolExpr)9 ByteArrayOutputStream (java.io.ByteArrayOutputStream)9 Model (org.eclipse.xtext.parsetree.reconstr.bug299395.Model)9 SubModel (org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel)9 LocationName (com.google.cloud.automl.v1.LocationName)8 ModelName (com.google.cloud.automl.v1.ModelName)8 AutoMlClient (com.google.cloud.automl.v1beta1.AutoMlClient)8 Model (com.google.cloud.automl.v1beta1.Model)8 PrintStream (java.io.PrintStream)8 Before (org.junit.Before)8 DeployModelRequest (com.google.cloud.automl.v1.DeployModelRequest)7 OperationMetadata (com.google.cloud.automl.v1.OperationMetadata)6 EPackage (org.eclipse.emf.ecore.EPackage)6