Package org.emftrace.metamodel.QUARCModel.Constraints

Examples of org.emftrace.metamodel.QUARCModel.Constraints.Precondition


    Pattern si3 = createPattern(gss, 3);
    Pattern si4 = createPattern(gss, 4);
   
   
    TechnicalProperty property = ConstraintsFactory.eINSTANCE.createIntegerTechnicalProperty();
    Precondition precondition = ConstraintsFactory.eINSTANCE.createPrecondition();
   
    BaseCondition baseCondition =ConstraintsFactory.eINSTANCE.createBaseCondition();
    baseCondition.setTechnicalProperty(property);
    baseCondition.setValue("foo");
    baseCondition.setOperator(BaseConditionOperators.EQUALS);
   
    precondition.getBaseConditions().add(baseCondition);
    si4.setPrecondition(precondition);

    createImpact(gss, si1, p1, 1);
    createImpact(gss, si4, p1, 1);
View Full Code Here


    int i = 0;
    for (Relation relation : outgoingRelations) {

      Element parentElement = cacheManager.getTargetOfRelation(relation);
      if (parentElement instanceof ConstrainedElement) {
        Precondition precondition = ((ConstrainedElement) parentElement)
            .getPrecondition();
        if (precondition != null)
        result += formatConditionString(precondition);
        i++;
        if (i < size && !result.equals("") && result != null)
View Full Code Here

    Pattern si2 = createPattern(gss, 2);

    TechnicalProperty propery = ConstraintsFactory.eINSTANCE
        .createStringTechnicalProperty();
    propery.setName("foo");
    Precondition precondition = ConstraintsFactory.eINSTANCE
        .createPrecondition();
    BaseCondition baseCondition = ConstraintsFactory.eINSTANCE
        .createBaseCondition();
    baseCondition.setTechnicalProperty(propery);
    baseCondition.setValue("true");
    baseCondition.setOperator(BaseConditionOperators.EQUALS);
    precondition.getBaseConditions().add(baseCondition);
    p1.setPrecondition(precondition);

    createDecomposition(gss, p2, p1);

    createImpact(gss, p1, g1, 1);
View Full Code Here

    Pattern si1 = createPattern(gss, 1);

    TechnicalProperty propery1 = ConstraintsFactory.eINSTANCE
        .createStringTechnicalProperty();
    propery1.setName("foo");
    Precondition precondition1 = ConstraintsFactory.eINSTANCE
        .createPrecondition();
    BaseCondition baseCondition1 = ConstraintsFactory.eINSTANCE
        .createBaseCondition();
    baseCondition1.setTechnicalProperty(propery1);
    baseCondition1.setValue("true");
    baseCondition1.setOperator(BaseConditionOperators.EQUALS);
    precondition1.getBaseConditions().add(baseCondition1);
    p2.setPrecondition(precondition1);

    TechnicalProperty propery2 = ConstraintsFactory.eINSTANCE
        .createStringTechnicalProperty();
    propery2.setName("bar");
    Precondition precondition2 = ConstraintsFactory.eINSTANCE
        .createPrecondition();
    BaseCondition baseCondition2 = ConstraintsFactory.eINSTANCE
        .createBaseCondition();
    baseCondition2.setTechnicalProperty(propery2);
    baseCondition2.setValue("false");
    baseCondition2.setOperator(BaseConditionOperators.EQUALS);
    precondition2.getBaseConditions().add(baseCondition2);
    p3.setPrecondition(precondition2);

    createDecomposition(gss, p2, p1);
    createDecomposition(gss, p3, p1);
View Full Code Here

    createImpact(gss, si2, p1, 1);

    TechnicalProperty propery = ConstraintsFactory.eINSTANCE
        .createStringTechnicalProperty();
    propery.setName("foo");
    Precondition precondition = ConstraintsFactory.eINSTANCE
        .createPrecondition();
    BaseCondition baseCondition = ConstraintsFactory.eINSTANCE
        .createBaseCondition();
    baseCondition.setTechnicalProperty(propery);
    baseCondition.setValue("foo");
    baseCondition.setOperator(BaseConditionOperators.EQUALS);
    precondition.getBaseConditions().add(baseCondition);
    si1.setPrecondition(precondition);

    executeRequiredPhases();

    assertEquals("not ( foo equals foo )",
View Full Code Here

    Pattern si1 = createPattern(gss, 1);
    Pattern si2 = createPattern(gss, 2);

    TechnicalProperty propery = ConstraintsFactory.eINSTANCE
        .createStringTechnicalProperty();
    Precondition precondition = ConstraintsFactory.eINSTANCE
        .createPrecondition();
    BaseCondition baseCondition = ConstraintsFactory.eINSTANCE
        .createBaseCondition();
    baseCondition.setTechnicalProperty(propery);
    baseCondition.setValue("foo");
    baseCondition.setOperator(BaseConditionOperators.EQUALS);
    precondition.getBaseConditions().add(baseCondition);
    si2.setPrecondition(precondition);

    createDecomposition(gss, p2, p1);

    createImpact(gss, p1, g1, 1);
View Full Code Here

  }
 
  @Test
  public void testForFalseCondition() {

    Precondition precondition = ConstraintsFactory.eINSTANCE.createPrecondition();
    precondition.setLogicalConnectiveType(LogicalConnectiveTypes.AND);
    precondition.getBaseConditions().add(ConstraintsFactory.eINSTANCE.createBaseCondition());
   
    property.setName("foo thing");
    precondition.getBaseConditions().get(0).setTechnicalProperty(property);
    precondition.getBaseConditions().get(0).setOperator(BaseConditionOperators.EQUALS);
    precondition.getBaseConditions().get(0).setValue("bar");
       
       
        p1.setPrecondition(precondition);
        assertFalse( applicabilityTester.isApplicable(p1));
        assertTrue( applicabilityTester.isNotApplicable(p1));
View Full Code Here

  }
 
  @Test
  public void testForNotEmptyTrueCondition() {

    Precondition precondition = ConstraintsFactory.eINSTANCE.createPrecondition();
    precondition.setLogicalConnectiveType(LogicalConnectiveTypes.AND);
    precondition.getBaseConditions().add(ConstraintsFactory.eINSTANCE.createBaseCondition());
   
    property.setName("foo thing");
    precondition.getBaseConditions().get(0).setTechnicalProperty(property);
    precondition.getBaseConditions().get(0).setOperator(BaseConditionOperators.EQUALS);
    precondition.getBaseConditions().get(0).setValue("foo");
       
       
        p1.setPrecondition(precondition);
        assertTrue(applicabilityTester.isApplicable(p1));
        assertFalse( applicabilityTester.isNotApplicable(p1));
View Full Code Here

 
 
  @Test
  public void testForUndefinedProperty() {

    Precondition precondition = ConstraintsFactory.eINSTANCE.createPrecondition();
    TechnicalProperty property = ConstraintsFactory.eINSTANCE.createStringTechnicalProperty();
    precondition.setLogicalConnectiveType(LogicalConnectiveTypes.AND);
    precondition.getBaseConditions().add(ConstraintsFactory.eINSTANCE.createBaseCondition());
   
    property.setName("bar thing");
    precondition.getBaseConditions().get(0).setTechnicalProperty(property);
    precondition.getBaseConditions().get(0).setOperator(BaseConditionOperators.EQUALS);
    precondition.getBaseConditions().get(0).setValue("foo");
       
       
        p1.setPrecondition(precondition);
        assertFalse(applicabilityTester.isApplicable(p1));
        assertFalse( applicabilityTester.isNotApplicable(p1));
View Full Code Here

TOP

Related Classes of org.emftrace.metamodel.QUARCModel.Constraints.Precondition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.