Examples of TCGOCLAtom


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

      List<EObject> out_ReferencedVariables)
  {
   
    if(in_oExpression instanceof TCGOCLAtom)
    {
      TCGOCLAtom oAtom = (TCGOCLAtom)in_oExpression;
      if(oAtom.getClassification().equals(VariableClassification.PASSIVE_DEPENDENT))
        out_ReferencedVariables.add(oAtom.getElement());
    }
    else if(in_oExpression instanceof TCGOCLOperation)
    {
      TCGOCLOperation oOperation = (TCGOCLOperation)in_oExpression;
      getPassiveDependentElements(oOperation.getLeft(), out_ReferencedVariables);
View Full Code Here

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

      Map<TCGOCLAtom, TestCaseValidValue> in_colCurrentValueAssignment,
      Map<TCGOCLAtom, ValueTypeRange> in_colCurrentValueTypeRanges) throws Exception {
   
    // createValueFromExpression nur auf Atoms aufrufen
    if(in_oExpression instanceof TCGOCLAtom) {
      TCGOCLAtom oAtom = (TCGOCLAtom)in_oExpression;
      if(!(in_colCurrentValueTypeRanges.get(oAtom) instanceof OrderedValueTypeRange)) {
        return null;
      }
      OrderedValueTypeRange<OVT> oVTR = (OrderedValueTypeRange<OVT>)in_colCurrentValueTypeRanges.get(oAtom);
      if(oVTR == null) {
View Full Code Here

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

    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) {
View Full Code Here

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

        // for all active dependent atoms ...
        for(TCGOCLAtom oActiveExpression :
          oClassificator.getClassifiedElementsInExpression(
              VariableClassification.ACTIVE_DEPENDENT)) {
         
          TCGOCLAtom oAtomExp = (TCGOCLAtom)oActiveExpression;
          if(oAtomExp.getElement().equals(in_oProperty))
          {
            oClassificator.shiftSubexpressionToTheLeft(oActiveExpression);
            if(oClassificator.getExpression() instanceof TCGOCLOperation)
            {
              TCGOCLOperation oOperation = (TCGOCLOperation)oClassificator.getExpression();
View Full Code Here

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

          for(TCGOCLAtom oActivePostExpression :
            oClassificator.getClassifiedElementsInExpression(
                VariableClassification.ACTIVE_DEPENDENT)) {
           
            oClassificator.shiftSubexpressionToTheLeft(oActivePostExpression);
            TCGOCLAtom oAtomPostExp = (TCGOCLAtom)oActivePostExpression;
           
            // 1) precondition references the same active object as postcondition
            // 2) expression is an operation (else a transformation is not possible)
            if((TCGOCLExpressionHelperClass.conditionContainsReferenceToObject(
              in_oPrecondition, oAtomPostExp.getElement()))) //  &&
              //oClassificator.getExpression() instanceof TCGOCLOperation)
            {
             
              TCGOCLVariableClassificator oRightSubClassificator =
                new TCGOCLVariableClassificator(oClassificator.getExpression());
View Full Code Here

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

      Object in_oReference)
  {
//    if(in_oParameter.getReference().equals(in_oReference))
//      return in_oParameter;
    if(in_oReference instanceof TCGOCLAtom) {
      TCGOCLAtom oReferenceAtom = (TCGOCLAtom)in_oReference;
      EObject oReferenceAtomReference = oReferenceAtom.getElement();
      Parameter oReferencedParameter = null;
      if(oReferenceAtomReference instanceof org.eclipse.ocl.uml.Variable) {
        oReferencedParameter = ((org.eclipse.ocl.uml.Variable)oReferenceAtomReference).getRepresentedParameter();
      }
      if(oReferenceAtomReference instanceof org.eclipse.uml2.uml.Property) {
View Full Code Here

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

  private void createVariableReferences(TCGOCLExpression in_oExpression, TCGTransition in_oTransition)
  {
    if(in_oExpression instanceof TCGOCLAtom)
    {
      TCGOCLAtom oAtom = (TCGOCLAtom)in_oExpression;
      // 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);
View Full Code Here

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

      buildMapForClassification(oOperation.getLeft());
      buildMapForClassification(oOperation.getRight());
    }
    if(in_oExpression instanceof TCGOCLAtom)
    {
      TCGOCLAtom oAtom = (TCGOCLAtom)in_oExpression;
      m_colExpressionClassification.get(oAtom.getClassification()).add(oAtom);
    }
  }
View Full Code Here

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

      TCGOCLExpression in_oExpression) {
    List<Object> colInputParameterObjects = new ArrayList<Object>();
    for(TCGOCLExpression oInputParameterExpression : getVariablesOfType(
        in_oExpression, VariableClassification.INPUT_PARAMETER)) {
     
      TCGOCLAtom oAtom = (TCGOCLAtom)oInputParameterExpression;
      if(oAtom != null) {
       
        if(oAtom.getOclReference() instanceof PropertyCallExp) {
          colInputParameterObjects.add(
              ((PropertyCallExp)oAtom.getOclReference()).
              getReferredProperty());
        }
        else if(oAtom.getOclReference() instanceof VariableExp) {
          colInputParameterObjects.add(
              ((VariableExp)oAtom.getOclReference()).
              getReferredVariable().getRepresentedParameter());
        }         
      } 
    }
    return colInputParameterObjects;
View Full Code Here

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

  public static boolean firstExpressionIsSatisfiedBySecondExpression(
        TCGOCLExpression in_oCheckedExpression,
        TCGOCLExpression in_oWarrantedExpression,
        boolean in_bBoundariesMatchExactly)
  {
    TCGOCLAtom oCheckedElement = null;
    TCGOCLAtom oWarrantedElement = null;
   
    int nCheckedAtoms = getPassiveDependentVariablesAndInputParameters(in_oCheckedExpression).size();
    int nWarrantedAtoms = getPassiveDependentVariablesAndInputParameters(in_oWarrantedExpression).size();
   
    if((nCheckedAtoms == 1) && (nWarrantedAtoms == 1)) {
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.