Package org.emftrace.metamodel.QUARCModel.Constraints

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


   * <!-- end-user-doc -->
   * @generated NOT
   */
  @Override
  public String getText(Object object) {
     BaseCondition baseCondition =  (BaseCondition)object;
     
     String labelType = baseCondition.getOperator().getName();
     String labelValue = baseCondition.getValue() != null ? baseCondition.getValue() : "";
     String labelProperty =  baseCondition.getTechnicalProperty() != null  && baseCondition.getTechnicalProperty().getName() != null ? baseCondition.getTechnicalProperty().getName() : "";

    return   getString("_UI_BaseCondition_type") + " \" " + labelProperty + " " +labelType+ " "+ labelValue + "\"";
  }
View Full Code Here


   
   
    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);
View Full Code Here

    constraint.setOperator(BaseConditionOperators.EQUALS);
    assignedConstraintsSet.getAssignedConstraints().add(constraint);

    initConditionEvaluator();
   
    BaseCondition baseCondition = createBaseCondition(property,
        BaseConditionOperators.EQUALS, "foo");

    precondition.setLogicalConnectiveType(LogicalConnectiveTypes.AND);
    precondition.getBaseConditions().add(baseCondition);
View Full Code Here

    return constraint;
  }

  private BaseCondition createBaseCondition(TechnicalProperty property,
      BaseConditionOperators type, String value) {
    BaseCondition baseCondition = ConstraintsFactory.eINSTANCE
        .createBaseCondition();
    baseCondition.setTechnicalProperty(property);
    baseCondition.setOperator(type);
    baseCondition.setValue(value);
    return baseCondition;
  }
View Full Code Here

    Constraint constraint = createConstraint(property, "foo");
    constraint.setOperator(BaseConditionOperators.EQUALS);
    assignedConstraintsSet.getAssignedConstraints().add(constraint);

    BaseCondition baseCondition = createBaseCondition(property,
        BaseConditionOperators.EQUALS, "foo");

    precondition.setLogicalConnectiveType(LogicalConnectiveTypes.AND);
    precondition.getBaseConditions().add(baseCondition);

   
    // test for true

    baseCondition.setValue("foo");

    assertLogicalTrue();

    // test for false
    baseCondition.setValue("bar");

    assertLogicalFalse();

    // test for no case sensitive
    baseCondition.setValue("FoO");

    assertLogicalFalse();
  }
View Full Code Here

    Constraint constraint = createConstraint(property, "foo");
    constraint.setOperator(BaseConditionOperators.EQUALS);
    assignedConstraintsSet.getAssignedConstraints().add(constraint);

    BaseCondition baseCondition = createBaseCondition(property,
        BaseConditionOperators.EQUALS_IGNORE_CASE, "foo");

    precondition.setLogicalConnectiveType(LogicalConnectiveTypes.AND);
    precondition.getBaseConditions().add(baseCondition);

   
    // test for true

    baseCondition.setValue("foo");

    assertLogicalTrue();

    // test for false
    baseCondition.setValue("bar");

    assertLogicalFalse();

    // test for case sensitive
    baseCondition.setValue("FoO");

    assertLogicalTrue();
  }
View Full Code Here

    Constraint constraint = createConstraint(property, "1");
    constraint.setOperator(BaseConditionOperators.EQUALS);

    assignedConstraintsSet.getAssignedConstraints().add(constraint);

    BaseCondition baseCondition = createBaseCondition(property,
        BaseConditionOperators.MATCHES, "1");

    precondition.setLogicalConnectiveType(LogicalConnectiveTypes.AND);
    precondition.getBaseConditions().add(baseCondition);

    baseCondition.setOperator(BaseConditionOperators.GREATER_THAN);
    assertIsInvalid();

    baseCondition.setOperator(BaseConditionOperators.LESS_THAN);
    assertIsInvalid();

    baseCondition.setOperator(BaseConditionOperators.MAXIMAL);
    assertIsInvalid();

    baseCondition.setOperator(BaseConditionOperators.MINIMAL);
    assertIsInvalid();
   
    baseCondition.setOperator(BaseConditionOperators.MATCHES);
    assertIsInvalid();
   
    baseCondition.setOperator(BaseConditionOperators.APPROXIMATELY_EQUALS);
    assertIsInvalid();


  }
View Full Code Here

    Constraint constraint = createConstraint(property, "foo");
    constraint.setOperator(BaseConditionOperators.EQUALS);

    assignedConstraintsSet.getAssignedConstraints().add(constraint);

    BaseCondition baseCondition = createBaseCondition(property,
        BaseConditionOperators.EQUALS, "foo");

    precondition.setLogicalConnectiveType(LogicalConnectiveTypes.AND);
    precondition.getBaseConditions().add(baseCondition);

    // test for true

    baseCondition.setValue("foo");

    assertLogicalTrue();

    // test for false
    baseCondition.setValue("bar");

    assertLogicalFalse();

    // test for no case sensitive
    baseCondition.setValue("FoO");

    assertLogicalFalse();
  }
View Full Code Here

    Constraint constraint = createConstraint(property, "foo");
    constraint.setOperator(BaseConditionOperators.EQUALS);

    assignedConstraintsSet.getAssignedConstraints().add(constraint);

    BaseCondition baseCondition = createBaseCondition(property,
        BaseConditionOperators.MATCHES, "foo");

    precondition.setLogicalConnectiveType(LogicalConnectiveTypes.AND);
    precondition.getBaseConditions().add(baseCondition);

    baseCondition.setOperator(BaseConditionOperators.GREATER_THAN);
    assertIsInvalid();

    baseCondition.setOperator(BaseConditionOperators.LESS_THAN);
    assertIsInvalid();

    baseCondition.setOperator(BaseConditionOperators.MAXIMAL);
    assertIsInvalid();

    baseCondition.setOperator(BaseConditionOperators.MINIMAL);
    assertIsInvalid();
   
    baseCondition.setOperator(BaseConditionOperators.MATCHES);
    assertIsInvalid();
   
    baseCondition.setOperator(BaseConditionOperators.EQUALS_IGNORE_CASE);
    assertIsInvalid();
   
    baseCondition.setOperator(BaseConditionOperators.APPROXIMATELY_EQUALS);
    assertIsInvalid();
 
  }
View Full Code Here

    Constraint constraint = createConstraint(property, "foo");
    constraint.setOperator(BaseConditionOperators.EQUALS);

    assignedConstraintsSet.getAssignedConstraints().add(constraint);

    BaseCondition baseCondition = createBaseCondition(property,
        BaseConditionOperators.MATCHES, "foo");

    precondition.setLogicalConnectiveType(LogicalConnectiveTypes.AND);
    precondition.getBaseConditions().add(baseCondition);

    baseCondition.setValue("(foo|bar)");
    // test for true

    constraint.setValue("foo");
    assertLogicalTrue();
View Full Code Here

TOP

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

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.