Package nz.ac.waikato.modeljunit

Examples of nz.ac.waikato.modeljunit.Transition


          + " when only time changed.  "
          + "Use Timeouts to control time dependant states.";
      throw new FsmException(failmsg);
    }

    Transition done = new TimedTransition(startTime, fsmState_, m.getName(),
        newState);
    fsmSequence_.add(done);
    fsmState_ = newState;
    Assert.assertNotNull("Model Error: getState() must be non-null", fsmState_);
View Full Code Here


                    while (enumt.hasMoreElements()) {
                        tempNode = (ColorTreeNode) enumt.nextElement();
                        tempNode.setInCurrentSeq(true);

                        Transition nodeInfo = (Transition) tempNode.getUserObject();
                        EdgeInfo edgeInfo = jView_.getEdge(nodeInfo);
                        edgeInfo.setIsCurrSeq(true);
                        edgeInfo.getSrcVertex().setIsCurrSeq(true);
                        edgeInfo.getDestVertex().setIsCurrSeq(true);

                        if (tempNode.getUserObject() instanceof Transition
                                        && node.getParent().getIndex(tempNode) <= node.getParent().getIndex(node)) {
                            jView_.setEdgeDisplayed(nodeInfo, true);
                            pickedEdgeState.clear();
                            pickedVertexState.clear();
                            pickedEdgeState.pick(edgeInfo, true);
                            pickedVertexState.pick(edgeInfo.getDestVertex(), true);
                            pickedVertexState.pick(edgeInfo.getSrcVertex(), true);
                            updateInfoPanel(edgeInfo);
                        }
                    }
                    tree.treeDidChange();
                    vv.repaint();
                } else if (node.isRoot()) {
                    Collection<Object> checkEdges = g.getEdges();
                    for (Object ed : checkEdges) {
                        if (ed instanceof EdgeInfo) {
                            EdgeInfo ei = (EdgeInfo) ed;
                            if (ei.getIsVisited()) {
                                ei.setIsDisplayed(true);
                                ei.getSrcVertex().setIsDisplayed(true);
                                ei.getDestVertex().setIsDisplayed(true);
                                ei.setIsCurrSeq(false);
                                ei.getSrcVertex().setIsCurrSeq(false);
                                ei.getDestVertex().setIsCurrSeq(false);
                            }
                        }
                    }
                    pickedEdgeState.clear();
                    pickedVertexState.clear();
                    updateInfoPanel("Nothing Selected");
                    tree.treeDidChange();
                    vv.repaint();
                } else {
                    Collection<Object> checkEdges = g.getEdges();
                    for (Object ed : checkEdges) {
                        if (ed instanceof EdgeInfo) {
                            EdgeInfo ei = (EdgeInfo) ed;
                            ei.setIsDisplayed(false);
                            ei.getSrcVertex().setIsDisplayed(false);
                            ei.getDestVertex().setIsDisplayed(false);
                            ei.setIsCurrSeq(false);
                            ei.getSrcVertex().setIsCurrSeq(false);
                            ei.getDestVertex().setIsCurrSeq(false);
                        }
                    }
                    DefaultMutableTreeNode tempNode = null;
                    Enumeration enumt = node.children();
                    while (enumt.hasMoreElements()) {
                        tempNode = (DefaultMutableTreeNode) enumt.nextElement();
                        if (tempNode.getUserObject() instanceof Transition) {
                            Transition nodeInfo = (Transition) tempNode.getUserObject();
                            jView_.setEdgeDisplayed(nodeInfo, true);
                        }
                    }
                    pickedEdgeState.clear();
                    pickedVertexState.clear();
View Full Code Here

                            // TODO this has some strange effects on the repaint
                            //      of the tree and ModelJUnit. Fix this later.
                            //tree.scrollPathToVisible(new TreePath(node.getPath()));
                            //tree.setSelectionPath(new TreePath(node.getPath()));

                            Transition nodeInfo = (Transition) node.getUserObject();
                            EdgeInfo edge = jView_.getEdge(nodeInfo);

                            g.addVertex(edge.getSrcVertex());
                            g.addVertex(edge.getDestVertex());
                            g.addEdge(edge, edge.getSrcVertex(), edge.getDestVertex());
View Full Code Here

    /** A convenience method for converting a graph edge into a Transition. */
    public static Transition transition(Edge e, InspectableGraph model) {
        Object origin = model.origin(e).element();
        Object dest = model.destination(e).element();
        String action = (String) e.element();
        return new Transition(origin, action, dest);
    }
View Full Code Here

                dest = (VertexInfo) vertices.get(graph.getGraph().destination(e).element());
            }
            g.addVertex(dest);
            vertices.put(dest.getName(), dest);

            Transition action = new Transition(src.getName(), (String) e.element(), dest.getName());
            EdgeInfo edge = new EdgeInfo(action, src, dest);
            g.addEdge(edge, src, dest);
            edges.put(action, edge);

            edge.getSrcVertex().setOutgoingEdges(edge.getSrcVertex().getOutgoingEdges() + 1);
View Full Code Here

    }

    @Override
    public void failure(TestFailureException ex) {
        TestFailureException exp = (TestFailureException) ex;
        Transition tran = new Transition(exp.getState(), exp.getActionName(), exp.getState() + "_Fail");
        lastVisitedState_ = exp.getState();
        lastVisitedTrans_ = tran;
        lastVisitedFailedMsg_ = exp.getLocalizedMessage();
        failureOccured = true;
    }
View Full Code Here

        for (EdgeIterator iter = model.edges(); iter.hasNext();) {
            Edge e = iter.nextEdge();
            Object origin = model.origin(e).element();
            Object dest = model.destination(e).element();
            String action = (String) e.element();
            Transition tr = new Transition(origin, action, dest);
            addItem(tr);
        }
        maxCoverage_ = coverage_.size();
    }
View Full Code Here

    public void setGraph(InspectableGraph model, Map<Object, Vertex> state2vertex) {
        for (VertexIterator iter = model.vertices(); iter.hasNext();) {
            Vertex v = iter.nextVertex();
            for (EdgeIterator incoming = model.incidentEdges(v, EdgeDirection.IN); incoming.hasNext();) {
                Edge in = incoming.nextEdge();
                Transition inTrans = transition(in, model);
                for (EdgeIterator outgoing = model.incidentEdges(v, EdgeDirection.OUT); outgoing.hasNext();) {
                    Edge out = outgoing.nextEdge();
                    Transition outTrans = transition(out, model);
                    TransitionPair pair = new TransitionPair(inTrans, outTrans);
                    addItem(pair);
                }
            }
        }
View Full Code Here

TOP

Related Classes of nz.ac.waikato.modeljunit.Transition

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.