Search in sources :

Example 1 with com.amazonaws.services.ec2.model

use of com.amazonaws.services.ec2.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 2 with com.amazonaws.services.ec2.model

use of com.amazonaws.services.ec2.model in project xtext-core by eclipse.

the class Bug311337TestLanguageSemanticSequencer 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 == Bug311337Package.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug311337Package.CHILD:
                sequence_Child(context, (Child) semanticObject);
                return;
            case Bug311337Package.DEFINITION:
                sequence_Definition(context, (Definition) semanticObject);
                return;
            case Bug311337Package.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
            case Bug311337Package.NESTED_REF:
                sequence_Reference(context, (NestedRef) semanticObject);
                return;
            case Bug311337Package.REFERENCE:
                sequence_Reference(context, (Reference) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) NestedRef(org.eclipse.xtext.linking.lazy.bug311337.NestedRef) Action(org.eclipse.xtext.Action) Reference(org.eclipse.xtext.linking.lazy.bug311337.Reference) Definition(org.eclipse.xtext.linking.lazy.bug311337.Definition) Model(org.eclipse.xtext.linking.lazy.bug311337.Model) Parameter(org.eclipse.xtext.Parameter) Child(org.eclipse.xtext.linking.lazy.bug311337.Child) EPackage(org.eclipse.emf.ecore.EPackage)

Example 3 with com.amazonaws.services.ec2.model

use of com.amazonaws.services.ec2.model in project xtext-core by eclipse.

the class Bug250313Test method testDatatypeConversion_01.

@Test
public void testDatatypeConversion_01() throws Exception {
    Model model = (Model) getModel("1 foo - bar");
    assertEquals("str", model.getValue());
    assertEquals("org.eclipse.xtext.valueconverter.Bug250313.Datatype", lexerRule);
    assertTrue(node instanceof ICompositeNode);
    assertEquals(6, Iterables.size(((ICompositeNode) node).getChildren()));
    assertEquals("foo - bar", string);
    assertEquals(1, convertCallCount);
}
Also used : Model(org.eclipse.xtext.valueconverter.bug250313.Model) ICompositeNode(org.eclipse.xtext.nodemodel.ICompositeNode) Test(org.junit.Test)

Example 4 with com.amazonaws.services.ec2.model

use of com.amazonaws.services.ec2.model in project xtext-core by eclipse.

the class Bug250313Test method testNestedDatatypeConversion_03.

@Test
public void testNestedDatatypeConversion_03() throws Exception {
    Model model = (Model) getModel("zonk + foo - bar");
    assertEquals("str", model.getValue());
    assertEquals("org.eclipse.xtext.valueconverter.Bug250313.NestedDatatype", lexerRule);
    assertTrue(node instanceof ICompositeNode);
    assertEquals(4, Iterables.size(((ICompositeNode) node).getChildren()));
    assertEquals("zonk + foo - bar", string);
    assertEquals(1, convertCallCount);
}
Also used : Model(org.eclipse.xtext.valueconverter.bug250313.Model) ICompositeNode(org.eclipse.xtext.nodemodel.ICompositeNode) Test(org.junit.Test)

Example 5 with com.amazonaws.services.ec2.model

use of com.amazonaws.services.ec2.model in project xtext-core by eclipse.

the class Bug250313Test method testDatatypeConversion_04.

@Test
public void testDatatypeConversion_04() throws Exception {
    Model model = (Model) getModel("1+ foo - bar");
    assertEquals("[str]", model.getMultiValue().toString());
    assertEquals("org.eclipse.xtext.valueconverter.Bug250313.Datatype", lexerRule);
    assertTrue(node instanceof ICompositeNode);
    assertEquals(6, Iterables.size(((ICompositeNode) node).getChildren()));
    assertEquals("foo - bar", string);
    assertEquals(1, convertCallCount);
}
Also used : Model(org.eclipse.xtext.valueconverter.bug250313.Model) ICompositeNode(org.eclipse.xtext.nodemodel.ICompositeNode) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)60 Model (org.eclipse.xtext.valueconverter.bug250313.Model)30 ICompositeNode (org.eclipse.xtext.nodemodel.ICompositeNode)16 AmazonEC2Client (com.amazonaws.services.ec2.AmazonEC2Client)15 HashMap (java.util.HashMap)15 DescribeSubnetsResult (com.amazonaws.services.ec2.model.DescribeSubnetsResult)13 DescribeVpcsResult (com.amazonaws.services.ec2.model.DescribeVpcsResult)13 Vpc (com.amazonaws.services.ec2.model.Vpc)13 AuthenticatedContext (com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext)13 CloudContext (com.sequenceiq.cloudbreak.cloud.context.CloudContext)13 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)13 Group (com.sequenceiq.cloudbreak.cloud.model.Group)13 InstanceAuthentication (com.sequenceiq.cloudbreak.cloud.model.InstanceAuthentication)13 Location (com.sequenceiq.cloudbreak.cloud.model.Location)13 Network (com.sequenceiq.cloudbreak.cloud.model.Network)13 Subnet (com.sequenceiq.cloudbreak.cloud.model.Subnet)13 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