Package org.xilaew.atg.model.abstractTestCaseGraph

Examples of org.xilaew.atg.model.abstractTestCaseGraph.AbstractTCGNode


    Deque<Pair> stack = new ArrayDeque<Pair>();

    for (AbstractTCGEdge edge : atcg.getInitialNode().getOutgoing()) {
      stack.add(new Pair(edge, new Integer(0)));
    }
    AbstractTCGNode currentNode = atcg.getInitialNode();
    Pair currentEdge;
    Path currentPath = TestCaseGraphRuntimeFactory.eINSTANCE.createPath();
    while (!stack.isEmpty()
        && (result.size() <= maxNoPaths || maxNoPaths == -1)) {
      currentEdge = stack.removeFirst();
      while (currentEdge.getSecond() != currentPath.getEdges().size()) {
        EList<AbstractTCGEdge> l = currentPath.getEdges();
        AbstractTCGEdge e = l.remove(l.size() - 1);
        // retreat
        currentNode = e.getSource();
      }
      if (!currentNode.equals(currentEdge.getFirst().getSource())) {
        try {
          throw new YouShallNotDoThisException("bullshit");
        } catch (YouShallNotDoThisException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
      ;
      currentNode = currentEdge.getFirst().getTarget();
      currentPath.getEdges().add(currentEdge.getFirst());
      if (currentPath.getEdges().size() <= maxDepth) {
        for (AbstractTCGEdge outgoing : currentNode.getOutgoing()) {
          stack.addFirst(new Pair(outgoing, new Integer(currentPath
              .getEdges().size())));
        }
      }
      if (currentNode.getOutgoing().size() == 0) {
        // found final node -> Add path to result
        result.add(currentPath);
        currentPath = TestCaseGraphRuntimeFactory.eINSTANCE
            .createPath();
        for (AbstractTCGEdge e : result.get(result.size() - 1)
View Full Code Here

TOP

Related Classes of org.xilaew.atg.model.abstractTestCaseGraph.AbstractTCGNode

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.