Examples of TCGOCLOperation


Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

        .createTCGDisjunctiveNormalForm();
    if (in_oExpression == null)
      return oDNF;

    if (in_oExpression instanceof TCGOCLOperation) {
      TCGOCLOperation oOpExp = (TCGOCLOperation) in_oExpression;

      // TODO f�r alle andere booleschen Operatoren erweitern
      if (oOpExp.getOperationName().compareTo("and") == 0) {
        TCGDisjunctiveNormalForm oLeftDNF = createDisjunctiveNormalForm(oOpExp
            .getLeft(), in_bSplitInequations);
        TCGDisjunctiveNormalForm oRightDNF = createDisjunctiveNormalForm(oOpExp
            .getRight(), in_bSplitInequations);
        return connectTwoDNFWithAnd(oLeftDNF, oRightDNF);
      }

      if (oOpExp.getOperationName().compareTo("or") == 0) {
//        TCGDisjunctiveNormalForm oLeftDNF = createDisjunctiveNormalForm(oOpExp
//            .getLeft(), in_bSplitInequations);
//        TCGDisjunctiveNormalForm oRightDNF = createDisjunctiveNormalForm(oOpExp
//            .getRight(), in_bSplitInequations);
//        return connectTwoDNFWithOr(oLeftDNF, oRightDNF);

         TCGDisjunctiveNormalForm oFirstDNF = null;
         {
           TCGOCLExpression oFirstExp =
             TCGOCLExpressionHelperClass.copyExpression(oOpExp.getLeft());
           TCGOCLExpression oSecondExp =
             TCGOCLExpressionHelperClass.copyExpression(oOpExp.getRight());
           oFirstDNF = connectTwoDNFWithAnd(
               createDisjunctiveNormalForm(oFirstExp, in_bSplitInequations),
               createDisjunctiveNormalForm(oSecondExp, in_bSplitInequations));
         }
       
         TCGDisjunctiveNormalForm oSecondDNF = null;
         {
           TCGOCLExpression oFirstExp =
             TCGOCLExpressionHelperClass.copyExpression(oOpExp.getLeft());
           oFirstExp = net.sf.parteg.base.testcasegraph.helperclasses.TCGOCLExpressionHelperClass.negateLogicalTCGOCLExpression(oFirstExp);
           TCGOCLExpression oSecondExp =
             TCGOCLExpressionHelperClass.copyExpression(oOpExp.getRight());
           oSecondDNF = connectTwoDNFWithAnd(
               createDisjunctiveNormalForm(oFirstExp, in_bSplitInequations),
               createDisjunctiveNormalForm(oSecondExp, in_bSplitInequations));
         }
               
         TCGDisjunctiveNormalForm oThirdDNF = null;
         {
           TCGOCLExpression oFirstExp =
             TCGOCLExpressionHelperClass.copyExpression(oOpExp.getLeft());
           TCGOCLExpression oSecondExp =
             TCGOCLExpressionHelperClass.copyExpression(oOpExp.getRight());
           oSecondExp = net.sf.parteg.base.testcasegraph.helperclasses.TCGOCLExpressionHelperClass.negateLogicalTCGOCLExpression(oSecondExp);
           oThirdDNF = connectTwoDNFWithAnd(
               createDisjunctiveNormalForm(oFirstExp, in_bSplitInequations),
               createDisjunctiveNormalForm(oSecondExp, in_bSplitInequations));
         }
               
         return connectTwoDNFWithOr(oFirstDNF,
             connectTwoDNFWithOr(oSecondDNF, oThirdDNF));
      }

      if (oOpExp.getOperationName().compareTo("not") == 0) {
        // negation has to be applicated to all sub-expressions
        // TODO: introduce unary operation - which side holds the
        // information?
        TCGOCLExpression oNegatedExpression = null;
        if (oOpExp.getLeft() != null) {
          oNegatedExpression = oOpExp.getLeft();
        } else if (oOpExp.getRight() != null) {
          oNegatedExpression = oOpExp.getRight();
        }
        if(TCGOCLExpressionHelperClass.isBooleanAtom(oNegatedExpression)) {
          oDNF.getConjunctions().add(
              GeneratedFactory.eINSTANCE.createTCGConjunction());
          oDNF.getConjunctions().get(0).getExpressions().add(
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

      TCGDisjunctiveNormalForm in_oDNF) {
    if (!in_oDNF.getConjunctions().isEmpty()) {
      TCGOCLExpression oExpression = TCGConjunctionHelperClass.convertConjunctionToExpression(in_oDNF
          .getConjunctions().get(0));
      for (int i = 1; i < in_oDNF.getConjunctions().size(); ++i) {
        TCGOCLOperation oNewOperation = GeneratedFactory.eINSTANCE
            .createTCGOCLOperation();
        oNewOperation.setLeft(oExpression);
        oNewOperation.setOperationName("or");
        TCGOCLExpression oCurrentExpression = TCGConjunctionHelperClass.convertConjunctionToExpression(in_oDNF
            .getConjunctions().get(i));
        oNewOperation.setRight(oCurrentExpression);
        oExpression = oNewOperation;
      }
      return oExpression;
    }
    return null;
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

   
    if (in_oExpression == null)
      return;

    if (in_oExpression instanceof TCGOCLOperation) {
      TCGOCLOperation oOpExp = (TCGOCLOperation) in_oExpression;

      // TODO f�r alle anderen booleschen Operatoren erweitern
      if (oOpExp.getOperationName().equals("and") ||
          oOpExp.getOperationName().equals("or"))
      {
        createRestrictedDisjunctiveNormalForm(
            oOpExp.getLeft(), in_oRow, in_bSplitInequations, out_oDNF);
        createRestrictedDisjunctiveNormalForm(
            oOpExp.getRight(), in_oRow, in_bSplitInequations, out_oDNF);
        return;
      }
      else if(oOpExp.getOperationName().equals("not")) {
        TCGOCLExpression oTmpExp = TCGOCLExpressionHelperClass.removeDoubleNots(oOpExp);
        if(oTmpExp instanceof TCGOCLOperation) {
          oOpExp = (TCGOCLOperation)oTmpExp;

          // removed double nots - still not?
          if(oOpExp.getOperationName().equals("not") &&
              !TCGOCLExpressionHelperClass.isBooleanAtom(
                  TCGOCLExpressionHelperClass.getNonNullLeftOrRight(oOpExp))) {
            createRestrictedDisjunctiveNormalForm(
                TCGOCLExpressionHelperClass.getNonNullLeftOrRight(oOpExp),
                in_oRow, in_bSplitInequations, out_oDNF);
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

          if(oAtomExp.getElement().equals(in_oProperty))
          {
            oClassificator.shiftSubexpressionToTheLeft(oActiveExpression);
            if(oClassificator.getExpression() instanceof TCGOCLOperation)
            {
              TCGOCLOperation oOperation = (TCGOCLOperation)oClassificator.getExpression();
              TCGOCLVariableClassificator oRightSubClassificator = new TCGOCLVariableClassificator(oOperation.getRight());
             
              // does the right side contain an active dependent element? -> schwierig -> daf�r oActiveExpression und
              // oActiveSubExpression auseinanderhalten !
              //TCGOCLExpression oActiveSubExpression = oRightSubClassificator.getClassifiedElementInExpression(VariableClassification.ACTIVE_DEPENDENT);
 
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

      // adding the reference from the atom to the containing transition
      add(oAtom.getElement(), in_oTransition);
    }
    else if(in_oExpression instanceof TCGOCLOperation)
    {
      TCGOCLOperation oOperation = (TCGOCLOperation)in_oExpression;
      createVariableReferences(oOperation.getLeft(), in_oTransition);
      createVariableReferences(oOperation.getRight(), in_oTransition);
    }
    else if(in_oExpression instanceof TCGOCLIfThenElse)
    {
      TCGOCLIfThenElse oIfThenElse = (TCGOCLIfThenElse)in_oExpression;
      createVariableReferences(oIfThenElse.getCondition(), in_oTransition);
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

    if(in_oExpression == null)
      return colRows;
   
    if(isBooleanOperation(in_oExpression))
    {
      TCGOCLOperation oOperation = (TCGOCLOperation)in_oExpression;
      ArrayList<DecisionTableExpressionValueSelection> colLeftRows =
        getMCDCForExpression(oOperation.getLeft(), in_colAtomicExpressions);
      ArrayList<DecisionTableExpressionValueSelection> colRightRows =
        getMCDCForExpression(oOperation.getRight(), in_colAtomicExpressions);
      ArrayList<DecisionTableExpressionValueSelection> colLeftPositiveRows =
        new ArrayList<DecisionTableExpressionValueSelection>();
      ArrayList<DecisionTableExpressionValueSelection> colLeftNegativeRows =
        new ArrayList<DecisionTableExpressionValueSelection>();
      ArrayList<DecisionTableExpressionValueSelection> colRightPositiveRows =
        new ArrayList<DecisionTableExpressionValueSelection>();
      ArrayList<DecisionTableExpressionValueSelection> colRightNegativeRows =
        new ArrayList<DecisionTableExpressionValueSelection>();
      getPositiveAndNegativeRows(
          colLeftRows, colLeftPositiveRows, colLeftNegativeRows);
      getPositiveAndNegativeRows(
          colRightRows, colRightPositiveRows, colRightNegativeRows);
     
      if(oOperation.getOperationName().equals("and"))
      {
        colRows.addAll(uniteRows(
            colLeftPositiveRows, colRightPositiveRows, true));
        colRows.addAll(keepFirstRowsAndAddAnyElementsOfSecond(
            colRightNegativeRows, colLeftPositiveRows, false));
        colRows.addAll(keepFirstRowsAndAddAnyElementsOfSecond(
            colLeftNegativeRows, colRightPositiveRows, false));
      } else if(oOperation.getOperationName().equals("or"))
      {
        colRows.addAll(uniteRows(
            colLeftNegativeRows, colRightNegativeRows, false));
        colRows.addAll(keepFirstRowsAndAddAnyElementsOfSecond(
            colLeftPositiveRows, colRightNegativeRows, true));       
        colRows.addAll(keepFirstRowsAndAddAnyElementsOfSecond(
            colRightPositiveRows, colLeftNegativeRows, true));
      } else if(oOperation.getOperationName().equals("not"))
      {
        colRows.addAll(changeRowValue(colLeftPositiveRows, false));
        colRows.addAll(changeRowValue(colLeftNegativeRows, true));
        colRows.addAll(changeRowValue(colRightPositiveRows, false));
        colRows.addAll(changeRowValue(colRightNegativeRows, true));
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

      //moderate pre conditions
      if(!oTran.getPreconditions().isEmpty()){
        for (TCGDisjunctiveNormalForm oPre : oTran.getPreconditions()) {
          if(!oPre.getConjunctions().isEmpty()){
            if(oPre.getOriginalExpression() instanceof TCGOCLOperationImpl){
              TCGOCLOperation oTCGOCLOperation = ((TCGOCLOperation) oPre.getOriginalExpression());
              if(oTCGOCLOperation.getRight() != null && oTCGOCLOperation.getOperationName().equals("=")){ 
                sb.append("      assertEquals(" + ConvertTCGOCLExpressionToString.constraintVisitor(oTCGOCLOperation.getLeft()) + ","+
                     ConvertTCGOCLExpressionToString.constraintVisitor(oTCGOCLOperation.getRight())+");\n");
              }
              else
                sb.append("      assertEquals(true, " + ConvertTCGOCLExpressionToString.constraintVisitor(oPre.getOriginalExpression()) + ");\n");
            }
            else
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

    if(bValue != null)
      return bValue;
   
    if(in_oExpression instanceof TCGOCLOperation)
    {
      TCGOCLOperation oOperation = (TCGOCLOperation)in_oExpression;
      if(oOperation.getOperationName().equals("and"))
      {
        bValue = evaluateExpressionWithValueAssignment(oOperation.getLeft(), in_oRow) &&
          evaluateExpressionWithValueAssignment(oOperation.getRight(), in_oRow);
        in_oRow.put(in_oExpression, bValue);
        return bValue;
      }
      if(oOperation.getOperationName().equals("or"))
      {
        bValue = evaluateExpressionWithValueAssignment(oOperation.getLeft(), in_oRow) ||
          evaluateExpressionWithValueAssignment(oOperation.getRight(), in_oRow);
        in_oRow.put(in_oExpression, bValue);
        return bValue;
      }
      if(oOperation.getOperationName().equals("not"))
      {
        TCGOCLExpression oNegatedExp = oOperation.getLeft();
        if(oNegatedExp == null) {
          oNegatedExp = oOperation.getRight();
        }
        bValue = !evaluateExpressionWithValueAssignment(oNegatedExp, in_oRow);
        in_oRow.put(in_oExpression, bValue);
        return bValue;
      }
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

      oAlternatives.add(new DecisionRowAtomic(in_oExpression, false));
      oRows.getNegativeNecessary().add(oAlternatives);
    }
    else if(isBooleanOperation(in_oExpression))
    {
      TCGOCLOperation oOperation = (TCGOCLOperation)in_oExpression;
     
      DecisionRowSelector oLeftRows =
        getMCDCForExpression(oOperation.getLeft(),
            in_colAtomicExpressions, in_bCreateRowsForUnnecessaryValues);
      DecisionRowSelector oRightRows =
        getMCDCForExpression(oOperation.getRight(),
            in_colAtomicExpressions, in_bCreateRowsForUnnecessaryValues);
     
      if(oOperation.getOperationName().equals("and"))
      {
        return selectRowsForAnd(oLeftRows, oRightRows, in_bCreateRowsForUnnecessaryValues);
      }
      else if(oOperation.getOperationName().equals("or"))
      {
        return selectRowsForOr(oLeftRows, oRightRows, in_bCreateRowsForUnnecessaryValues);
      }
      else if(oOperation.getOperationName().equals("not"))
      {
        return selectRowsForNot(oLeftRows, oRightRows, in_bCreateRowsForUnnecessaryValues);
      }
    }
    else if(in_oExpression instanceof TCGOCLIfThenElse)
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

        if(!isBooleanOperation(oNegatedExp)) {
          m_colExpressions.add(in_oExpression);
        }
      }
      else {
        TCGOCLOperation oOperation = (TCGOCLOperation)in_oExpression;
        if(oOperation.getLeft() != null && !isBooleanOperation(oOperation.getLeft()))
            m_colExpressions.add(oOperation.getLeft());
         
        if(oOperation.getRight() != null && !isBooleanOperation(oOperation.getRight()))
            m_colExpressions.add(oOperation.getRight());
      }
    }
    else if(in_oExpression instanceof TCGOCLIfThenElse)
    {
      TCGOCLIfThenElse oIfThenElse = (TCGOCLIfThenElse)in_oExpression;
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.