Examples of TCGTransition


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

  }

 
  public TCGTransition getEndTransition() {
    if(!getTransitionSequence().isEmpty()) {
      TCGTransition oLastTransition =
        getTransitionSequence().get(getTransitionSequence().size() - 1).getSecond();
      return oLastTransition;
    }
    return null;
  }
View Full Code Here

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

    }
    return null;
  }
 
  public TCGNode getEndNode() {
    TCGTransition oEndTransition = getEndTransition();
    if(oEndTransition != null) {
      return oEndTransition.getTargetNode();
    }
    return null;
  }
View Full Code Here

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

          // evaluate all found references
          for(TCGElement oElement : colElements)
          {
            TestCaseRegion oRegion = null;
            TCGRealNode oNode = null;
            TCGTransition oTransition = null;
           
            if(oElement instanceof TCGRealNode)
            {
              oNode = (TCGRealNode)oElement;
              oRegion = oNode.getContainer();
            }
            else if(oElement instanceof TCGTransition)
            {
              oTransition = (TCGTransition)oElement;
              oRegion = oTransition.getContainer();
            }
           
            // found matching region for expression           
            TCGNode oNewActiveNode = in_oRuntimeState.getActiveNode(oRegion);
           
            // is the found state included in the region of one active state or vice versa?
            for(TCGNode oActiveNode : in_oRuntimeState.getAllActiveNodes()) {
              if(oActiveNode instanceof TCGRealNode)
                if(TCGRegionHelperClass.regionsAreInHierarchicalOrder(
                    ((TCGRealNode)oActiveNode).getContainer(), oRegion)) {
                  oNewActiveNode = oActiveNode;
                }
            }
           
            // region has no active node in current state?
            if(oNewActiveNode == null)
            {
              bFoundNodeInExistingRegion = false;
              // select the node directly behind the transition
              if(oTransition != null)
              {
                oNewActiveNode = oTransition.getTargetNode();
              }
              else if(oNode != null)
              {
                oNewActiveNode = oNode;
              }
View Full Code Here

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

    // checks transitions if test goal is a transition
    if(getElement() instanceof TCGTransition)
    {
      for(TransitionInstance oTransitionInstance : in_oTestCase.getTransitionInstances())
      {
        TCGTransition oTransition = oTransitionInstance.getTransition();
        {
          if(oTransition.equals(getElement()))
            return true;
        }
      }
    }
    // checks nodes if test goal is a node
View Full Code Here

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

    // only one transition is triggered -> prevent ambiguous test goals
    // the same holds if event and condition are null -> no transition could be found!
    if((colTransitions.size() == 1) || (in_oEvent == null && in_oConjunction == null)) {

      if(colTransitions.size() == 1) {
        TCGTransition oTransition = colTransitions.get(0);
       
        // add the current transition
        TestGoalTransitionSequence oTestGoal = new TestGoalTransitionSequence();
        oTestGoal.getTransitionSequence().add(
            new Pair<TCGNode, TCGTransition>(in_oNode, oTransition));
        oRunnerState.getTestGoalsToSatisfy().add(oTestGoal);
        colRunnerStates.add(oRunnerState);
 
        // search for further transitions
        if(oTransition != null)
          oTargetNode = oTransition.getTargetNode();
      }
   
      colRunnerStates.addAll(
        addTargetTransitionAndStateForNodeAndEventHelper(
            oTargetNode, oRunnerState));
View Full Code Here

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

  public boolean checkSatisfactionByTransitionInstance(
      TransitionInstance in_oTransitionInstance) {
    // checks transitions if test goal is a transition
    if(getElement() instanceof TCGTransition)
    {
      TCGTransition oTransition = in_oTransitionInstance.getTransition();
      {
        if(oTransition.equals(getElement()))
          return true;
      }
    }
    // checks nodes if test goal is a node
    else if(getElement() instanceof TCGNode)
View Full Code Here

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

                  visitedNodeByAlgorithm.add(oPair.getSecond());
                  fuelOfAlgorithms--;
                  //add next transition and state if current node is temp node
                  TCGIntermediateNode oImNode = (TCGIntermediateNode) oPair.getSecond();
                  if(oImNode.getNodeType() == TCGNodeType.TEMPORARY){
                    TCGTransition nextTran = oImNode.getOutgoingTransitions().get(0);
                    if(nextTran != null)
                      currentPath.add(new Pair<TCGTransition, TCGNode>(nextTran, nextTran.getTargetNode()));
                  }
                  //
                  checkSatisfactionOfTestGoals(currentPath);
                  if(!allTestGoalHasBeenSatisfied()){
                    depthFirst(currentPath);
View Full Code Here

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

  {
//    in_oFormattedOutput.appendln(" - not satisfied: (test goal #" + in_nNumberOfTestGoal + ") " + in_oTestGoal.getElement().toString());
    if(in_oTestGoal instanceof TestGoalElements) {
      TestGoalElements oTestGoalElement = (TestGoalElements)in_oTestGoal;
      if(oTestGoalElement.getElement() instanceof TCGTransition) {
        TCGTransition oTransitionGoal = (TCGTransition)oTestGoalElement.getElement();
        in_oLogger.getFormattedOutput().appendln(in_sPrefix + " (test goal #" + in_nTestGoalNumber + " - transition) ");
        in_oLogger.getFormattedOutput().appendln("   from " + oTransitionGoal.getSourceNode().getName());
        in_oLogger.getFormattedOutput().appendln("   to   " + oTransitionGoal.getTargetNode().getName());
      }
      else if(oTestGoalElement.getElement() instanceof TCGNode) {
        TCGNode oNodeGoal = (TCGNode)oTestGoalElement.getElement();
        in_oLogger.getFormattedOutput().appendln(in_sPrefix + " (test goal #" + in_nTestGoalNumber + " - node) ");
        in_oLogger.getFormattedOutput().appendln("   reach state " + oNodeGoal.getName());
      }
    }
    else if(in_oTestGoal instanceof TestGoalGuardConditions) {
      TestGoalGuardConditions oTestGoalGuard = (TestGoalGuardConditions)in_oTestGoal;
      if(oTestGoalGuard.getElement() instanceof TCGNode) {
        if(oTestGoalGuard.getNecessaryTransitionToTraverse() != null) {
          TCGTransition oTransition = oTestGoalGuard.getNecessaryTransitionToTraverse();
          in_oLogger.getFormattedOutput().appendln(in_sPrefix + " (test goal #" + in_nTestGoalNumber + " - traversed transition) ");
          in_oLogger.getFormattedOutput().appendln("   from node " + oTransition.getSourceNode().getName());
          in_oLogger.getFormattedOutput().appendln("   to node " + oTransition.getTargetNode().getName());
          for(TCGEvent oEvent : oTransition.getEvents()) {
            in_oLogger.getFormattedOutput().appendln("   triggered by " + oEvent.getName());
          }
        }
        else {
          in_oLogger.getFormattedOutput().appendln(in_sPrefix + " (test goal #" + in_nTestGoalNumber + " - satisfied guard) ");
View Full Code Here

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

      TCGNode in_oSourceNode,
      TCGTransition in_oOutgoingTransition) throws Exception
  {
    TCGNode oTargetNode = in_oOutgoingTransition.getTargetNode();
   
    TCGTransition oTCGTransition1 =
      in_oTCGHelper.addTransition(in_oSourceNode, oTargetNode);
    oTCGTransition1.getEvents().addAll(in_oOutgoingTransition.getEvents());
    oTCGTransition1.setPrecondition(
        TCGDisjunctiveNormalFormHelperClass.copyDNFDeep(
            in_oOutgoingTransition.getPrecondition()));
    oTCGTransition1.setPostcondition(
        TCGDisjunctiveNormalFormHelperClass.copyDNFDeep(
            in_oOutgoingTransition.getPostcondition()));
    oTCGTransition1.setCanBeProcessed(in_oOutgoingTransition.isCanBeProcessed());
    return oTCGTransition1;
  }
View Full Code Here

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

    TCGNode oTargetNode = in_oOutgoingTransition.getTargetNode();
   
    TCGIntermediateNode oNewNode =
      in_oTCGHelper.addIntermediateNode(in_oRegion, TCGNodeType.UNKNOWN);
   
    TCGTransition oTCGTransition1 =
      in_oTCGHelper.addTransition(oSourceNode, oNewNode);
    oTCGTransition1.getEvents().addAll(in_oIncomingTransition.getEvents());
    oTCGTransition1.setPrecondition(
        TCGDisjunctiveNormalFormHelperClass.copyDNFDeep(
            in_oIncomingTransition.getPrecondition()));
    oTCGTransition1.setPostcondition(
        TCGDisjunctiveNormalFormHelperClass.copyDNFDeep(
            in_oIncomingTransition.getPostcondition()));
    oTCGTransition1.setCanBeProcessed(in_oIncomingTransition.isCanBeProcessed());

    TCGTransition oTCGTransition2 =
      in_oTCGHelper.addTransition(oNewNode, oTargetNode);
    oTCGTransition2.getEvents().addAll(in_oOutgoingTransition.getEvents());
    oTCGTransition2.setPrecondition(
        TCGDisjunctiveNormalFormHelperClass.copyDNFDeep(
            in_oOutgoingTransition.getPrecondition()));
    oTCGTransition2.setPostcondition(
        TCGDisjunctiveNormalFormHelperClass.copyDNFDeep(
            in_oOutgoingTransition.getPostcondition()));
    oTCGTransition2.setCanBeProcessed(in_oOutgoingTransition.isCanBeProcessed());
   
    return oNewNode;
  }
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.