Examples of PTATestSequenceEngine


Examples of statechum.xmachine.model.testset.PTATestSequenceEngine

  // TODO to test with red = init, with and without loop around it (red=init and no loop is 3_1), with and without states which cannot be reached from a red state,
  // where a path in the original machine corresponding to a path in the merged one exists or not (tested with 3_1)
  public List<List<String>> computeQS(final StatePair pair, computeStateScores temp)
  {
    Vertex tempRed = temp.findVertex((String)pair.getR().getUserDatum(JUConstants.LABEL));
    PTATestSequenceEngine engine = new PTATestSequenceEngine();
    engine.init(new NonExistingPaths((CmpVertex)init));
    PTATestSequenceEngine.sequenceSet paths = engine.new sequenceSet();paths.setIdentity();

    List<Collection<String>> sequenceOfSets = temp.computePathsSBetween(temp.init,tempRed);
    if (sequenceOfSets == null)
      throw new IllegalArgumentException("failed to find the red state in the merge result");
    for(Collection<String> inputsToMultWith:sequenceOfSets)
      paths = paths.crossWithSet(inputsToMultWith);

    buildQuestionsFromPair(temp, tempRed, paths,engine);
    for(Entry<String,CmpVertex> loopEntry:temp.transitionMatrix.get(tempRed).entrySet())
      if (loopEntry.getValue() == tempRed)
      {// Note an input corresponding to any loop in temp can be followed in the original machine, since
        // a loop in temp is either due to the merge or because it was there in the first place.
        List<String> initialSeq = new LinkedList<String>();initialSeq.add(loopEntry.getKey());
        buildQuestionsFromPair(temp, loopEntry.getValue(),paths.crossWithSet(initialSeq),engine);
      }
    return engine.getData();
  }
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.