Examples of Precondition


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

    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

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

  }
 
  @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

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

  }
 
  @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

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

 
 
  @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

Examples of org.gcontracts.domain.Precondition

    @Override
    public void process(ProcessingContextInformation processingContextInformation, Contract contract, ClassNode classNode, MethodNode methodNode, BlockStatement blockStatement, BooleanExpression booleanExpression) {
        if (!processingContextInformation.isPreconditionsEnabled()) return;
        if (booleanExpression == null) return;

        contract.preconditions().or(methodNode, new Precondition(blockStatement, booleanExpression));
    }
View Full Code Here

Examples of org.jboss.mbui.gui.behaviour.Precondition

        final Set<String> requiredStatements = address.getRequiredStatements();

        // any value expression key becomes a precondition matched against the statement context
        if(requiredStatements.size()>0)
        {
            setPrecondition(new Precondition() {
                @Override
                public boolean isMet(StatementContext statementContext) {
                    boolean isMet = false;
                    for(String key : requiredStatements)
                    {
View Full Code Here

Examples of org.jboss.mbui.gui.behaviour.Precondition

        final Set<String> requiredStatements = address.getRequiredStatements();

        // any value expression key becomes a precondition matched against the statement context
        if(requiredStatements.size()>0)
        {
            setPrecondition(new Precondition() {
                @Override
                public boolean isMet(StatementContext statementContext) {
                    boolean isMet = false;
                    for(String key : requiredStatements)
                    {
View Full Code Here

Examples of org.useware.kernel.gui.behaviour.Precondition

        // check preconditions of the address token
        final Set<String> requiredStatements = address.getRequiredStatements();

        // any value expression key becomes a precondition matched against the statement context
        setPrecondition(new Precondition() {
            @Override
            public boolean isMet(StatementContext statementContext) {

                // fail fast if not scope active
                if(!getRuntimeAPI().isActive(unit.getId())) return false;
View Full Code Here

Examples of org.useware.kernel.gui.behaviour.Precondition

        // check preconditions of the address token
        final Set<String> requiredStatements = address.getRequiredStatements();

        // any value expression key becomes a precondition matched against the statement context

        setPrecondition(new Precondition() {
            @Override
            public boolean isMet(StatementContext statementContext) {

                // fail fast if not scope active
                if(!getRuntimeAPI().isActive(unit.getId())) return false;
View Full Code Here

Examples of org.useware.kernel.gui.behaviour.Precondition

        // check preconditions of the address token
        final Map<String, Integer> requiredStatements = address.getRequiredStatements();

        // any value expression key becomes a precondition matched against the statement context

        setPrecondition(new Precondition() {
            @Override
            public boolean isMet(StatementContext statementContext) {

                // fail fast if not scope active
                if(!getRuntimeAPI().isActive(unit.getId())) return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.