Examples of TCGOCLExpression


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

      TCGDisjunctiveNormalForm oResultingDNF = GeneratedFactory.eINSTANCE.createTCGDisjunctiveNormalForm();
     
      // negate each expression for one referenced object
      for(TCGOCLExpression oExpression : in_colFirstObjectToExpressions.get(oReferencedObject))
      {
        TCGOCLExpression oNegativeExpression = TCGOCLExpressionHelperClass
          .copyExpression(oExpression);
       
        // create DNF from negated expressions 
        TCGDisjunctiveNormalForm oNegatedDNF =
          TCGDisjunctiveNormalFormHelperClass.createDisjunctiveNormalForm(
View Full Code Here

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

  @Override
  public void setRangeAccordingToRightSideOfExpression(
      TCGOCLExpression in_oExpression) throws Exception {

    TCGOCLExpression oValidExpression = null;
    if (in_oExpression instanceof TCGOCLOperation) {
      TCGOCLOperation oCallExp = (TCGOCLOperation) in_oExpression;
      // TODO : hack, dass Instanz des ValueTypes f�r Polymorphie des Typparameters missbraucht wird -> �ndern!?!
      oValidExpression = oCallExp.getRight();
      if(oValidExpression == null) // again - workaround for "not"
View Full Code Here

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

  @Override
  public void setRangeAccordingToRightSideOfExpression(
      TCGOCLExpression in_oExpression,
      Map<TCGOCLAtom, TestCaseValidValue> in_colCurrentValueAssignment) throws Exception {
   
    TCGOCLExpression oValidExpression = null;
    if (in_oExpression instanceof TCGOCLOperation) {
      TCGOCLOperation oCallExp = (TCGOCLOperation) in_oExpression;
      // TODO : hack, dass Instanz des ValueTypes f�r Polymorphie des Typparameters missbraucht wird -> �ndern!?!
      oValidExpression = oCallExp.getRight();
      if(oValidExpression == null) // again - workaround for "not"
View Full Code Here

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

      new ArrayList<TCGDisjunctiveNormalForm>();
    for(TCGConjunction oConjunction : in_oOriginalDNF.getConjunctions())
    {
      for(TCGOCLExpression oExpression : oConjunction.getExpressions())
      {
        TCGOCLExpression oNegatedExpression =
          net.sf.parteg.base.testcasegraph.helperclasses.TCGOCLExpressionHelperClass.negateLogicalTCGOCLExpression(oExpression);
        TCGDisjunctiveNormalForm oDNF =
          TCGDisjunctiveNormalFormHelperClass.createDisjunctiveNormalForm(oNegatedExpression, false);
        colResultValue.add(oDNF);
      }
View Full Code Here

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

   
    if(in_oOriginalDNF.getConjunctions().isEmpty())
      colRetDNFs.add(GeneratedFactory.eINSTANCE.createTCGDisjunctiveNormalForm());
    else
    {
      TCGOCLExpression oExpression = in_oOriginalDNF.getOriginalExpression();
      oExpression = TCGOCLExpressionHelperClass.pushDownNots(oExpression);
      DecisionTableFlat oDecisionTable = new DecisionTableFlat(oExpression);
      oDecisionTable.buildUpCompleteDecisionTable();
     
      for(DecisionTableExpressionValueSelection oRow : oDecisionTable)
View Full Code Here

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

      TCGDisjunctiveNormalForm in_oOriginalDNF,
      boolean in_bCreateRowsForUnnecessaryValues)
  {
    ArrayList<TCGDisjunctiveNormalForm> colRetDNFs = new ArrayList<TCGDisjunctiveNormalForm>();
   
    TCGOCLExpression oExpression = in_oOriginalDNF.getOriginalExpression();
    oExpression = TCGOCLExpressionHelperClass.pushDownNots(oExpression);
    DecisionTableHierarchy oDecisionTable = new DecisionTableHierarchy(oExpression);
    oDecisionTable.buildUpMaskingMCDCDecisionTable(in_bCreateRowsForUnnecessaryValues);
   
    for(DecisionRowAlternatives oAlternatives : oDecisionTable)
View Full Code Here

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

   
    if(in_oOriginalDNF.getConjunctions().isEmpty())
      colRetDNFs.add(GeneratedFactory.eINSTANCE.createTCGDisjunctiveNormalForm());
    else
    {
      TCGOCLExpression oExpression = in_oOriginalDNF.getOriginalExpression();
      oExpression = TCGOCLExpressionHelperClass.pushDownNots(oExpression);
      DecisionTableFlat oDecisionTable = new DecisionTableFlat(oExpression);
      oDecisionTable.buildUpCompleteDecisionTable();
     
      TCGDisjunctiveNormalForm oPositiveDNF =
View Full Code Here

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

//      oContextClass = (org.eclipse.uml2.uml.Class)in_oNamespace;
//    else if(in_oNamespace instanceof org.eclipse.uml2.uml.Operation)
//      oContextClass = in_oContextClass;
//      oContextClass = ((org.eclipse.uml2.uml.Operation)in_oNamespace).getClass_();
   
    TCGOCLExpression oTCGOCLExpression = null;
    if(in_oExpression != null)
    {
      VariableExp oVarExp = TestCaseGraphHelper.getVariableExp(in_oExpression);
      if(oVarExp != null)
      {
        TCGOCLAtom oAtom = GeneratedFactory.eINSTANCE.createTCGOCLAtom();
        oAtom.setElement(oVarExp.getReferredVariable());
//        oAtom.setElement(oVarExp.getReferredVariable().getRepresentedParameter());
//        oAtom.setElement(in_oExpression);
        oTCGOCLExpression = oAtom;
        oTCGOCLExpression.setClassification(classifyOCLExpression(oVarExp, in_sOCLTypeId));
      }
      else if(in_oExpression instanceof PropertyCallExp)
      {
        PropertyCallExp oPropExp = (PropertyCallExp)in_oExpression;
 
        TCGOCLAtom oAtom = GeneratedFactory.eINSTANCE.createTCGOCLAtom();
        // do not use the directly referenced property but the property closest to the given context
        oAtom.setElement((EObject)TestCaseGraphHelper.findMatchingPropertyInContext(
            oPropExp.getReferredProperty(), oContextClass));
        oTCGOCLExpression = oAtom;
        oTCGOCLExpression.setClassification(classifyOCLExpression(oPropExp, in_sOCLTypeId));
      }
      else if(in_oExpression instanceof OperationCallExp)
      {
        // TODO un�re Operationen einf�hren?
        OperationCallExp oOpExp = (OperationCallExp)in_oExpression;
        TCGOCLOperation oOperation = GeneratedFactory.eINSTANCE.createTCGOCLOperation();
     
        // operation call on the context class
        if(oOpExp.getSource() != null &&
            oOpExp.getSource().getName() != null &&
            oOpExp.getSource().getName().equals("self")) {
          // TODO ...
        }
        else {
          OCLExpression oOCLLeftExpression = (OCLExpression)oOpExp.getSource();
          if(oOCLLeftExpression != null)
            oOperation.setLeft(
                transformExpression(oOCLLeftExpression, in_sOCLTypeId,
                    oContextClass, oContextClass));
          if(oOpExp.getArgument().size() > 0)
            oOperation.setRight(
                transformExpression((OCLExpression)oOpExp.getArgument().get(0),
                    in_sOCLTypeId, oContextClass, oContextClass));
        }
        oOperation.setOperation((EObject)oOpExp.getReferredOperation());
        oOperation.setOperationName(oOpExp.getReferredOperation().getName());
        oTCGOCLExpression = oOperation;
      }
      else if(in_oExpression instanceof IfExp)
      {
        TCGOCLIfThenElse oTCGIfExp = GeneratedFactory.eINSTANCE.createTCGOCLIfThenElse();
        IfExp oIfExp = (IfExp)in_oExpression;
        oTCGIfExp.setCondition(transformExpression((OCLExpression)oIfExp.getCondition(),
            in_sOCLTypeId, oContextClass, oContextClass));
        oTCGIfExp.setThenExpression(transformExpression((OCLExpression)oIfExp.getThenExpression(),
            in_sOCLTypeId, oContextClass, oContextClass));
        oTCGIfExp.setElseExpression(transformExpression((OCLExpression)oIfExp.getElseExpression(),
            in_sOCLTypeId, oContextClass, oContextClass));
        oTCGOCLExpression = oTCGIfExp;
      }
      else if(in_oExpression instanceof EnumLiteralExp)
      {
        EnumLiteralExp oEnumExp = (EnumLiteralExp)in_oExpression;
       
        TCGOCLAtom oAtom = GeneratedFactory.eINSTANCE.createTCGOCLAtom();
        // do not use the directly referenced property but the property closest to the given context
//        oAtom.setElement((EObject)TestCaseGraphHelper.findMatchingPropertyInContext(
//            oEnumExp.getReferredEnumLiteral(), oContextClass));
        oAtom.setElement(oEnumExp.getReferredEnumLiteral());
        oTCGOCLExpression = oAtom;
        oTCGOCLExpression.setClassification(VariableClassification.INDEPENDENT);
      }
      else if(in_oExpression instanceof BooleanLiteralExp) {
        BooleanLiteralExp oBooleanExp = (BooleanLiteralExp)in_oExpression;
        TCGOCLAtom oAtom = GeneratedFactory.eINSTANCE.createTCGOCLAtom();
//        for(Boolean oBoolean : PrimitiveTypeEObjectReferenceHelper.sm_colEObjectToBoolean.keySet())
//        {
//          if(oBoolean.equals(oBooleanExp.getBooleanSymbol())) {
//            oAtom.setElement(PrimitiveTypeEObjectReferenceHelper.sm_colEObjectToBoolean.get(oBoolean));
//          }
//        }
//        if(oAtom.getElement() == null) {
//          EObject oObject = GeneratedFactory.eINSTANCE.createDummy();
//          PrimitiveTypeEObjectReferenceHelper.sm_colEObjectToBoolean.put(
//              oBooleanExp.getBooleanSymbol(), oObject);
//          oAtom.setElement(oObject);
//        }
        oAtom.setElement(oBooleanExp);
        oTCGOCLExpression = oAtom;
        oTCGOCLExpression.setClassification(VariableClassification.INDEPENDENT);
      }
      else if(in_oExpression instanceof IntegerLiteralExp) {
        IntegerLiteralExp oIntegerExp = (IntegerLiteralExp)in_oExpression;
        TCGOCLAtom oAtom = GeneratedFactory.eINSTANCE.createTCGOCLAtom();
        oAtom.setElement(oIntegerExp);
        oTCGOCLExpression = oAtom;
        oTCGOCLExpression.setClassification(VariableClassification.INDEPENDENT);       
      }
      //@author Amin Rezaee
      else if(in_oExpression instanceof RealLiteralExp){
        RealLiteralExp oRealExp = (RealLiteralExp)in_oExpression;
        TCGOCLAtom oAtom = GeneratedFactory.eINSTANCE.createTCGOCLAtom();
        oAtom.setElement(oRealExp);
        oTCGOCLExpression = oAtom;
        oTCGOCLExpression.setClassification(VariableClassification.INDEPENDENT)
      }
      //Amin
      if(oTCGOCLExpression == null) {
        System.err.println("TransformOCLToTCGOCL.transformExpression - expression is null: " + in_oExpression);
      }
     
      // Reference to original OCL expression
      oTCGOCLExpression.setOclReference(in_oExpression);
    }
    return oTCGOCLExpression;
  }
View Full Code Here

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

//            .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();
        }
View Full Code Here

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

 
  public static TCGDisjunctiveNormalForm negateDNF(
      TCGDisjunctiveNormalForm in_oDNF,
      boolean in_bSplitInequations) {
  //    TCGOCLExpression oExpression = convertDNFToExpression(in_oDNF);
    TCGOCLExpression oExpression =
      TCGOCLExpressionHelperClass.copyExpression(in_oDNF.getOriginalExpression());
  //    TCGOCLExpression oExpression = in_oDNF.getOriginalExpression();
    oExpression = TCGOCLExpressionHelperClass.
      negateLogicalTCGOCLExpression(oExpression);
  //    System.out.println("*** *** ***");
 
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.