Package org.apache.commons.scxml.model

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


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

    public void testSerializeOnEntry() {
        TransitionTarget target = new State();
       
        OnEntry onEntry = new OnEntry();
        onEntry.addAction(new Else());
       
        target.setOnEntry(onEntry);

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

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


       
        assertEquals(actualValue, returnValue.toString());
    }
   
    public void testSerializeOnExitSizeZero() {
        TransitionTarget target = new State();
        target.setOnExit(new OnExit());

        String actualValue = "";

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

       
        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

    public void setUp() {
        comparator = new TransitionTargetComparator();
    }
   
    public void testComparatorEquals() {
        TransitionTarget target = new State();
       
        assertEquals(0, comparator.compare(target, target));
    }
View Full Code Here

       
        assertEquals(0, comparator.compare(target, target));
    }
   
    public void testComparatorNegative() {
        TransitionTarget target1 = new State();
        TransitionTarget target2 = new State();
       
        target1.setParent(target2);
       
        assertEquals(-1, comparator.compare(target1, target2));
    }
View Full Code Here

       
        assertEquals(-1, comparator.compare(target1, target2));
    }
   
    public void testComparatorPositive() {
        TransitionTarget target1 = new State();
        TransitionTarget target2 = new State();
       
        target2.setParent(target1);
       
        assertEquals(1, comparator.compare(target1, target2));
    }
View Full Code Here

       
        assertEquals(1, comparator.compare(target1, target2));
    }
   
    public void testComparatorFirstMoreParents() {
        TransitionTarget target1 = new State();
        TransitionTarget parent1 = new State();
        TransitionTarget parent2 = new State();

        parent1.setParent(parent2);
        target1.setParent(parent1);
       
        TransitionTarget target2 = new State();
        TransitionTarget parent3 = new State();
       
        target2.setParent(parent3);
       
        assertEquals(-1, comparator.compare(target1, target2));
    }
View Full Code Here

       
        assertEquals(-1, comparator.compare(target1, target2));
    }
   
    public void testComparatorSecondMoreParents() {
        TransitionTarget target1 = new State();
        TransitionTarget parent1 = new State();
        TransitionTarget parent2 = new State();

        parent1.setParent(parent2);
        target1.setParent(parent1);
       
        TransitionTarget target2 = new State();
        TransitionTarget parent3 = new State();
       
        target2.setParent(parent3);
       
        assertEquals(1, comparator.compare(target2, target1)); // reversed
    }
View Full Code Here

       
        assertEquals(1, comparator.compare(target2, target1)); // reversed
    }
   
    public void testComparatorSameParents() {
        TransitionTarget target1 = new State();
        TransitionTarget parent1 = new State();

        target1.setParent(parent1);
       
        TransitionTarget target2 = new State();
        TransitionTarget parent2 = new State();
       
        target2.setParent(parent2);
       
        assertEquals(0, comparator.compare(target1, target2));
    }
View Full Code Here

        namespaces.put("foo", "http://f.o.o");
        namespaces.put("bar", "http://b.a.r");
        scxml.setNamespaces(namespaces);
        scxml.setVersion("version1");
        scxml.setInitial("off");
        scxml.addChild(new State());
       
        String assertValue = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
            + "<scxml xmlns=\"http://www.w3.org/2005/07/scxml\" xmlns:cs=\"http://commons.apache.org/scxml\" "
            + "xmlns:foo=\"http://f.o.o\" xmlns:bar=\"http://b.a.r\" "
            + "version=\"version1\" initial=\"off\">\n <!-- http://commons.apache.org/scxml -->\n <state>\n "
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.