Package org.emftrace.metamodel.QUARCModel.Constraints

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


    {
        super.setUp();
       
        AssignedConstraintsSet assignedConstraintsSet = QueryFactory.eINSTANCE.createAssignedConstraintsSet();
       
    Constraint assignedConstraint = ConstraintsFactory.eINSTANCE.createConstraint();

   
    assignedConstraintsSet.getAssignedConstraints().add(assignedConstraint);
   
    property = ConstraintsFactory.eINSTANCE.createStringTechnicalProperty();
    property.setName("foo thing");

    assignedConstraint.setTechnicalProperty(property);
    assignedConstraint.setOperator(BaseConditionOperators.EQUALS);
    assignedConstraint.setValue("foo");
    applicabilityTester = new ApplicabilityTester(assignedConstraintsSet);
   

    p1 = GSSFactory.eINSTANCE.createPrinciple();
    p1.setName("Principle 1");
View Full Code Here


    precondition.setLogicalConnectiveType(LogicalConnectiveTypes.EQUIVALENT);
    precondition.getBaseConditions().add(baseCondition1);
    precondition.getBaseConditions().add(baseCondition2);

    Constraint constraint1 = createConstraint(property1, "true");
    constraint1.setOperator(BaseConditionOperators.EQUALS);
    Constraint constraint2 = createConstraint(property2, "true");
    constraint2.setOperator(BaseConditionOperators.EQUALS);

    assignedConstraintsSet.getAssignedConstraints().add(constraint1);
    assignedConstraintsSet.getAssignedConstraints().add(constraint2);

    // true / true

    constraint1.setValue("true");
    constraint2.setValue("true");
    assertLogicalTrue();
   
    assertAssignmentForPropertyIsNotRequiered(property1);
    assertAssignmentForPropertyIsNotRequiered(property2);

    // true / false

    constraint1.setValue("true");
    constraint2.setValue("false");
    assertLogicalFalse();
   
    assertAssignmentForPropertyIsNotRequiered(property1);
    assertAssignmentForPropertyIsNotRequiered(property2);

    // false /true

    constraint1.setValue("false");
    constraint2.setValue("true");
    assertLogicalFalse();
   
    assertAssignmentForPropertyIsNotRequiered(property1);
    assertAssignmentForPropertyIsNotRequiered(property2);

    // false /false

    constraint1.setValue("false");
    constraint2.setValue("false");
    assertLogicalTrue();
   
    assertAssignmentForPropertyIsNotRequiered(property1);
    assertAssignmentForPropertyIsNotRequiered(property2);

    // undefined /false

    constraint1.setTechnicalProperty(property3);
    constraint2.setTechnicalProperty(property2);
    constraint1.setValue("true");
    constraint2.setValue("false");
    assertLogicalUndefined();
   
    assertPropertyIsUnassigned(property1, true);
    assertAssignmentForPropertyIsNotRequiered(property2);

    // undefined /true

    constraint1.setTechnicalProperty(property3);
    constraint2.setTechnicalProperty(property2);
    constraint1.setValue("true");
    constraint2.setValue("true");
    assertLogicalUndefined();
   
    assertPropertyIsUnassigned(property1, true);
    assertAssignmentForPropertyIsNotRequiered(property2);

    // false / undefined

    constraint1.setTechnicalProperty(property1);
    constraint2.setTechnicalProperty(property3);

    constraint1.setValue("false");
    constraint2.setValue("true");
    assertLogicalUndefined();
   
    assertAssignmentForPropertyIsNotRequiered(property1);
    assertPropertyIsUnassigned(property2, true);


    // true / undefined

    constraint1.setTechnicalProperty(property1);
    constraint2.setTechnicalProperty(property3);

    constraint1.setValue("true");
    constraint2.setValue("true");
    assertLogicalUndefined();
   
    assertAssignmentForPropertyIsNotRequiered(property1);
    assertPropertyIsUnassigned(property2, true);

    // undefined / undefined

    constraint1.setTechnicalProperty(property3);
    constraint2.setTechnicalProperty(property4);

    constraint1.setValue("true");
    constraint2.setValue("true");
    assertLogicalUndefined();
   
    assertPropertyIsUnassigned(property1, false);
    assertPropertyIsUnassigned(property2, false);
View Full Code Here

        .createLogicCondition();
    logicCondition2.setLogicalConnectiveType(LogicalConnectiveTypes.AND);
    logicCondition2.getBaseConditions().add(baseCondition5);
    logicCondition2.getBaseConditions().add(baseCondition6);

    Constraint constraint1 = createConstraint(property1, "true");
    constraint1.setOperator(BaseConditionOperators.EQUALS);
    assignedConstraintsSet.getAssignedConstraints().add(constraint1);

    // number base conditions > 1

    precondition.getBaseConditions().clear();
View Full Code Here

    precondition.setLogicalConnectiveType(LogicalConnectiveTypes.OR);
    precondition.getLogicConditions().add(logicCondition1);
    precondition.getLogicConditions().add(logicCondition2);

    Constraint constraint1 = createConstraint(property1, "true");
    constraint1.setOperator(BaseConditionOperators.EQUALS);
    Constraint constraint2 = createConstraint(property2, "true");
    constraint2.setOperator(BaseConditionOperators.EQUALS);
    Constraint constraint3 = createConstraint(property3, "true");
    constraint3.setOperator(BaseConditionOperators.EQUALS);
    Constraint constraint4 = createConstraint(property4, "true");
    constraint4.setOperator(BaseConditionOperators.EQUALS);

    assignedConstraintsSet.getAssignedConstraints().add(constraint1);
    assignedConstraintsSet.getAssignedConstraints().add(constraint2);
    assignedConstraintsSet.getAssignedConstraints().add(constraint3);
    assignedConstraintsSet.getAssignedConstraints().add(constraint4);

    // true & true | true & true

    constraint1.setValue("true");
    constraint2.setValue("true");
    constraint3.setValue("true");
    constraint4.setValue("true");
    assertLogicalTrue();

    // false & true | true & true

    constraint1.setValue("false");
    constraint2.setValue("true");
    constraint3.setValue("true");
    constraint4.setValue("true");
    assertLogicalTrue();

    // false & false | true & true

    constraint1.setValue("false");
    constraint2.setValue("false");
    constraint3.setValue("true");
    constraint4.setValue("true");
    assertLogicalTrue();
   
    // false & false | false & true

    constraint1.setValue("false");
    constraint2.setValue("false");
    constraint3.setValue("false");
    constraint4.setValue("true");
    assertLogicalFalse();
   
    // false & false | false & false

    constraint1.setValue("false");
    constraint2.setValue("false");
    constraint3.setValue("false");
    constraint4.setValue("false");
    assertLogicalFalse();
   
    // undefined & true | true & true

    constraint1.setValue("true");
    constraint2.setValue("true");
    constraint3.setValue("true");
    constraint4.setValue("true");
   
    constraint1.setTechnicalProperty(property5);
    constraint2.setTechnicalProperty(property2);
    constraint3.setTechnicalProperty(property3);
    constraint4.setTechnicalProperty(property4);
   
    assertLogicalTrue();
   
    // undefined & undefined | true & true

    constraint1.setValue("true");
    constraint2.setValue("true");
    constraint3.setValue("true");
    constraint4.setValue("true");
   
    constraint1.setTechnicalProperty(property5);
    constraint2.setTechnicalProperty(property6);
    constraint3.setTechnicalProperty(property3);
    constraint4.setTechnicalProperty(property4);
   
    assertLogicalTrue();
   
   
    // undefined & undefined | undefined & true

    constraint1.setValue("true");
    constraint2.setValue("true");
    constraint3.setValue("true");
    constraint4.setValue("true");
   
    constraint1.setTechnicalProperty(property5);
    constraint2.setTechnicalProperty(property6);
    constraint3.setTechnicalProperty(property7);
    constraint4.setTechnicalProperty(property4);
   
    assertLogicalUndefined();
   
    // undefined & undefined | undefined & undefined

    constraint1.setValue("true");
    constraint2.setValue("true");
    constraint3.setValue("true");
    constraint4.setValue("true");
   
    constraint1.setTechnicalProperty(property5);
    constraint2.setTechnicalProperty(property6);
    constraint3.setTechnicalProperty(property7);
    constraint4.setTechnicalProperty(property8);
   
    assertLogicalUndefined();
   
    // false & false | false & undefined

    constraint1.setValue("false");
    constraint2.setValue("false");
    constraint3.setValue("false");
    constraint4.setValue("true");
   
    constraint1.setTechnicalProperty(property1);
    constraint2.setTechnicalProperty(property2);
    constraint3.setTechnicalProperty(property3);
    constraint4.setTechnicalProperty(property8);
   
    assertLogicalFalse();
   
    // undefined& false | false & undefined

    constraint1.setValue("true");
    constraint2.setValue("false");
    constraint3.setValue("false");
    constraint4.setValue("true");
   
    constraint1.setTechnicalProperty(property5);
    constraint2.setTechnicalProperty(property2);
    constraint3.setTechnicalProperty(property3);
    constraint4.setTechnicalProperty(property7);
   
    assertLogicalFalse();
   
    // undefined& false | false & undefined

    constraint1.setValue("true");
    constraint2.setValue("false");
    constraint3.setValue("false");
    constraint4.setValue("true");
   
    constraint1.setTechnicalProperty(property5);
    constraint2.setTechnicalProperty(property2);
    constraint3.setTechnicalProperty(property3);
    constraint4.setTechnicalProperty(property7);
   
    assertLogicalFalse();

  }
View Full Code Here

TOP

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

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.