Package net.sf.parteg.base.testcasegraph.testgoals

Examples of net.sf.parteg.base.testcasegraph.testgoals.TestGoalTransitionSequence


      TCGNode oStartNode = in_oNode;
      // a transition sequence was found?
      if(!m_oTestCaseRunnerState.getTestGoalsToSatisfy().isEmpty()) {
        TestGoalBase oTestGoal = m_oTestCaseRunnerState.getTestGoalsToSatisfy().get(0);
        if(oTestGoal instanceof TestGoalTransitionSequence) {
          TestGoalTransitionSequence oTestGoalTransitionSequence =
            (TestGoalTransitionSequence)oTestGoal;
          TCGNode oSequenceEndNode = oTestGoalTransitionSequence.getEndNode();
          if(oSequenceEndNode != null) {
            oStartNode = oSequenceEndNode;
          }
        }
      }
View Full Code Here


      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));
      Collections.sort(colRunnerStates, new Comparator<TestCaseGeneratorRunnerState>() {
        @Override
        public int compare(TestCaseGeneratorRunnerState o1,
            TestCaseGeneratorRunnerState o2) {
          TestGoalTransitionSequence colTransitions1 =
            (TestGoalTransitionSequence)o1.getTestGoalsToSatisfy().get(0);
          TestGoalTransitionSequence colTransitions2 =
            (TestGoalTransitionSequence)o2.getTestGoalsToSatisfy().get(0);
         
          Integer o1Length = colTransitions1.getTransitionSequence().size();
          Integer o2Length = colTransitions2.getTransitionSequence().size();
          return o2Length.compareTo(o1Length);
        }
      });
    }
View Full Code Here

    // their default-triggered subsequent transitions ...
    for(TCGTransition oTransition : TCGNodeHelperClass.getAllTransitionsWithoutTrigger(in_oTargetNode)) {
//      TransitionInstance oTransitionInstance = new TransitionInstance(oTransition);
      TestCaseGeneratorRunnerState oNewRunnerState =
        new TestCaseGeneratorRunnerState();
      TestGoalTransitionSequence oTestGoal =
        new TestGoalTransitionSequence();
      // extend the new test goal with the elements from previously created test goals
      if(!in_oRunnerState.getTestGoalsToSatisfy().isEmpty()) {
        TestGoalTransitionSequence oOtherTestGoal =
          (TestGoalTransitionSequence)in_oRunnerState.getTestGoalsToSatisfy().get(0);
        oTestGoal.getTransitionSequence().addAll(oOtherTestGoal.getTransitionSequence());
      }
      oTestGoal.getTransitionSequence().add(
          new Pair<TCGNode, TCGTransition>(in_oTargetNode, oTransition));
      oNewRunnerState.getTestGoalsToSatisfy().add(oTestGoal);
//      oNewRunnerState.getCurrentTransitionPath().add(oTransitionInstance);
View Full Code Here

    // test goal (e.g. transition sequence)
    boolean bNormalSearchAllowed = true;
    if(!m_oTestCaseRunnerState.getTestGoalsToSatisfy().isEmpty()) {
      TestGoalBase oTestGoalToSatisfy = m_oTestCaseRunnerState.getTestGoalsToSatisfy().get(0);
      if(oTestGoalToSatisfy instanceof TestGoalTransitionSequence) {
        TestGoalTransitionSequence oTestGoalToSatisfySpec =
          (TestGoalTransitionSequence)oTestGoalToSatisfy;
        Pair<TCGNode, TCGTransition> oPredefinedNodeTransitionPair =
          oTestGoalToSatisfySpec.getEndNodeTransitionPair();
        if(oPredefinedNodeTransitionPair != null) {
          // check if predefined transition is an incoming transition of the current node
          if(oPredefinedNodeTransitionPair.getSecond().getTargetNode().equals(in_oNode)) {
            // remove the last transition
            oTestGoalToSatisfySpec.getTransitionSequence().remove(
                oTestGoalToSatisfySpec.getTransitionSequence().size() - 1);
           
            searchBackwardsFromTransition(oPredefinedNodeTransitionPair);
            if(getCreatedTestCase() != null) // search was successful: test case created
              return;

            oTestGoalToSatisfySpec.getTransitionSequence().add(oPredefinedNodeTransitionPair);
          }
          bNormalSearchAllowed = false;
        }
      }
    }
View Full Code Here

//      TCGConjunction in_oPrecondition,
      TCGConjunction in_oPostCondition)
  {
    boolean bFirstTestGoalIsEmptyTransitionSequence = false;
    TestGoalGuardConditions oTestGuardGoal = null;
    TestGoalTransitionSequence oTestGoalToSatisfySpec = null;
    if(!m_oTestCaseRunnerState.getTestGoalsToSatisfy().isEmpty()) {
      int nIndexForGuardCondition = 0;
      TestGoalBase oTestGoalToSatisfy = m_oTestCaseRunnerState.getTestGoalsToSatisfy().get(0);
      if(oTestGoalToSatisfy instanceof TestGoalTransitionSequence) {
        nIndexForGuardCondition = 1;
        oTestGoalToSatisfySpec =
          (TestGoalTransitionSequence)oTestGoalToSatisfy;
        if(oTestGoalToSatisfySpec.getTransitionSequence().isEmpty()) {
          bFirstTestGoalIsEmptyTransitionSequence = true;
        }
      }
      if(m_oTestCaseRunnerState.getTestGoalsToSatisfy().size() > nIndexForGuardCondition) {
        TestGoalBase oSecondGoal =
View Full Code Here

TOP

Related Classes of net.sf.parteg.base.testcasegraph.testgoals.TestGoalTransitionSequence

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.