Examples of TCGOCLAtom


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

        if (result == null) result = caseTCGOCLExpression(tcgoclOperation);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GeneratedPackage.TCGOCL_ATOM: {
        TCGOCLAtom tcgoclAtom = (TCGOCLAtom)theEObject;
        T result = caseTCGOCLAtom(tcgoclAtom);
        if (result == null) result = caseTCGOCLExpression(tcgoclAtom);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
View Full Code Here

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

      TCGEquivalenceClass oEqClass = ExpressionConverter.getEquivalenceClassForRightSideOfExpression(in_oExpression);
      if(oEqClass != null && in_oExpression instanceof TCGOCLOperation)
      {
        if(((TCGOCLOperation)in_oExpression).getLeft() instanceof TCGOCLAtom)
        {
          TCGOCLAtom oAtom = (TCGOCLAtom)((TCGOCLOperation)in_oExpression).getLeft();
          // interesting element is a variable - get all the necessary values
          if(getVariable(oAtom.getElement()) != null)
          {
            TCGParameter oCorrespondingParam = getCorrespondingParameterCopyInNode((TCGParameter)oAtom.getTcgParameter(), in_oBackTrackStartNode);
            if(!DomainHelper.adaptDomain(oCorrespondingParam, oEqClass))
              return false;
          }
          // interesting value is passive dependent -> find matching active dependent and go on ...
          else if(oAtom.getElement() instanceof Property)
          {
            if(in_oBackTrackStartNode.getIncomingTransitions().size() == 1)
            {
              Property oProperty = (Property)oAtom.getElement();
              TCGTransition oTransition = findNextPrecedingTransition(in_oCurrentBackTrackNode.getIncomingTransitions().get(0), oProperty);
              if(oTransition != null) // is there a next preceding transition ?
              {
                // TODO ### future work: sort elements in expressions only if needed?
                ArrayList<TCGOCLExpression> colNewExpressions = new ArrayList<TCGOCLExpression>();
View Full Code Here

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

    {
      TCGOCLVariableClassificator oClassificator = new TCGOCLVariableClassificator(oPostCondition);
      TCGOCLExpression oActiveExpression = oClassificator.getClassifiedElementInExpression(VariableClassification.ACTIVE_DEPENDENT);
      if(oActiveExpression instanceof TCGOCLAtom)
      {
        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.testcasetree.generated.TCGOCLAtom

      TCGOCLExpression oActivePostExpression =
        oClassificator.getClassifiedElementInExpression(
            VariableClassification.ACTIVE_DEPENDENT);
      if(oActivePostExpression instanceof TCGOCLAtom)
      {
        TCGOCLAtom oAtomPostExp = (TCGOCLAtom)oActivePostExpression;
        if(TCGOCLExpressionHelperClass.conditionContainsReferenceToObject(
            in_oPrecondition, oAtomPostExp.getElement()))
        {
          oClassificator.shiftSubexpressionToTheLeft(oActivePostExpression);
          if(oClassificator.getExpression() instanceof TCGOCLOperation)
          {
            TCGOCLOperation oOperation =
View Full Code Here

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

    TCGOCLExpression oTCGOCLExpression = null;
    if(in_oExpression != null)
    {
      if(in_oExpression instanceof TCGOCLAtom)
      {
        TCGOCLAtom oOldAtom = (TCGOCLAtom)in_oExpression;
        TCGOCLAtom oNewAtom = GeneratedFactory.eINSTANCE.createTCGOCLAtom();
        oNewAtom.setElement(oOldAtom.getElement());
        oNewAtom.setTcgParameter(oOldAtom.getTcgParameter());
        oTCGOCLExpression = oNewAtom;
      }
      else if(in_oExpression instanceof TCGOCLOperation)
      {
        TCGOCLOperation oOldOperation = (TCGOCLOperation)in_oExpression;
View Full Code Here

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

  {
    TCGOCLVariableClassificator oClassificator = new TCGOCLVariableClassificator(in_oExpression);
    TCGOCLExpression oExpression = oClassificator.getClassifiedElementInExpression(VariableClassification.ACTIVE_DEPENDENT);
    if(oExpression instanceof TCGOCLAtom)
    {
      TCGOCLAtom oAtomExp = (TCGOCLAtom)oExpression;
      if(oAtomExp.getElement().equals(in_oSearchedProperty))
        return true;
    }
    return false;
  }
View Full Code Here

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

  public static double getValue(TCGOCLExpression in_oTCGOCLExpression) throws Exception
  {
    if(in_oTCGOCLExpression instanceof TCGOCLAtom)
    {
      TCGOCLAtom oPropExp = (TCGOCLAtom)in_oTCGOCLExpression;
      VariableExp oVarExp = null;
      if(oPropExp.getElement() instanceof OCLExpression)
      {
        oVarExp = TestCaseGraphHelper.getVariableExp((OCLExpression)oPropExp.getElement());
      }
     
      if(oVarExp != null)
      {
        // nothing - variables do not have fixed values
      }
      else if(oPropExp.getElement() instanceof Property)
      {
        Property oProp = (Property)oPropExp.getElement();
        if(oProp.getDefaultValue() == null)
        {
          //System.err.println("error in getValue() for property "
          //    + oProp.getName());
          throw new Exception("error in getValue() for property "
              + oProp.getName());
        }
        else
        {
          String sValue = oProp.getDefaultValue().stringValue();
          return Double.valueOf(sValue).doubleValue();
        }
      }
      if(oPropExp.getElement() instanceof EReferenceImpl)
      {
        EReferenceImpl oRef = (EReferenceImpl)oPropExp.getElement();
        return Double.valueOf(oRef.getDefaultValueLiteral());
      }
    }
    else if(in_oTCGOCLExpression instanceof TCGOCLOperation)
    {
View Full Code Here

Examples of net.sf.parteg.base.testcasetree.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(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)
View Full Code Here

Examples of net.sf.parteg.base.testcasetree.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
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.