Package org.apache.commons.scxml.model

Examples of org.apache.commons.scxml.model.State


       
        assertEquals(actualValue, returnValue.toString());
    }

    public void testSerializeOnExit() {
        TransitionTarget target = new State();
       
        OnExit onExit = new OnExit();
        onExit.addAction(new Else());
       
        target.setOnExit(onExit);

        String actualValue = " <onexit>\n  <else/>\n </onexit>\n";

        StringBuffer returnValue = new StringBuffer();
        SCXMLSerializer.serializeOnExit(returnValue, target, " ");
View Full Code Here


        String[] testCaseName = {LogUtilsTest.class.getName()};
        junit.textui.TestRunner.main(testCaseName);
    }
   
    public void testGetTTPathParentNull() {
        TransitionTarget target = new State();
        target.setId("ID");
       
        assertEquals("/ID", LogUtils.getTTPath(target));
    }
View Full Code Here

       
        assertEquals("/ID", LogUtils.getTTPath(target));
    }
   
    public void testGetTTPathParent() {
        TransitionTarget target = new State();
        target.setId("ID");

        TransitionTarget parent1 = new State();
        parent1.setId("parent1");

        TransitionTarget parent2 = new State();
        parent2.setId("parent2");

        parent1.setParent(parent2);
        target.setParent(parent1);
       
        assertEquals("/parent2/parent1/ID", LogUtils.getTTPath(target));
View Full Code Here

       
        assertEquals("/parent2/parent1/ID", LogUtils.getTTPath(target));
    }
   
    public void testTransToString() {
        TransitionTarget targetTo = new State();
        targetTo.setId("TO");

        TransitionTarget targetFrom = new State();
        targetFrom.setId("FROM");
       
        Transition transition = new Transition();
        transition.setCond("condition");
        transition.setEvent("event happened");
       
View Full Code Here

    }

    public void testSCXMLDigesterSend01Sample() {
        // Digest
        scxml = SCXMLTestHelper.digest(send01);
        State ten = scxml.getInitialState();
        assertEquals("ten", ten.getId());
        List ten_done = ten.getTransitionsList("ten.done");
        assertEquals(1, ten_done.size());
        Transition ten2twenty = (Transition) ten_done.get(0);
        List actions = ten2twenty.getActions();
        assertEquals(1, actions.size());
        Send send = (Send) actions.get(0);
View Full Code Here

    public void setUp() {
        status = new Status();
    }
   
    public void testIsFinalStateFalse() {
        State state = new State();
        state.setIsFinal(false);
       
        status.getStates().add(state);
       
        assertFalse(status.isFinal());
    }
View Full Code Here

       
        assertFalse(status.isFinal());
    }
   
    public void testIsFinalStateHasParent() {
        State state = new State();
        state.setIsFinal(true);
        state.setParent(new State());
       
        status.getStates().add(state);

        assertFalse(status.isFinal());
    }
View Full Code Here

        assertFalse(status.isFinal());
    }
   
    public void testIsFinalStateHasEvent() {
        State state = new State();
        state.setIsFinal(true);
       
        status.getStates().add(state);
        status.getEvents().add(new TriggerEvent("name", TriggerEvent.CALL_EVENT));
       
        assertFalse(status.isFinal());
View Full Code Here

       
        assertFalse(status.isFinal());
    }
   
    public void testIsFinalState() {
        State state = new State();
        state.setIsFinal(true);
       
        status.getStates().add(state);
       
        assertTrue(status.isFinal());
    }
View Full Code Here

                Parallel par = ((Parallel) ((State) regions.next()).
                    getParent());
                //let's find affected states in sibling regions
                for (Iterator siblings = par.getStates().iterator();
                        siblings.hasNext();) {
                    State s = (State) siblings.next();
                    for (Iterator act = currentStates.iterator();
                            act.hasNext();) {
                        TransitionTarget a = (TransitionTarget) act.next();
                        if (isDescendant(a, s)) {
                            //a is affected
View Full Code Here

TOP

Related Classes of org.apache.commons.scxml.model.State

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.