Package org.apache.commons.scxml.model

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


    }
   
    public void testIsLegalConfigMultipleStatesActive() {
        Set states = new HashSet();

        State state1 = new State();
        state1.setId("1");
       
        State state2 = new State();
        state2.setId("2");

        State parent = new State();
        parent.setId("parentid");
       
        state2.setParent(parent);
        state1.setParent(parent);

        states.add(state1);
View Full Code Here


        assertEquals(ErrorConstants.ILLEGAL_CONFIG, errorReporter.getErrCode());
        assertEquals("Multiple OR states active for state parentid", errorReporter.getErrDetail());
    }
   
    public void testGetLCASameTarget() {
        TransitionTarget target = new State();
        target.setId("1");
       
        TransitionTarget returnValue = SCXMLHelper.getLCA(target, target);
       
        assertEquals("1", returnValue.getId());
    }
View Full Code Here

       
        assertEquals("1", returnValue.getId());
    }

    public void testGetLCAIsDescendant() {
        TransitionTarget target = new State();
        target.setId("1");

        TransitionTarget parent = new State();
        parent.setId("2");

        target.setParent(parent);
       
        TransitionTarget returnValue = SCXMLHelper.getLCA(target, parent);
       
View Full Code Here

       
        assertEquals("2", returnValue.getId());
    }
   
    public void testGetLCAIsDescendantReverse() {
        TransitionTarget target = new State();
        target.setId("1");

        TransitionTarget parent = new State();
        parent.setId("2");

        parent.setParent(target); // reversed
       
        TransitionTarget returnValue = SCXMLHelper.getLCA(target, parent);
       
        assertEquals("1", returnValue.getId());
    }
View Full Code Here

       
        assertEquals("1", returnValue.getId());
    }

    public void testGetLCANull() {
        TransitionTarget target = new State();
        target.setId("1");

        TransitionTarget notParent = new State();
        notParent.setId("2");

        TransitionTarget returnValue = SCXMLHelper.getLCA(target, notParent);
       
        assertNull(returnValue);
    }
View Full Code Here

       
        assertNull(returnValue);
    }

    public void testGetLCADistantAncestor() {
        TransitionTarget target1 = new State();
        target1.setId("1");

        TransitionTarget target2 = new State();
        target2.setId("2");

        TransitionTarget parent = new State();
        parent.setId("3");

        target1.setParent(parent);
        target2.setParent(parent);
       
        TransitionTarget returnValue = SCXMLHelper.getLCA(target1, target2);
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 testSerializeSCXMLNoStates() {
        SCXML scxml = new SCXML();
        scxml.setXmlns("namespace");
        scxml.setVersion("version1");
        scxml.setInitialstate("off");
        scxml.addState(new State());
       
        String assertValue = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
            + "<scxml xmlns=\"namespace\" version=\"version1\" "
            + "initialstate=\"off\">\n <state>\n </state>\n</scxml>\n";
       
View Full Code Here

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

    public void testSerializeActionsListNull() {
        TransitionTarget target = new State();
        target.setId("1");
       
        StringBuffer returnValue = new StringBuffer();
        boolean returnBoolean = SCXMLSerializer.serializeActions(returnValue, null, " ");
       
        assertFalse(returnBoolean);
View Full Code Here

        assertFalse(returnBoolean);
        assertEquals(actualValue, returnValue.toString());
    }
   
    public void testSerializeOnEntrySizeZero() {
        TransitionTarget target = new State();
        target.setOnEntry(new OnEntry());

        String actualValue = "";

        StringBuffer returnValue = new StringBuffer();
        SCXMLSerializer.serializeOnEntry(returnValue, target, " ");
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.