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

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


   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setRight(TCGOCLExpression newRight) {
    TCGOCLExpression oldRight = right;
    right = newRight;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GeneratedPackage.TCGOCL_OPERATION__RIGHT, oldRight, right));
  }
View Full Code Here


   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetCondition(TCGOCLExpression newCondition, NotificationChain msgs) {
    TCGOCLExpression oldCondition = condition;
    condition = newCondition;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, GeneratedPackage.TCG_NODE__CONDITION, oldCondition, newCondition);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setInvariant(TCGOCLExpression newInvariant) {
    TCGOCLExpression oldInvariant = invariant;
    invariant = newInvariant;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GeneratedPackage.TCG_NODE__INVARIANT, oldInvariant, invariant));
  }
View Full Code Here

    if(in_oNamespace instanceof org.eclipse.uml2.uml.Class)
      oContextClass = (org.eclipse.uml2.uml.Class)in_oNamespace;
    else if(in_oNamespace instanceof org.eclipse.uml2.uml.Operation)
      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(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();
        OCLExpression oOCLLeftExpression = (OCLExpression)oOpExp.getSource();
        if(oOCLLeftExpression != null)
          oOperation.setLeft(
              transformExpression(oOCLLeftExpression, in_sOCLTypeId, oContextClass));
        if(oOpExp.getArgument().size() > 0)
          oOperation.setRight(
              transformExpression((OCLExpression)oOpExp.getArgument().get(0), in_sOCLTypeId, 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));
        oTCGIfExp.setThenExpression(transformExpression((OCLExpression)oIfExp.getThenExpression(), in_sOCLTypeId, oContextClass));
        oTCGIfExp.setElseExpression(transformExpression((OCLExpression)oIfExp.getElseExpression(), in_sOCLTypeId, oContextClass));
        oTCGOCLExpression = oTCGIfExp;
      }

      // Reference to original OCL expression
      oTCGOCLExpression.setOclReference(in_oExpression);
    }
    return oTCGOCLExpression;
  }
View Full Code Here

    }
  }
 
  public static void exchangeSidesOfExpression(TCGOCLOperation in_oOpExp)
  {
    TCGOCLExpression o1 = in_oOpExp.getLeft();
    in_oOpExp.setLeft(in_oOpExp.getRight());
    in_oOpExp.setRight(o1);
    in_oOpExp.setOperationName(sm_colCorrespondingRelations.get(in_oOpExp.getOperationName()));
  }
View Full Code Here

      OCLTreeExpressionIterator.run(oOpLeftExp.getLeft(), oVisitor);
      // variable is on local right side -> exchange on left hand side left and right
      if(!oVisitor.isFound())
      {
        // exchange sides
        TCGOCLExpression oLeftSide = oOpLeftExp.getLeft();
        oOpLeftExp.setLeft(oOpLeftExp.getRight());
        oOpLeftExp.setRight(oLeftSide);
        // influence relation operator correspondingly
        if(oOpLeftExp.getOperationName().equals("+") || oOpLeftExp.getOperationName().equals("*"))
        {
          // nothing
        }
        else if(oOpLeftExp.getOperationName().equals("-"))
        {
          in_oOpExp.setOperationName(sm_colCorrespondingRelations.get(in_oOpExp.getOperationName()));
          in_oOpExp.setRight(ExpressionConverter.negateTCGOCLExpression(in_oOpExp.getRight()));
        }
        else if(oOpLeftExp.getOperationName().equals("/"))
        {
          // TODO #### Fallunterscheidung einbauen
        }
      }
       
      OCLTreeExpressionIterator.run(oOpLeftExp.getLeft(), oVisitor);
      // variable is on local left side -> transfer local right side to the right
      if(oVisitor.isFound())
      {
        TCGOCLExpression oLeftSide = oOpLeftExp.getLeft();
        oOpLeftExp.setLeft(in_oOpExp.getRight());
        in_oOpExp.setRight(oOpLeftExp);
        in_oOpExp.setLeft(oLeftSide);
        oOpLeftExp.setOperationName(sm_colCorrespondingOperations.get(oOpLeftExp.getOperationName()));
        // multiplication or division with a negative number?
View Full Code Here

TOP

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

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.