Package net.sf.parteg.base.testcasetree.generated

Examples of net.sf.parteg.base.testcasetree.generated.TCGConjunction


        T result = caseTCGOCLExpression(tcgoclExpression);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GeneratedPackage.TCG_CONJUNCTION: {
        TCGConjunction tcgConjunction = (TCGConjunction)theEObject;
        T result = caseTCGConjunction(tcgConjunction);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GeneratedPackage.TCG_DISJUNCTIVE_NORMAL_FORM: {
View Full Code Here


      if(oOpExp.getOperationName().compareTo("<>") == 0)
      {
        // split up "<>" in two alternatives: "<" or ">"
        TCGOCLOperation oFirstExp = (TCGOCLOperation)TestCaseGraphHelper.copyExpression(oOpExp);
        oFirstExp.setOperationName("<");
        TCGConjunction oFirstConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
        oFirstConjunction.getExpressions().add(oFirstExp);

        TCGOCLOperation oSecondExp = (TCGOCLOperation)TestCaseGraphHelper.copyExpression(oOpExp);
        oSecondExp.setOperationName(">");
        TCGConjunction oSecondConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
        oSecondConjunction.getExpressions().add(oSecondExp);

        TCGDisjunctiveNormalForm oNewDNF = GeneratedFactory.eINSTANCE.createTCGDisjunctiveNormalForm();
        oNewDNF.getConjunctions().add(oFirstConjunction);
        oNewDNF.getConjunctions().add(oSecondConjunction);
        return oNewDNF;
View Full Code Here

    TCGDisjunctiveNormalForm oResultDNF = GeneratedFactory.eINSTANCE.createTCGDisjunctiveNormalForm();
    for(TCGConjunction oLeftConjunction : in_oLeftDNF.getConjunctions())
    {
      for(TCGConjunction oRightConjunction : in_oRightDNF.getConjunctions())
      {
        TCGConjunction oNewConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
        oNewConjunction.getExpressions().addAll(oLeftConjunction.getExpressions());
        oNewConjunction.getExpressions().addAll(oRightConjunction.getExpressions());
        oResultDNF.getConjunctions().add(oNewConjunction);
      }
    }
    return oResultDNF;
  }
View Full Code Here

public class TCGConjunctionHelperClass {

  public static TCGConjunction copyConjunction(TCGConjunction in_oConjunction)
  {
    TCGConjunction oConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
    oConjunction.getExpressions().addAll(in_oConjunction.getExpressions());
    return oConjunction;
  }
View Full Code Here

    if(io_nCurrentConjunctionsSetIndex >= in_colConjunctionSets.size())
    {
      // without any changeable conjunction, the assembled conjunctions would be no element of MCDC
      if(io_nChangeableConjunctionCounter >= 1)
      {
        TCGConjunction oNewConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
        oNewConjunction.setCanChangeValueIfOneExpressionChanges(true);
        if(io_nCurrentPositiveIndex >= 0)
          oNewConjunction.setPositiveSubExpressionOfOriginal(true);
        else
          oNewConjunction.setPositiveSubExpressionOfOriginal(false);
       
        for(TCGConjunction oConjunction : io_colNewConjunctions)
        {
          oNewConjunction.getExpressions().addAll(oConjunction.getExpressions());
        }
        // combine the expressions of all elements
        // TODO #### reduce number of expressions for MCDC
        io_oDNF.getConjunctions().add(oNewConjunction);
      }
View Full Code Here

      int in_nCurrentExpressionIndex,
      boolean in_bContainsNegativeExpressions)
  {
    if(in_nCurrentExpressionIndex >= in_oOriginalConjunction.getExpressions().size())
    {
      TCGConjunction oNewConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
      oNewConjunction.getExpressions().addAll(io_colExpressionsForNewConjunction);
      oNewConjunction.setPositiveSubExpressionOfOriginal(!in_bContainsNegativeExpressions);
      io_colNewConjunctions.get(in_oOriginalConjunction).add(oNewConjunction);
    }
    else
    {
      TCGOCLExpression oExpression = TestCaseGraphHelper.copyExpression(
          in_oOriginalConjunction.getExpressions().get(in_nCurrentExpressionIndex));
      io_colExpressionsForNewConjunction.add(oExpression);
      addAllPossibleConjunctions(io_colNewConjunctions, in_oOriginalConjunction, io_colExpressionsForNewConjunction,
          in_nCurrentExpressionIndex + 1, in_bContainsNegativeExpressions);
      io_colExpressionsForNewConjunction.remove(oExpression);
     
      TCGOCLExpression oNegatedExpression = TestCaseGraphHelper.copyExpression(oExpression);
      oNegatedExpression = negateTCGOCLExpression(oNegatedExpression);
      TCGDisjunctiveNormalForm oDNF =  createDisjunctiveNormalForm(oNegatedExpression);
      for(TCGConjunction oNewConjunction : oDNF.getConjunctions())
      {
        for(TCGOCLExpression oNewConjExp : oNewConjunction.getExpressions())
        {
          io_colExpressionsForNewConjunction.add(oNewConjExp);
          addAllPossibleConjunctions(io_colNewConjunctions, in_oOriginalConjunction, io_colExpressionsForNewConjunction,
              in_nCurrentExpressionIndex + 1, true);
          io_colExpressionsForNewConjunction.remove(oNewConjExp);
View Full Code Here

    // all expressions collected -> assemble the conjunction
    if(in_nCurrentExpressionIndex >= in_oOriginalConjunction.getExpressions().size())
    {
      if(in_nNegativeExpressionCounter == 0)
      {
        TCGConjunction oPositiveConjunction = TCGConjunctionHelperClass.copyConjunction(in_oOriginalConjunction);
        oPositiveConjunction.setPositiveSubExpressionOfOriginal(true);
        oPositiveConjunction.setCanChangeValueIfOneExpressionChanges(true);
        io_colNewConjunctions.setPositiveConjunction(oPositiveConjunction);
      }
      else
      {
        TCGConjunction oNegativeConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
        oNegativeConjunction.getExpressions().addAll(io_colExpressionsForNewConjunction);
        oNegativeConjunction.setPositiveSubExpressionOfOriginal(false);
        if(in_nNegativeExpressionCounter == 1)
        {
          oNegativeConjunction.setCanChangeValueIfOneExpressionChanges(true);
          io_colNewConjunctions.getNegativeButChangeableConjunctions().add(oNegativeConjunction);
        }
        else
        {
          oNegativeConjunction.setCanChangeValueIfOneExpressionChanges(false);
          io_colNewConjunctions.getNegativeAndUnchangeableConjunctions().add(oNegativeConjunction);
        }
      }
    }
    else // collect all expression permutations
View Full Code Here

      ArrayList<TCGConjunction> io_colCurrentCombinedConjunction)
  {
    if(in_nCurrentIndex >= io_colNewConjunctions.size())
    {
      // assemble the conjunctions of io_colCurrentCombinedConjunction
      TCGConjunction oNewConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
      for(TCGConjunction oConjunction : io_colCurrentCombinedConjunction)
      {
        if(oConjunction.isPositiveSubExpressionOfOriginal() == false)
          oNewConjunction.setPositiveSubExpressionOfOriginal(false);
       
        for(TCGOCLExpression oExpression : oConjunction.getExpressions())
        {
          oNewConjunction.getExpressions().add(oExpression);
        }
      }
      // just assembled conjunction
      io_colCombinedConjunctions.add(oNewConjunction);
    }
View Full Code Here

TOP

Related Classes of net.sf.parteg.base.testcasetree.generated.TCGConjunction

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.