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

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


        T result = caseTCGEvent(tcgEvent);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GeneratedPackage.TCGOCL_EXPRESSION: {
        TCGOCLExpression tcgoclExpression = (TCGOCLExpression)theEObject;
        T result = caseTCGOCLExpression(tcgoclExpression);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GeneratedPackage.TCG_CONJUNCTION: {
View Full Code Here


  private void referToEvent(TCGEvent in_oTCGEvent, TCGOCLExpression in_oExpression)
  {
    if(in_oExpression != null)
    {
      TCGOCLVariableClassificator oClassificator = new TCGOCLVariableClassificator(in_oExpression);
      TCGOCLExpression oExpression = oClassificator.getClassifiedElementInExpression(VariableClassification.INPUT_PARAMETER);
      TCGOCLAtom oAtom = (TCGOCLAtom)oExpression;
      if(oAtom != null)
      {
        for(TCGParameter oParameter : in_oTCGEvent.getParameters())
        {
View Full Code Here

    boolean bReachingTransitionBearsConflicts = false;
   
    if(in_oExpression != null)
    {
      // transform OCL to TCGOCL
      TCGOCLExpression oTCGOCLExp = TransformOCLToTCGOCL.transformExpression(
          in_oExpression, Configuration.getOCLGuardId(), in_oContextClass);
      // transform to DNF
      TCGDisjunctiveNormalForm oDNF = ExpressionConverter.createDisjunctiveNormalForm(oTCGOCLExp);
      // add expressions for coverage criterion
      ExpressionConverter.addConjunctionsForCoverageCriterion(oDNF);
View Full Code Here

  public static TCGDisjunctiveNormalForm createDNFForOCLExpression(
      OCLExpression in_oOCLExpression,
      Namespace in_oNamespace,
      String in_sOCLKind)
  {
    TCGOCLExpression oTCGOCLExp = TransformOCLToTCGOCL.transformExpression(
        in_oOCLExpression, in_sOCLKind, in_oNamespace);
    // transform to DNF
    TCGDisjunctiveNormalForm oDNF = ExpressionConverter.createDisjunctiveNormalForm(oTCGOCLExp);
    return oDNF;
  }
View Full Code Here

      Operation in_oOperation,
      org.eclipse.uml2.uml.Class in_oContextClass)
  {
    ArrayList<TCGNode> colNodes = new ArrayList<TCGNode>();
    // transform OCL to TCGOCL
    TCGOCLExpression oTCGOCLExp = TransformOCLToTCGOCL.transformExpression(
        in_oExpression, Configuration.getOCLPreId(), in_oContextClass);
    // transform to DNF
    TCGDisjunctiveNormalForm oDNF = ExpressionConverter.createDisjunctiveNormalForm(oTCGOCLExp);
    // add expressions for coverage criterion
    ExpressionConverter.addConjunctionsForCoverageCriterion(oDNF);
View Full Code Here

      TCGNode in_oTCGNode,
      Operation in_oOperation,
      org.eclipse.uml2.uml.Class in_oContextClass)
  {
    ArrayList<TCGNode> colNodes = new ArrayList<TCGNode>();
    TCGOCLExpression oTCGOCLExp = TransformOCLToTCGOCL.transformExpression(
        in_oExpression, Configuration.getOCLPostId(), in_oContextClass);
    TCGDisjunctiveNormalForm oDNF = ExpressionConverter.createDisjunctiveNormalForm(oTCGOCLExp);
    for(TCGConjunction oConjunction : oDNF.getConjunctions())
    {
      TCGTransition oTransition = createTCGPart(in_oTCGNode, in_oOperation.getName());
      if(oTransition != null)
      {
        // remember original expression
        oTransition.getTargetNode().setOriginalExpression(in_oExpression);
       
        TCGEvent oTCGEvent = findTriggeringEvent(oTransition);
        boolean bResult = true;
       
        for(TCGOCLExpression oExpression : oConjunction.getExpressions())
        {
          adaptTCGOCLExpression(oExpression, oTransition, null, in_oContextClass);
          referToEvent(oTCGEvent, oExpression);
          if(oTransition.getPostcondition().getConjunctions().isEmpty())
            oTransition.getPostcondition().getConjunctions().add(
                GeneratedFactory.eINSTANCE.createTCGConjunction());
          oTransition.getPostcondition().getConjunctions().get(0).getExpressions().add(oExpression);
         
          // if this postcondition contains no dependent elements -> then adapt the domain!
          TCGOCLVariableClassificator oClassificator = new TCGOCLVariableClassificator(oExpression);
          TCGOCLExpression oActiveDependentExpression = oClassificator.getClassifiedElementInExpression(VariableClassification.ACTIVE_DEPENDENT);
//          TCGOCLExpression oPassiveDependentExpression = oClassificator.getClassifiedElementInExpression(VariableClassification.PASSIVE_DEPENDENT);
          if(oActiveDependentExpression == null)
          {
//            if(oPassiveDependentExpression == null) // just constants and input parameters
//            {
View Full Code Here

     */
    for(TCGConjunction oConjunction : in_colPostcondition.getConjunctions())
    for(TCGOCLExpression oPostCondition : oConjunction.getExpressions())
    {
      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();
            TCGOCLVariableClassificator oRightSubClassificator = new TCGOCLVariableClassificator(oOperation.getRight());
           
            // does the right side contain an active dependent element? -> schwierig -> daf�r oActiveExpression und
            // oActiveSubExpression auseinanderhalten !
            //TCGOCLExpression oActiveSubExpression = oRightSubClassificator.getClassifiedElementInExpression(VariableClassification.ACTIVE_DEPENDENT);

            // does the right side contain a passive dependent element?
            TCGOCLExpression oPassiveDependentSubExpression = oRightSubClassificator.getClassifiedElementInExpression(VariableClassification.PASSIVE_DEPENDENT);
            TCGOCLExpression oInputParameterSubExpression = oRightSubClassificator.getClassifiedElementInExpression(VariableClassification.INPUT_PARAMETER);
            if((oPassiveDependentSubExpression != null) || (oInputParameterSubExpression != null))
            {
              in_colNewExpressions.add(connectPreconditionAndPostcondition(in_oPrecondition, oPostCondition));
            }
            else { // does the right side contain just independent elements?
View Full Code Here

    for(TCGConjunction oConjunction : in_colPostcondition.getConjunctions())
    for(TCGOCLExpression oPostCondition : oConjunction.getExpressions())
    {
      TCGOCLVariableClassificator oClassificator =
        new TCGOCLVariableClassificator(oPostCondition);
      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 =
              (TCGOCLOperation)oClassificator.getExpression();
            TCGOCLVariableClassificator oRightSubClassificator =
              new TCGOCLVariableClassificator(oOperation.getRight());
           
            // does the right side contain a passive dependent element?
            TCGOCLExpression oPassiveDependentSubExpression = oRightSubClassificator.getClassifiedElementInExpression(VariableClassification.PASSIVE_DEPENDENT);
            TCGOCLExpression oInputParameterSubExpression = oRightSubClassificator.getClassifiedElementInExpression(VariableClassification.INPUT_PARAMETER);
            if((oPassiveDependentSubExpression != null) || (oInputParameterSubExpression != null))
            {
              in_colNewExpressions.add(connectPreconditionAndPostcondition(in_oPrecondition, oPostCondition));
            }
            else { // does the right side contain just independent elements?
View Full Code Here

  /**
   * copies the TCGOCLExpression
   */
  public static TCGOCLExpression copyExpression(TCGOCLExpression in_oExpression)
  {
    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;
        TCGOCLOperation oNewOperation = GeneratedFactory.eINSTANCE.createTCGOCLOperation();
        oNewOperation.setOperation(oOldOperation.getOperation());
        oNewOperation.setOperationName(oOldOperation.getOperationName());
        oNewOperation.setLeft(copyExpression(oOldOperation.getLeft()));
        oNewOperation.setRight(copyExpression(oOldOperation.getRight()));
        oTCGOCLExpression = oNewOperation;
      }
      oTCGOCLExpression.setClassification(in_oExpression.getClassification());
      oTCGOCLExpression.setOclReference(in_oExpression.getOclReference());
    }
    return oTCGOCLExpression;   
  }
View Full Code Here

 
 
  private boolean expressionContainsActiveProperty(TCGOCLExpression in_oExpression, Property in_oSearchedProperty)
  {
    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;
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.