Package org.apache.commons.scxml.model

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


       
        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

        return exec.getSCInstance().lookupContext(tt);
    }

    public static Context lookupContext(SCXMLExecutor exec,
            String id) {
        TransitionTarget tt = lookupTransitionTarget(exec, id);
        if (tt == null) {
            return null;
        }
        return exec.getSCInstance().lookupContext(tt);
    }
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

       
        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

TOP

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

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.