commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ate Douma <...@douma.nu>
Subject Re: svn commit: r1532637 [1/4] - in /commons/proper/scxml/trunk: ./ src/test/java/org/apache/commons/scxml2/ src/test/java/org/apache/commons/scxml2/env/ src/test/java/org/apache/commons/scxml2/env/faces/ src/test/java/org/apache/commons/scxml2/env/javascr...
Date Wed, 16 Oct 2013 07:24:51 GMT
Wow, that is a great and unexpected help Dave!

Mind you, Woonsan just opened a JIRA ticket [1] for this yesterday...
It might be proper if you re-assign that ticket to yourself and resolve it as 
already done?

Thanks a lot!

[1] https://issues.apache.org/jira/browse/SCXML-171


On 10/16/2013 05:46 AM, dbrosius@apache.org wrote:
> Author: dbrosius
> Date: Wed Oct 16 03:46:58 2013
> New Revision: 1532637
>
> URL: http://svn.apache.org/r1532637
> Log:
> upgrade junit usage to v4.11
>
> Modified:
>      commons/proper/scxml/trunk/pom.xml
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/BuiltinTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/EventDataTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/NamespacePrefixedXPathsTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCInstanceTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCXMLExecutorTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCXMLHelperTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCXMLTestHelper.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/StatusTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/TieBreakerTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/TriggerEventTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/WildcardTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/WizardsTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/AbstractSCXMLListenerTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/AbstractStateMachineTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/LogUtilsTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/SimpleContextTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/StopWatchTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/faces/SessionContextTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/javascript/JSBindingsTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/javascript/JSContextTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/javascript/JSEvaluatorTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/javascript/JSExampleTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/jexl/JexlContextTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/jexl/JexlEvaluatorTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/jexl/StaticMethodTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/jsp/ELEvaluatorTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/jsp/RootContextTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/rhino/RhinoContextTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/rhino/RhinoEvaluatorTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/rhino/RhinoExampleTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/servlet/ServletContextResolverTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/xpath/XPathExampleTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/invoke/InvokeParamNameTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/invoke/InvokeTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/SCXMLReaderTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/SCXMLSerializerTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/SCXMLWriterTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/StateSrcTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/issues/Issue112Test.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/issues/Issue62Test.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/issues/Issue64Test.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ActionTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ActionsTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/AssignTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/CustomActionTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/DatamodelTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/HistoryTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ParallelTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/PathTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ScriptTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/StateTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/StatelessModelTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/TransitionTest.java
>      commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/semantics/TransitionTargetComparatorTest.java
>
> Modified: commons/proper/scxml/trunk/pom.xml
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/pom.xml?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/pom.xml (original)
> +++ commons/proper/scxml/trunk/pom.xml Wed Oct 16 03:46:58 2013
> @@ -155,7 +155,7 @@
>       <dependency>
>         <groupId>junit</groupId>
>         <artifactId>junit</artifactId>
> -      <version>3.8.2</version>
> +      <version>4.11</version>
>         <scope>test</scope>
>       </dependency>
>       <dependency>
>
> Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/BuiltinTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/BuiltinTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/BuiltinTest.java (original)
> +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/BuiltinTest.java Wed Oct 16 03:46:58 2013
> @@ -21,21 +21,19 @@ import java.util.Set;
>
>   import org.apache.commons.scxml2.model.State;
>   import org.apache.commons.scxml2.model.TransitionTarget;
> +import org.junit.Assert;
> +import org.junit.Test;
>
> -import junit.framework.TestCase;
> -
> -public class BuiltinTest extends TestCase {
> -
> -    public BuiltinTest(String testName) {
> -        super(testName);
> -    }
> +public class BuiltinTest {
>
> +    @Test
>       public void testIsMemberEmptySet() {
>           Set<TransitionTarget> set = new HashSet<TransitionTarget>();
>
> -        assertFalse(Builtin.isMember(set, "on"));
> +        Assert.assertFalse(Builtin.isMember(set, "on"));
>       }
>
> +    @Test
>       public void testIsMemberFalse() {
>           TransitionTarget state = new State();
>           state.setId("off");
> @@ -43,9 +41,10 @@ public class BuiltinTest extends TestCas
>           Set<TransitionTarget> set = new HashSet<TransitionTarget>();
>           set.add(state);
>
> -        assertFalse(Builtin.isMember(set, "on"));
> +        Assert.assertFalse(Builtin.isMember(set, "on"));
>       }
>
> +    @Test
>       public void testIsMemberTrue() {
>           TransitionTarget state = new State();
>           state.setId("on");
> @@ -53,7 +52,7 @@ public class BuiltinTest extends TestCas
>           Set<TransitionTarget> set = new HashSet<TransitionTarget>();
>           set.add(state);
>
> -        assertTrue(Builtin.isMember(set, "on"));
> +        Assert.assertTrue(Builtin.isMember(set, "on"));
>       }
>
>   }
>
> Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/EventDataTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/EventDataTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/EventDataTest.java (original)
> +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/EventDataTest.java Wed Oct 16 03:46:58 2013
> @@ -19,24 +19,20 @@ package org.apache.commons.scxml2;
>   import java.net.URL;
>   import java.util.Set;
>
> -import junit.framework.TestCase;
>   import org.apache.commons.scxml2.env.SimpleScheduler;
>   import org.apache.commons.scxml2.env.Tracer;
>   import org.apache.commons.scxml2.env.jexl.JexlEvaluator;
>   import org.apache.commons.scxml2.model.SCXML;
>   import org.apache.commons.scxml2.model.TransitionTarget;
> +import org.junit.After;
> +import org.junit.Assert;
> +import org.junit.Before;
> +import org.junit.Test;
>   /**
>    * Unit tests {@link org.apache.commons.scxml2.SCXMLExecutor}.
>    * Testing special variable "_eventdata"
>    */
> -public class EventDataTest extends TestCase {
> -    /**
> -     * Construct a new instance of SCXMLExecutorTest with
> -     * the specified name
> -     */
> -    public EventDataTest(String name) {
> -        super(name);
> -    }
> +public class EventDataTest {
>
>       // Test data
>       private URL eventdata01, eventdata02, eventdata03, eventdata04;
> @@ -45,7 +41,7 @@ public class EventDataTest extends TestC
>       /**
>        * Set up instance variables required by this test case.
>        */
> -    @Override
> +    @Before
>       public void setUp() {
>           eventdata01 = this.getClass().getClassLoader().
>               getResource("org/apache/commons/scxml2/env/jexl/eventdata-01.xml");
> @@ -60,7 +56,7 @@ public class EventDataTest extends TestC
>       /**
>        * Tear down instance variables required by this test case.
>        */
> -    @Override
> +    @After
>       public void tearDown() {
>           eventdata01 = eventdata02 = eventdata03 = eventdata04 = null;
>       }
> @@ -68,67 +64,71 @@ public class EventDataTest extends TestC
>       /**
>        * Test the SCXML documents, usage of "_eventdata"
>        */
> +    @Test
>       public void testEventdata01Sample() throws Exception {
>       	exec = SCXMLTestHelper.getExecutor(eventdata01);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state1", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state1", currentStates.iterator().next().getId());
>           TriggerEvent te = new TriggerEvent("event.foo",
>               TriggerEvent.SIGNAL_EVENT, new Integer(3));
>           currentStates = SCXMLTestHelper.fireEvent(exec, te);
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state3", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state3", currentStates.iterator().next().getId());
>           TriggerEvent[] evts = new TriggerEvent[] { te,
>               new TriggerEvent("event.bar", TriggerEvent.SIGNAL_EVENT,
>               new Integer(6))};
>           currentStates = SCXMLTestHelper.fireEvents(exec, evts);
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state6", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state6", currentStates.iterator().next().getId());
>           te = new TriggerEvent("event.baz",
>               TriggerEvent.SIGNAL_EVENT, new Integer(7));
>           currentStates = SCXMLTestHelper.fireEvent(exec, te);
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state7", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state7", currentStates.iterator().next().getId());
>       }
>
> +    @Test
>       public void testEventdata02Sample() throws Exception {
>       	exec = SCXMLTestHelper.getExecutor(eventdata02);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state0", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state0", currentStates.iterator().next().getId());
>           TriggerEvent te1 = new TriggerEvent("connection.alerting",
>               TriggerEvent.SIGNAL_EVENT, "line2");
>           currentStates = SCXMLTestHelper.fireEvent(exec, te1);
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state2", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state2", currentStates.iterator().next().getId());
>           TriggerEvent te2 = new TriggerEvent("connection.alerting",
>               TriggerEvent.SIGNAL_EVENT,
>               new ConnectionAlertingPayload(4));
>           currentStates = SCXMLTestHelper.fireEvent(exec, te2);
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state4", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state4", currentStates.iterator().next().getId());
>       }
>
> +    @Test
>       public void testEventdata03Sample() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(eventdata03);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(1, currentStates.size());
> -        assertEquals("ten", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("ten", currentStates.iterator().next().getId());
>           TriggerEvent te = new TriggerEvent("event.foo",
>               TriggerEvent.SIGNAL_EVENT);
>           currentStates = SCXMLTestHelper.fireEvent(exec, te);
> -        assertEquals(1, currentStates.size());
> -        assertEquals("thirty", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("thirty", currentStates.iterator().next().getId());
>       }
>
> +    @Test
>       public void testEventdata04Sample() throws Exception {
>           SCXML scxml = SCXMLTestHelper.parse(eventdata04);
>           Tracer trc = new Tracer();
>           exec = new SCXMLExecutor(new JexlEvaluator(), null, trc);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           exec.setEventdispatcher(new SimpleScheduler(exec));
>           exec.addListener(scxml, trc);
>           exec.setStateMachine(scxml);
>
> Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/NamespacePrefixedXPathsTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/NamespacePrefixedXPathsTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/NamespacePrefixedXPathsTest.java (original)
> +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/NamespacePrefixedXPathsTest.java Wed Oct 16 03:46:58 2013
> @@ -19,24 +19,19 @@ package org.apache.commons.scxml2;
>   import java.net.URL;
>   import java.util.Set;
>
> -import junit.framework.TestCase;
>   import org.apache.commons.scxml2.env.jsp.ELContext;
>   import org.apache.commons.scxml2.env.jsp.ELEvaluator;
>   import org.apache.commons.scxml2.model.State;
>   import org.apache.commons.scxml2.model.TransitionTarget;
> +import org.junit.After;
> +import org.junit.Assert;
> +import org.junit.Before;
> +import org.junit.Test;
>
>   /**
>    * Unit tests for namespace prefixes in XPaths pointing bits in a &lt;data&gt;.
>    */
> -public class NamespacePrefixedXPathsTest extends TestCase {
> -
> -    /**
> -     * Construct a new instance of NamespacePrefixedXPathsTest with
> -     * the specified name
> -     */
> -    public NamespacePrefixedXPathsTest(String name) {
> -        super(name);
> -    }
> +public class NamespacePrefixedXPathsTest {
>
>       // Test data
>       private URL datamodel03jexl, datamodel03jsp;
> @@ -45,7 +40,7 @@ public class NamespacePrefixedXPathsTest
>       /**
>        * Set up instance variables required by this test case.
>        */
> -    @Override
> +    @Before
>       public void setUp() throws Exception {
>           datamodel03jexl = this.getClass().getClassLoader().
>               getResource("org/apache/commons/scxml2/env/jexl/datamodel-03.xml");
> @@ -58,7 +53,7 @@ public class NamespacePrefixedXPathsTest
>       /**
>        * Tear down instance variables required by this test case.
>        */
> -    @Override
> +    @After
>       public void tearDown() {
>           datamodel03jexl = datamodel03jsp = null;
>           exec01 = exec02 = null;
> @@ -68,11 +63,13 @@ public class NamespacePrefixedXPathsTest
>        * Test the XPath evaluation
>        */
>       // JEXL
> +    @Test
>       public void testNamespacePrefixedXPathsJexl() throws Exception {
>           runtest(exec01);
>       }
>
>       // EL
> +    @Test
>       public void testNamespacePrefixedXPathsEL() throws Exception {
>           runtest(exec02);
>       }
> @@ -81,48 +78,48 @@ public class NamespacePrefixedXPathsTest
>       private void runtest(SCXMLExecutor exec) throws Exception {
>           // must be in state "ten" at the onset
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(1, currentStates.size());
> -        assertEquals("ten", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("ten", currentStates.iterator().next().getId());
>
>           // should move to "twenty"
>           currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("twenty", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("twenty", currentStates.iterator().next().getId());
>
>           // This is set while exiting "ten"
>           Double retval = (Double) exec.getRootContext().get("retval");
> -        assertEquals(Double.valueOf("11"), retval);
> +        Assert.assertEquals(Double.valueOf("11"), retval);
>
>           // On to "thirty"
>           currentStates = SCXMLTestHelper.fireEvent(exec, "twenty.done");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("thirty", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("thirty", currentStates.iterator().next().getId());
>           exec = SCXMLTestHelper.testExecutorSerializability(exec);
>
>           // Tests XPath on SCXML actions, set while exiting "twenty"
>           String retvalstr = (String) exec.getRootContext().get("retval");
> -        assertEquals("Equal to 20", retvalstr);
> +        Assert.assertEquals("Equal to 20", retvalstr);
>
>           // and so on ...
>           currentStates = SCXMLTestHelper.fireEvent(exec, "thirty.done");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("forty", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("forty", currentStates.iterator().next().getId());
>
>           currentStates = SCXMLTestHelper.fireEvent(exec, "forty.done");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("fifty", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("fifty", currentStates.iterator().next().getId());
>
>           currentStates = SCXMLTestHelper.fireEvent(exec, "fifty.done");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("sixty", ((State)currentStates.iterator().
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("sixty", ((State)currentStates.iterator().
>               next()).getId());
>
>           currentStates = SCXMLTestHelper.fireEvent(exec, "sixty.done");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("seventy", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("seventy", currentStates.iterator().next().getId());
>
>           // done
> -        assertTrue(exec.getCurrentStatus().isFinal());
> +        Assert.assertTrue(exec.getCurrentStatus().isFinal());
>       }
>   }
>
>
> Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCInstanceTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCInstanceTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCInstanceTest.java (original)
> +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCInstanceTest.java Wed Oct 16 03:46:58 2013
> @@ -25,42 +25,43 @@ import org.apache.commons.scxml2.env.jex
>   import org.apache.commons.scxml2.model.History;
>   import org.apache.commons.scxml2.model.State;
>   import org.apache.commons.scxml2.model.TransitionTarget;
> +import org.junit.Assert;
> +import org.junit.Before;
> +import org.junit.Test;
>
> -import junit.framework.TestCase;
> -
> -public class SCInstanceTest extends TestCase {
> -
> -    public SCInstanceTest(String testName) {
> -        super(testName);
> -    }
> +public class SCInstanceTest {
>
>       private SCInstance instance;
>
> -    @Override
> +    @Before
>       public void setUp() {
>           instance = new SCInstance(null);
>       }
>
> +    @Test
>       public void testGetRootContextNull() {
> -        assertNull(instance.getRootContext());
> +        Assert.assertNull(instance.getRootContext());
>       }
>
> +    @Test
>       public void testGetRootContext() {
>           Context context = new SimpleContext();
>           context.set("name", "value");
>
>           instance.setRootContext(context);
> -        assertEquals("value", instance.getRootContext().get("name"));
> +        Assert.assertEquals("value", instance.getRootContext().get("name"));
>       }
>
> +    @Test
>       public void testGetRootContextEvaluator() {
>           Evaluator evaluator = new JexlEvaluator();
>
>           instance.setEvaluator(evaluator);
>
> -        assertTrue(instance.getRootContext() instanceof JexlContext);
> +        Assert.assertTrue(instance.getRootContext() instanceof JexlContext);
>       }
>
> +    @Test
>       public void testGetContext() {
>           TransitionTarget target = new State();
>           target.setId("1");
> @@ -70,9 +71,10 @@ public class SCInstanceTest extends Test
>
>           instance.setContext(target, context);
>
> -        assertEquals("value", instance.getContext(target).get("name"));
> +        Assert.assertEquals("value", instance.getContext(target).get("name"));
>       }
>
> +    @Test
>       public void testGetContextNullParent() {
>           TransitionTarget target = new State();
>           target.setId("1");
> @@ -84,10 +86,11 @@ public class SCInstanceTest extends Test
>           Evaluator evaluator = new JexlEvaluator();
>           instance.setEvaluator(evaluator);
>
> -        assertEquals("value", instance.getContext(target).get("name"));
> -        assertEquals("value", instance.lookupContext(target).get("name"));
> +        Assert.assertEquals("value", instance.getContext(target).get("name"));
> +        Assert.assertEquals("value", instance.lookupContext(target).get("name"));
>       }
>
> +    @Test
>       public void testGetContextParent() {
>           TransitionTarget target = new State();
>           target.setId("1");
> @@ -104,19 +107,20 @@ public class SCInstanceTest extends Test
>           Evaluator evaluator = new JexlEvaluator();
>           instance.setEvaluator(evaluator);
>
> -        assertEquals("value", instance.getContext(target).get("name"));
> -        assertEquals("value", instance.lookupContext(target).get("name"));
> +        Assert.assertEquals("value", instance.getContext(target).get("name"));
> +        Assert.assertEquals("value", instance.lookupContext(target).get("name"));
>       }
>
> +    @Test
>       public void testGetLastConfigurationNull() {
>           History history = new History();
>
>           Set<TransitionTarget> returnConfiguration = instance.getLastConfiguration(history);
>
> -        assertEquals(0, returnConfiguration.size());
> +        Assert.assertEquals(0, returnConfiguration.size());
>       }
>
> -
> +    @Test
>       public void testGetLastConfiguration() {
>           History history = new History();
>           history.setId("1");
> @@ -131,15 +135,17 @@ public class SCInstanceTest extends Test
>
>           Set<TransitionTarget> returnConfiguration = instance.getLastConfiguration(history);
>
> -        assertEquals(2, returnConfiguration.size());
> -        assertTrue(returnConfiguration.contains(tt1));
> -        assertTrue(returnConfiguration.contains(tt2));
> +        Assert.assertEquals(2, returnConfiguration.size());
> +        Assert.assertTrue(returnConfiguration.contains(tt1));
> +        Assert.assertTrue(returnConfiguration.contains(tt2));
>       }
>
> +    @Test
>       public void testIsEmpty() {
> -        assertTrue(instance.isEmpty(new History()));
> +        Assert.assertTrue(instance.isEmpty(new History()));
>       }
>
> +    @Test
>       public void testIsEmptyFalse() {
>           History history = new History();
>           history.setId("1");
> @@ -150,9 +156,10 @@ public class SCInstanceTest extends Test
>
>           instance.setLastConfiguration(history, configuration);
>
> -        assertFalse(instance.isEmpty(history));
> +        Assert.assertFalse(instance.isEmpty(history));
>       }
>
> +    @Test
>       public void testReset() {
>           History history = new History();
>           history.setId("1");
> @@ -165,7 +172,7 @@ public class SCInstanceTest extends Test
>
>           instance.reset(history);
>
> -        assertTrue(instance.isEmpty(history));
> +        Assert.assertTrue(instance.isEmpty(history));
>       }
>
>   }
>
> Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCXMLExecutorTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCXMLExecutorTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCXMLExecutorTest.java (original)
> +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCXMLExecutorTest.java Wed Oct 16 03:46:58 2013
> @@ -20,23 +20,19 @@ import java.net.URL;
>   import java.util.HashSet;
>   import java.util.Set;
>
> -import junit.framework.TestCase;
>   import org.apache.commons.scxml2.env.SimpleContext;
>   import org.apache.commons.scxml2.env.jsp.ELEvaluator;
>   import org.apache.commons.scxml2.model.SCXML;
>   import org.apache.commons.scxml2.model.State;
>   import org.apache.commons.scxml2.model.TransitionTarget;
> +import org.junit.After;
> +import org.junit.Assert;
> +import org.junit.Before;
> +import org.junit.Test;
>   /**
>    * Unit tests {@link org.apache.commons.scxml2.SCXMLExecutor}.
>    */
> -public class SCXMLExecutorTest extends TestCase {
> -    /**
> -     * Construct a new instance of SCXMLExecutorTest with
> -     * the specified name
> -     */
> -    public SCXMLExecutorTest(String name) {
> -        super(name);
> -    }
> +public class SCXMLExecutorTest {
>
>       // Test data
>       private URL microwave01jsp, microwave02jsp, microwave01jexl,
> @@ -47,7 +43,7 @@ public class SCXMLExecutorTest extends T
>       /**
>        * Set up instance variables required by this test case.
>        */
> -    @Override
> +    @Before
>       public void setUp() {
>           microwave01jsp = this.getClass().getClassLoader().
>               getResource("org/apache/commons/scxml2/env/jsp/microwave-01.xml");
> @@ -86,7 +82,7 @@ public class SCXMLExecutorTest extends T
>       /**
>        * Tear down instance variables required by this test case.
>        */
> -    @Override
> +    @After
>       public void tearDown() {
>           microwave01jsp = microwave02jsp = microwave01jexl = microwave02jexl =
>               microwave04jexl = microwave05jexl = transitions01 = transitions02 = transitions03 =
> @@ -96,189 +92,205 @@ public class SCXMLExecutorTest extends T
>       /**
>        * Test the implementation
>        */
> +    @Test
>       public void testSCXMLExecutorMicrowave01JspSample() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(microwave01jsp,
>               new SimpleContext(), new ELEvaluator());
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           checkMicrowave01Sample();
>       }
>
> +    @Test
>       public void testSCXMLExecutorMicrowave02JspSample() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(microwave02jsp,
>               new SimpleContext(), new ELEvaluator());
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           checkMicrowave02Sample();
>       }
>
> +    @Test
>       public void testSCXMLExecutorMicrowave01JexlSample() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(microwave01jexl);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           checkMicrowave01Sample();
>       }
>
> +    @Test
>       public void testSCXMLExecutorMicrowave02JexlSample() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(microwave02jexl);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           checkMicrowave02Sample();
>       }
>
>       // Uses SCXMLParser (latest WD)
> +    @Test
>       public void testSCXMLExecutorMicrowave03JexlSample() throws Exception {
>           SCXML scxml = SCXMLTestHelper.parse(microwave03jexl);
> -        assertNotNull(scxml);
> +        Assert.assertNotNull(scxml);
>           exec = SCXMLTestHelper.getExecutor(scxml);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           checkMicrowave01Sample();
>       }
>
>       // Uses SCXMLParser (latest WD)
> +    @Test
>       public void testSCXMLExecutorMicrowave04JexlSample() throws Exception {
>           SCXML scxml = SCXMLTestHelper.parse(microwave04jexl);
> -        assertNotNull(scxml);
> +        Assert.assertNotNull(scxml);
>           exec = SCXMLTestHelper.getExecutor(scxml);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           checkMicrowave02Sample();
>       }
>
>       // Uses SCXMLParser (latest WD)
> +    @Test
>       public void testSCXMLExecutorMicrowave05JexlSample() throws Exception {
>           SCXML scxml = SCXMLTestHelper.parse(microwave05jexl);
> -        assertNotNull(scxml);
> +        Assert.assertNotNull(scxml);
>           exec = SCXMLTestHelper.getExecutor(scxml);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           checkMicrowave02Sample();
>       }
>
> +    @Test
>       public void testSCXMLExecutorPrefix01Sample() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(prefix01);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(1, currentStates.size());
> -        assertEquals("ten", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("ten", currentStates.iterator().next().getId());
>           currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("twenty", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("twenty", currentStates.iterator().next().getId());
>       }
>
> +    @Test
>       public void testSCXMLExecutorTransitions01Sample() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(transitions01);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("twenty_one", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("twenty_one", currentStates.iterator().next().getId());
>           currentStates = SCXMLTestHelper.fireEvent(exec, "twenty_one.done");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("twenty_two", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("twenty_two", currentStates.iterator().next().getId());
>           currentStates = SCXMLTestHelper.fireEvent(exec, "twenty_two.done");
> -        assertEquals(3, exec.getCurrentStatus().getStates().size());
> +        Assert.assertEquals(3, exec.getCurrentStatus().getStates().size());
>       }
>
> +    @Test
>       public void testSCXMLExecutorTransitions02Sample() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(transitions02);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "ten.stay");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("ten", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("ten", currentStates.iterator().next().getId());
>           exec = SCXMLTestHelper.testExecutorSerializability(exec);
>           currentStates = SCXMLTestHelper.fireEvent(exec, "ten.self");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("ten", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("ten", currentStates.iterator().next().getId());
>           currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("twenty", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("twenty", currentStates.iterator().next().getId());
>       }
>
> +    @Test
>       public void testSCXMLExecutorTransitions03Sample() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(transitions03);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
> -        assertEquals(3, currentStates.size());
> +        Assert.assertEquals(3, currentStates.size());
>           Set<String> expected = new HashSet<String>();
>           expected.add("twenty_one_2");
>           expected.add("twenty_two_2");
>           expected.add("twenty_three_2");
>           for (TransitionTarget tt : currentStates) {
>               if (!expected.remove(tt.getId())) {
> -                fail("'" + tt.getId()
> +                Assert.fail("'" + tt.getId()
>                       + "' is not an expected current state ID");
>               }
>           }
>       }
>
>       // Uses SCXMLParser (latest WD)
> +    @Test
>       public void testSCXMLExecutorTransitions04Sample() throws Exception {
>           SCXML scxml = SCXMLTestHelper.parse(transitions04);
> -        assertNotNull(scxml);
> +        Assert.assertNotNull(scxml);
>           exec = SCXMLTestHelper.getExecutor(scxml);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
> -        assertEquals(3, currentStates.size());
> +        Assert.assertEquals(3, currentStates.size());
>           Set<String> expected = new HashSet<String>();
>           expected.add("twenty_one_1");
>           expected.add("twenty_two_1");
>           expected.add("twenty_three_1");
>           for (TransitionTarget tt : currentStates) {
>               if (!expected.remove(tt.getId())) {
> -                fail("'" + tt.getId()
> +                Assert.fail("'" + tt.getId()
>                       + "' is not an expected current state ID");
>               }
>           }
>           currentStates = SCXMLTestHelper.fireEvent(exec, "bar");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("thirty", ((State)currentStates.iterator().
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("thirty", ((State)currentStates.iterator().
>               next()).getId());
>       }
>
> +    @Test
>       public void testSCXMLExecutorTransitions05Sample() throws Exception {
>           SCXML scxml = SCXMLTestHelper.parse(transitions05);
> -        assertNotNull(scxml);
> +        Assert.assertNotNull(scxml);
>           exec = SCXMLTestHelper.getExecutor(scxml);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           SCXMLTestHelper.assertPostTriggerState(exec, "foo", "end");
>       }
>
> +    @Test
>       public void testSCXMLExecutorTransitions06Sample() throws Exception {
>           SCXML scxml = SCXMLTestHelper.parse(transitions06);
> -        assertNotNull(scxml);
> +        Assert.assertNotNull(scxml);
>           exec = SCXMLTestHelper.getExecutor(scxml);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           SCXMLTestHelper.assertPostTriggerStates(exec, "start", new String[]{"one", "two"});
>           SCXMLTestHelper.assertPostTriggerState(exec, "onetwo_three", "three");
>           SCXMLTestHelper.assertPostTriggerStates(exec, "three_one", new String[]{"one", "two"});
>           SCXMLTestHelper.assertPostTriggerState(exec, "two_four", "four");
>       }
>
> +    @Test
>       public void testSend01Sample() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(send01);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(1, currentStates.size());
> -        assertEquals("ten", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("ten", currentStates.iterator().next().getId());
>           currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("twenty", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("twenty", currentStates.iterator().next().getId());
>       }
>
> +    @Test
>       public void testSend02TypeSCXMLSample() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(send02);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(1, currentStates.size());
> -        assertEquals("ninety", currentStates.iterator().next().getId());
> -        assertTrue(exec.getCurrentStatus().isFinal());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("ninety", currentStates.iterator().next().getId());
> +        Assert.assertTrue(exec.getCurrentStatus().isFinal());
>       }
>
>       private void checkMicrowave01Sample() throws Exception {
>           Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "turn_on");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("cooking", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("cooking", currentStates.iterator().next().getId());
>       }
>
>       private void checkMicrowave02Sample() throws Exception {
>           Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "turn_on");
> -        assertEquals(2, currentStates.size());
> +        Assert.assertEquals(2, currentStates.size());
>           String id = ((State)currentStates.iterator().next()).getId();
> -        assertTrue(id.equals("closed") || id.equals("cooking"));
> +        Assert.assertTrue(id.equals("closed") || id.equals("cooking"));
>       }
>   }
>
>
> Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCXMLHelperTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCXMLHelperTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCXMLHelperTest.java (original)
> +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCXMLHelperTest.java Wed Oct 16 03:46:58 2013
> @@ -19,55 +19,59 @@ package org.apache.commons.scxml2;
>   import java.util.HashSet;
>   import java.util.Set;
>
> -import junit.framework.TestCase;
>   import org.apache.commons.scxml2.env.MockErrorReporter;
>   import org.apache.commons.scxml2.env.SimpleErrorReporter;
>   import org.apache.commons.scxml2.model.Parallel;
>   import org.apache.commons.scxml2.model.State;
>   import org.apache.commons.scxml2.model.TransitionTarget;
>   import org.apache.commons.scxml2.semantics.ErrorConstants;
> +import org.junit.Assert;
> +import org.junit.Test;
>
> -public class SCXMLHelperTest extends TestCase {
> -
> -    public SCXMLHelperTest(String testName) {
> -        super(testName);
> -    }
> +public class SCXMLHelperTest {
>
> +    @Test
>       public void testIsStringEmptyNull() {
> -        assertTrue(SCXMLHelper.isStringEmpty(null));
> +        Assert.assertTrue(SCXMLHelper.isStringEmpty(null));
>       }
>
> +    @Test
>       public void testIsStringEmptyZeroLength() {
> -        assertTrue(SCXMLHelper.isStringEmpty(""));
> +        Assert.assertTrue(SCXMLHelper.isStringEmpty(""));
>       }
>
> +    @Test
>       public void testIsStringEmpty() {
> -        assertFalse(SCXMLHelper.isStringEmpty("value"));
> +        Assert.assertFalse(SCXMLHelper.isStringEmpty("value"));
>       }
>
> +    @Test
>       public void testIsDescendantNullParent() {
>           TransitionTarget state = new State();
>           TransitionTarget context = new State();
>
> -        assertFalse(SCXMLHelper.isDescendant(state, context));
> +        Assert.assertFalse(SCXMLHelper.isDescendant(state, context));
>       }
>
> +    @Test
>       public void testIsDescendantNotEqual() {
>           TransitionTarget state = new State();
>           state.setParent(new State());
>           TransitionTarget context = new State();
>
> -        assertFalse(SCXMLHelper.isDescendant(state, context));
> +        Assert.assertFalse(SCXMLHelper.isDescendant(state, context));
>       }
>
> +    @Test
>       public void testIsDescendantEqual() {
>           TransitionTarget state = new State();
>           TransitionTarget context = new State();
>           state.setParent(context);
>
> -        assertTrue(SCXMLHelper.isDescendant(state, context));
> +        Assert.assertTrue(SCXMLHelper.isDescendant(state, context));
>       }
>
> +    @Test
>       public void testIsDescendantParentEqual() {
>           TransitionTarget state = new State();
>           TransitionTarget context = new State();
> @@ -76,17 +80,19 @@ public class SCXMLHelperTest extends Tes
>           parent.setParent(context);
>           state.setParent(parent);
>
> -        assertTrue(SCXMLHelper.isDescendant(state, context));
> +        Assert.assertTrue(SCXMLHelper.isDescendant(state, context));
>       }
>
> +    @Test
>       public void testGetAncestorClosureEmptySet() {
>           Set<TransitionTarget> states = new HashSet<TransitionTarget>();
>
>           Set<TransitionTarget> returnValue = SCXMLHelper.getAncestorClosure(states, new HashSet<TransitionTarget>());
>
> -        assertEquals(0, returnValue.size());
> +        Assert.assertEquals(0, returnValue.size());
>       }
>
> +    @Test
>       public void testGetAncestorClosureUpperBoundNotNullAndContains() {
>           Set<TransitionTarget> states = new HashSet<TransitionTarget>();
>           TransitionTarget state = new State();
> @@ -98,10 +104,11 @@ public class SCXMLHelperTest extends Tes
>
>           Set<TransitionTarget> returnValue = SCXMLHelper.getAncestorClosure(states, upperBounds);
>
> -        assertEquals(1, returnValue.size());
> -        assertEquals("1", ((TransitionTarget)returnValue.toArray()[0]).getId());
> +        Assert.assertEquals(1, returnValue.size());
> +        Assert.assertEquals("1", ((TransitionTarget)returnValue.toArray()[0]).getId());
>       }
>
> +    @Test
>       public void testGetAncestorClosureContainsParent() {
>           Set<TransitionTarget> states = new HashSet<TransitionTarget>();
>           TransitionTarget state = new State();
> @@ -113,16 +120,18 @@ public class SCXMLHelperTest extends Tes
>
>           Set<TransitionTarget> returnValue = SCXMLHelper.getAncestorClosure(states, upperBounds);
>
> -        assertEquals(1, returnValue.size());
> -        assertEquals("1", ((TransitionTarget)returnValue.toArray()[0]).getId());
> +        Assert.assertEquals(1, returnValue.size());
> +        Assert.assertEquals("1", ((TransitionTarget)returnValue.toArray()[0]).getId());
>       }
>
> +    @Test
>       public void testIsLegalConfigNoStates() {
>           Set<TransitionTarget> states = new HashSet<TransitionTarget>();
>
> -        assertTrue(SCXMLHelper.isLegalConfig(states, new SimpleErrorReporter()));
> +        Assert.assertTrue(SCXMLHelper.isLegalConfig(states, new SimpleErrorReporter()));
>       }
>
> +    @Test
>       public void testIsLegalConfigInvalidParallel() {
>           Set<TransitionTarget> states = new HashSet<TransitionTarget>();
>           Parallel parallel = new Parallel();
> @@ -144,11 +153,12 @@ public class SCXMLHelperTest extends Tes
>
>           MockErrorReporter errorReporter = new MockErrorReporter();
>
> -        assertFalse(SCXMLHelper.isLegalConfig(states, errorReporter));
> -        assertEquals(ErrorConstants.ILLEGAL_CONFIG, errorReporter.getErrCode());
> -        assertEquals("Not all AND states active for parallel 4", errorReporter.getErrDetail());
> +        Assert.assertFalse(SCXMLHelper.isLegalConfig(states, errorReporter));
> +        Assert.assertEquals(ErrorConstants.ILLEGAL_CONFIG, errorReporter.getErrCode());
> +        Assert.assertEquals("Not all AND states active for parallel 4", errorReporter.getErrDetail());
>       }
>
> +    @Test
>       public void testIsLegalConfigMultipleTopLevel() {
>           Set<TransitionTarget> states = new HashSet<TransitionTarget>();
>
> @@ -162,11 +172,12 @@ public class SCXMLHelperTest extends Tes
>
>           MockErrorReporter errorReporter = new MockErrorReporter();
>
> -        assertTrue(SCXMLHelper.isLegalConfig(states, errorReporter));
> -        assertEquals(ErrorConstants.ILLEGAL_CONFIG, errorReporter.getErrCode());
> -        assertEquals("Multiple top-level OR states active!", errorReporter.getErrDetail());
> +        Assert.assertTrue(SCXMLHelper.isLegalConfig(states, errorReporter));
> +        Assert.assertEquals(ErrorConstants.ILLEGAL_CONFIG, errorReporter.getErrCode());
> +        Assert.assertEquals("Multiple top-level OR states active!", errorReporter.getErrDetail());
>       }
>
> +    @Test
>       public void testIsLegalConfigMultipleStatesActive() {
>           Set<TransitionTarget> states = new HashSet<TransitionTarget>();
>
> @@ -187,20 +198,22 @@ public class SCXMLHelperTest extends Tes
>
>           MockErrorReporter errorReporter = new MockErrorReporter();
>
> -        assertFalse(SCXMLHelper.isLegalConfig(states, errorReporter));
> -        assertEquals(ErrorConstants.ILLEGAL_CONFIG, errorReporter.getErrCode());
> -        assertEquals("Multiple OR states active for state parentid", errorReporter.getErrDetail());
> +        Assert.assertFalse(SCXMLHelper.isLegalConfig(states, errorReporter));
> +        Assert.assertEquals(ErrorConstants.ILLEGAL_CONFIG, errorReporter.getErrCode());
> +        Assert.assertEquals("Multiple OR states active for state parentid", errorReporter.getErrDetail());
>       }
>
> +    @Test
>       public void testGetLCASameTarget() {
>           TransitionTarget target = new State();
>           target.setId("1");
>
>           TransitionTarget returnValue = SCXMLHelper.getLCA(target, target);
>
> -        assertEquals("1", returnValue.getId());
> +        Assert.assertEquals("1", returnValue.getId());
>       }
>
> +    @Test
>       public void testGetLCAIsDescendant() {
>           TransitionTarget target = new State();
>           target.setId("1");
> @@ -212,9 +225,10 @@ public class SCXMLHelperTest extends Tes
>
>           TransitionTarget returnValue = SCXMLHelper.getLCA(target, parent);
>
> -        assertEquals("2", returnValue.getId());
> +        Assert.assertEquals("2", returnValue.getId());
>       }
>
> +    @Test
>       public void testGetLCAIsDescendantReverse() {
>           TransitionTarget target = new State();
>           target.setId("1");
> @@ -226,9 +240,10 @@ public class SCXMLHelperTest extends Tes
>
>           TransitionTarget returnValue = SCXMLHelper.getLCA(target, parent);
>
> -        assertEquals("1", returnValue.getId());
> +        Assert.assertEquals("1", returnValue.getId());
>       }
>
> +    @Test
>       public void testGetLCANull() {
>           TransitionTarget target = new State();
>           target.setId("1");
> @@ -238,9 +253,10 @@ public class SCXMLHelperTest extends Tes
>
>           TransitionTarget returnValue = SCXMLHelper.getLCA(target, notParent);
>
> -        assertNull(returnValue);
> +        Assert.assertNull(returnValue);
>       }
>
> +    @Test
>       public void testGetLCADistantAncestor() {
>           TransitionTarget target1 = new State();
>           target1.setId("1");
> @@ -256,6 +272,6 @@ public class SCXMLHelperTest extends Tes
>
>           TransitionTarget returnValue = SCXMLHelper.getLCA(target1, target2);
>
> -        assertEquals("3", returnValue.getId());
> +        Assert.assertEquals("3", returnValue.getId());
>       }
>   }
>
> Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCXMLTestHelper.java
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCXMLTestHelper.java?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCXMLTestHelper.java (original)
> +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/SCXMLTestHelper.java Wed Oct 16 03:46:58 2013
> @@ -30,7 +30,7 @@ import java.util.Set;
>
>   import javax.xml.parsers.DocumentBuilderFactory;
>
> -import junit.framework.Assert;
> +import org.junit.Assert;
>
>   import org.apache.commons.scxml2.env.SimpleDispatcher;
>   import org.apache.commons.scxml2.env.Tracer;
>
> Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/StatusTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/StatusTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/StatusTest.java (original)
> +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/StatusTest.java Wed Oct 16 03:46:58 2013
> @@ -16,31 +16,31 @@
>    */
>   package org.apache.commons.scxml2;
>
> -import junit.framework.TestCase;
>   import org.apache.commons.scxml2.model.State;
> +import org.junit.Assert;
> +import org.junit.Before;
> +import org.junit.Test;
>
> -public class StatusTest extends TestCase {
> -
> -    public StatusTest(String name) {
> -        super(name);
> -    }
> +public class StatusTest {
>
>       private Status status;
>
> -    @Override
> +    @Before
>       public void setUp() {
>           status = new Status();
>       }
>
> +    @Test
>       public void testIsFinalStateFalse() {
>           State state = new State();
>           state.setFinal(false);
>
>           status.getStates().add(state);
>
> -        assertFalse(status.isFinal());
> +        Assert.assertFalse(status.isFinal());
>       }
>
> +    @Test
>       public void testIsFinalStateHasParent() {
>           State state = new State();
>           state.setFinal(true);
> @@ -48,9 +48,10 @@ public class StatusTest extends TestCase
>
>           status.getStates().add(state);
>
> -        assertFalse(status.isFinal());
> +        Assert.assertFalse(status.isFinal());
>       }
>
> +    @Test
>       public void testIsFinalStateHasEvent() {
>           State state = new State();
>           state.setFinal(true);
> @@ -58,16 +59,17 @@ public class StatusTest extends TestCase
>           status.getStates().add(state);
>           status.getEvents().add(new TriggerEvent("name", TriggerEvent.CALL_EVENT));
>
> -        assertFalse(status.isFinal());
> +        Assert.assertFalse(status.isFinal());
>       }
>
> +    @Test
>       public void testIsFinalState() {
>           State state = new State();
>           state.setFinal(true);
>
>           status.getStates().add(state);
>
> -        assertTrue(status.isFinal());
> +        Assert.assertTrue(status.isFinal());
>       }
>
>   }
>
> Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/TieBreakerTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/TieBreakerTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/TieBreakerTest.java (original)
> +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/TieBreakerTest.java Wed Oct 16 03:46:58 2013
> @@ -19,8 +19,11 @@ package org.apache.commons.scxml2;
>   import java.net.URL;
>   import java.util.Set;
>
> -import junit.framework.TestCase;
>   import org.apache.commons.scxml2.model.TransitionTarget;
> +import org.junit.After;
> +import org.junit.Assert;
> +import org.junit.Before;
> +import org.junit.Test;
>   /**
>    * Unit tests for testing conflict resolution amongst multiple transitions
>    * within the {@link org.apache.commons.scxml2.SCXMLExecutor}'s default
> @@ -33,14 +36,7 @@ import org.apache.commons.scxml2.model.T
>    * transition exists at a particular point, and tie-breaking rules are used
>    * to make progress, rather than resulting in error conditions.
>    */
> -public class TieBreakerTest extends TestCase {
> -    /**
> -     * Construct a new instance of SCXMLExecutorTest with
> -     * the specified name
> -     */
> -    public TieBreakerTest(String name) {
> -        super(name);
> -    }
> +public class TieBreakerTest {
>
>       // Test data
>       private URL tiebreaker01, tiebreaker02, tiebreaker03, tiebreaker04,
> @@ -50,7 +46,7 @@ public class TieBreakerTest extends Test
>       /**
>        * Set up instance variables required by this test case.
>        */
> -    @Override
> +    @Before
>       public void setUp() {
>           tiebreaker01 = this.getClass().getClassLoader().
>               getResource("org/apache/commons/scxml2/tie-breaker-01.xml");
> @@ -69,7 +65,7 @@ public class TieBreakerTest extends Test
>       /**
>        * Tear down instance variables required by this test case.
>        */
> -    @Override
> +    @After
>       public void tearDown() {
>           tiebreaker01 = tiebreaker02 = tiebreaker03 = tiebreaker04 =
>               tiebreaker05 = tiebreaker06 = null;
> @@ -78,72 +74,78 @@ public class TieBreakerTest extends Test
>       /**
>        * Test the implementation
>        */
> +    @Test
>       public void testTieBreaker01() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(tiebreaker01);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(1, currentStates.size());
> -        assertEquals("ten", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("ten", currentStates.iterator().next().getId());
>           currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("twenty", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("twenty", currentStates.iterator().next().getId());
>       }
>
> +    @Test
>       public void testTieBreaker02() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(tiebreaker02);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(1, currentStates.size());
> -        assertEquals("eleven", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("eleven", currentStates.iterator().next().getId());
>           currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("thirty", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("thirty", currentStates.iterator().next().getId());
>       }
>
> +    @Test
>       public void testTieBreaker03() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(tiebreaker03);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(1, currentStates.size());
> -        assertEquals("eleven", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("eleven", currentStates.iterator().next().getId());
>           currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("forty", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("forty", currentStates.iterator().next().getId());
>       }
>
> +    @Test
>       public void testTieBreaker04() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(tiebreaker04);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "event_2");
> -        assertEquals(1, currentStates.size());
> +        Assert.assertEquals(1, currentStates.size());
>           currentStates = SCXMLTestHelper.fireEvent(exec, "event_1");
> -        assertEquals(1, currentStates.size());
> +        Assert.assertEquals(1, currentStates.size());
>       }
>
> +    @Test
>       public void testTieBreaker05() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(tiebreaker05);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(3, currentStates.size());
> +        Assert.assertEquals(3, currentStates.size());
>           for (TransitionTarget tt : currentStates) {
>               String id = tt.getId();
> -            assertTrue(id.equals("s11") || id.equals("s212")
> +            Assert.assertTrue(id.equals("s11") || id.equals("s212")
>                   || id.equals("s2111"));
>           }
>           currentStates = SCXMLTestHelper.fireEvent(exec, "event1");
> -        assertEquals(3, currentStates.size());
> +        Assert.assertEquals(3, currentStates.size());
>           for (TransitionTarget tt : currentStates) {
>               String id = tt.getId();
> -            assertTrue(id.equals("s12") || id.equals("s212")
> +            Assert.assertTrue(id.equals("s12") || id.equals("s212")
>                   || id.equals("s2112"));
>           }
>       }
>
> +    @Test
>       public void testTieBreaker06() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(SCXMLTestHelper.parse(tiebreaker06));
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(1, currentStates.size());
> +        Assert.assertEquals(1, currentStates.size());
>       }
>   }
>
>
> Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/TriggerEventTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/TriggerEventTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/TriggerEventTest.java (original)
> +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/TriggerEventTest.java Wed Oct 16 03:46:58 2013
> @@ -16,21 +16,18 @@
>    */
>   package org.apache.commons.scxml2;
>
> -import java.util.Map;
>   import java.util.HashMap;
> +import java.util.Map;
>
> -import junit.framework.TestCase;
> +import org.junit.After;
> +import org.junit.Assert;
> +import org.junit.Before;
> +import org.junit.Test;
>
>   /**
>    * Unit tests {@link org.apache.commons.scxml2.TriggerEvent}.
>    */
> -public class TriggerEventTest extends TestCase {
> -    /**
> -     * Construct a new instance of TriggerEventTest with the specified name
> -     */
> -    public TriggerEventTest(String name) {
> -        super(name);
> -    }
> +public class TriggerEventTest {
>
>       // Test data
>       private Map<String, String> payloadData;
> @@ -40,7 +37,7 @@ public class TriggerEventTest extends Te
>       /**
>        * Set up instance variables required by this test case.
>        */
> -    @Override
> +    @Before
>       public void setUp() {
>           payloadData = new HashMap<String, String>();
>           payloadData.put("property1", "value1");
> @@ -58,7 +55,7 @@ public class TriggerEventTest extends Te
>       /**
>        * Tear down instance variables required by this test case.
>        */
> -    @Override
> +    @After
>       public void tearDown() {
>           payloadData.clear();
>           payloadData = null;
> @@ -69,30 +66,34 @@ public class TriggerEventTest extends Te
>       /**
>        * Test the implementation
>        */
> +    @Test
>       public void testTriggerEventGetters() {
> -        assertEquals(te1.getName(), "name1");
> -        assertEquals(te2.getType(), 2);
> -        assertNull(te7.getPayload());
> +        Assert.assertEquals(te1.getName(), "name1");
> +        Assert.assertEquals(te2.getType(), 2);
> +        Assert.assertNull(te7.getPayload());
>       }
>
> +    @Test
>       public void testTriggerEventEquals() {
> -        assertTrue(te1.equals(te2));
> -        assertTrue(te3.equals(te4));
> -        assertTrue(te5.equals(te6));
> -        assertFalse(te1.equals(te4));
> -        assertFalse(te7.equals(null));
> +        Assert.assertTrue(te1.equals(te2));
> +        Assert.assertTrue(te3.equals(te4));
> +        Assert.assertTrue(te5.equals(te6));
> +        Assert.assertFalse(te1.equals(te4));
> +        Assert.assertFalse(te7.equals(null));
>       }
>
> +    @Test
>       public void testTriggerEventToString() {
> -        assertEquals("TriggerEvent{name=name3,type=4}", te7.toString());
> -        assertEquals("TriggerEvent{name=name1,type=2,payload="
> +        Assert.assertEquals("TriggerEvent{name=name3,type=4}", te7.toString());
> +        Assert.assertEquals("TriggerEvent{name=name1,type=2,payload="
>               + "{property1=value1}}", te2.toString());
>       }
>
> +    @Test
>       public void testTriggerEventHashCode() {
> -        assertEquals("TriggerEvent{name=name3,type=4}".hashCode(),
> +        Assert.assertEquals("TriggerEvent{name=name3,type=4}".hashCode(),
>               te7.hashCode());
> -        assertEquals("TriggerEvent{name=name3,type=3}".hashCode(),
> +        Assert.assertEquals("TriggerEvent{name=name3,type=3}".hashCode(),
>               te5.hashCode());
>       }
>   }
>
> Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/WildcardTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/WildcardTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/WildcardTest.java (original)
> +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/WildcardTest.java Wed Oct 16 03:46:58 2013
> @@ -19,20 +19,16 @@ package org.apache.commons.scxml2;
>   import java.net.URL;
>   import java.util.Set;
>
> -import junit.framework.TestCase;
>   import org.apache.commons.scxml2.model.TransitionTarget;
> +import org.junit.After;
> +import org.junit.Assert;
> +import org.junit.Before;
> +import org.junit.Test;
>   /**
>    * Unit tests {@link org.apache.commons.scxml2.SCXMLExecutor}.
>    * Testing wildcard event matching (*)
>    */
> -public class WildcardTest extends TestCase {
> -    /**
> -     * Construct a new instance of SCXMLExecutorTest with
> -     * the specified name
> -     */
> -    public WildcardTest(String name) {
> -        super(name);
> -    }
> +public class WildcardTest {
>
>       // Test data
>       private URL wildcard01, wildcard02;
> @@ -41,7 +37,7 @@ public class WildcardTest extends TestCa
>       /**
>        * Set up instance variables required by this test case.
>        */
> -    @Override
> +    @Before
>       public void setUp() {
>           wildcard01 = this.getClass().getClassLoader().
>               getResource("org/apache/commons/scxml2/env/jexl/wildcard-01.xml");
> @@ -52,7 +48,7 @@ public class WildcardTest extends TestCa
>       /**
>        * Tear down instance variables required by this test case.
>        */
> -    @Override
> +    @After
>       public void tearDown() {
>           wildcard01 = wildcard02 = null;
>       }
> @@ -60,23 +56,25 @@ public class WildcardTest extends TestCa
>       /**
>        * Test the SCXML documents, usage of "_eventdata"
>        */
> +    @Test
>       public void testWildcard01Sample() throws Exception {
>       	exec = SCXMLTestHelper.getExecutor(wildcard01);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state1", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state1", currentStates.iterator().next().getId());
>           exec = SCXMLTestHelper.testExecutorSerializability(exec);
>           currentStates = SCXMLTestHelper.fireEvent(exec, "foo.bar.baz");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state4", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state4", currentStates.iterator().next().getId());
>       }
>
> +    @Test
>       public void testWildcard02Sample() throws Exception {
>           exec = SCXMLTestHelper.getExecutor(SCXMLTestHelper.parse(wildcard02));
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state2", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state2", currentStates.iterator().next().getId());
>       }
>   }
>
> Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/WizardsTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/WizardsTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/WizardsTest.java (original)
> +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/WizardsTest.java Wed Oct 16 03:46:58 2013
> @@ -22,24 +22,20 @@ import java.util.List;
>   import java.util.Map;
>   import java.util.Set;
>
> -import junit.framework.TestCase;
>   import org.apache.commons.scxml2.env.Tracer;
>   import org.apache.commons.scxml2.env.jexl.JexlContext;
>   import org.apache.commons.scxml2.env.jexl.JexlEvaluator;
>   import org.apache.commons.scxml2.model.SCXML;
>   import org.apache.commons.scxml2.model.TransitionTarget;
> +import org.junit.After;
> +import org.junit.Assert;
> +import org.junit.Before;
> +import org.junit.Test;
>   import org.w3c.dom.Node;
>   /**
>    * Unit tests {@link org.apache.commons.scxml2.SCXMLExecutor}.
>    */
> -public class WizardsTest extends TestCase {
> -    /**
> -     * Construct a new instance of SCXMLExecutorTest with
> -     * the specified name
> -     */
> -    public WizardsTest(String name) {
> -        super(name);
> -    }
> +public class WizardsTest {
>
>       // Test data
>       private URL wizard01, wizard02;
> @@ -48,7 +44,7 @@ public class WizardsTest extends TestCas
>       /**
>        * Set up instance variables required by this test case.
>        */
> -    @Override
> +    @Before
>       public void setUp() {
>           wizard01 = this.getClass().getClassLoader().
>               getResource("org/apache/commons/scxml2/env/jexl/wizard-01.xml");
> @@ -59,7 +55,7 @@ public class WizardsTest extends TestCas
>       /**
>        * Tear down instance variables required by this test case.
>        */
> -    @Override
> +    @After
>       public void tearDown() {
>           wizard01 = wizard02 = null;
>       }
> @@ -67,43 +63,45 @@ public class WizardsTest extends TestCas
>       /**
>        * Test the wizard style SCXML documents, and send usage
>        */
> +    @Test
>       public void testWizard01Sample() throws Exception {
>       	exec = SCXMLTestHelper.getExecutor(wizard01);
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state1", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state1", currentStates.iterator().next().getId());
>           exec = SCXMLTestHelper.testExecutorSerializability(exec);
>           currentStates = SCXMLTestHelper.fireEvent(exec, "event2");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state2", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state2", currentStates.iterator().next().getId());
>           currentStates = SCXMLTestHelper.fireEvent(exec, "event4");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state4", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state4", currentStates.iterator().next().getId());
>           currentStates = SCXMLTestHelper.fireEvent(exec, "event3");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state3", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state3", currentStates.iterator().next().getId());
>           exec = SCXMLTestHelper.testExecutorSerializability(exec);
>           currentStates = SCXMLTestHelper.fireEvent(exec, "event3"); // ensure we stay put
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state3", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state3", currentStates.iterator().next().getId());
>       }
>
> +    @Test
>       public void testWizard02Sample() throws Exception {
>           SCXML scxml = SCXMLTestHelper.parse(wizard02);
>           exec = SCXMLTestHelper.getExecutor(new JexlContext(),
>               new JexlEvaluator(), scxml, new TestEventDispatcher(),
>               new Tracer());
> -        assertNotNull(exec);
> +        Assert.assertNotNull(exec);
>           // If you change this, you must also change
>           // the TestEventDispatcher
>           Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state2", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state2", currentStates.iterator().next().getId());
>           exec = SCXMLTestHelper.testExecutorSerializability(exec);
>           currentStates = SCXMLTestHelper.fireEvent(exec, "event4");
> -        assertEquals(1, currentStates.size());
> -        assertEquals("state4", currentStates.iterator().next().getId());
> +        Assert.assertEquals(1, currentStates.size());
> +        Assert.assertEquals("state4", currentStates.iterator().next().getId());
>       }
>
>       static class TestEventDispatcher implements EventDispatcher, Serializable {
> @@ -116,20 +114,20 @@ public class WizardsTest extends TestCas
>               int i = ((Integer) params.get("aValue")).intValue();
>               switch (callback) {
>                   case 0:
> -                    assertTrue(i == 2); // state2
> +                    Assert.assertTrue(i == 2); // state2
>                       callback++;
>                       break;
>                   case 1:
> -                    assertTrue(i == 4); // state4
> +                    Assert.assertTrue(i == 4); // state4
>                       callback++;
>                       break;
>                   default:
> -                    fail("More than 2 TestEventDispatcher <send> callbacks");
> +                    Assert.fail("More than 2 TestEventDispatcher <send> callbacks");
>               }
>           }
>           public void cancel(String sendId) {
>               // should never be called
> -            fail("<cancel> TestEventDispatcher callback unexpected");
> +            Assert.fail("<cancel> TestEventDispatcher callback unexpected");
>           }
>       }
>   }
>
> Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/AbstractSCXMLListenerTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/AbstractSCXMLListenerTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/AbstractSCXMLListenerTest.java (original)
> +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/AbstractSCXMLListenerTest.java Wed Oct 16 03:46:58 2013
> @@ -16,23 +16,19 @@
>    */
>   package org.apache.commons.scxml2.env;
>
> -import junit.framework.TestCase;
> -
>   import org.apache.commons.scxml2.SCXMLListener;
>   import org.apache.commons.scxml2.model.State;
>   import org.apache.commons.scxml2.model.Transition;
>   import org.apache.commons.scxml2.model.TransitionTarget;
> +import org.junit.After;
> +import org.junit.Assert;
> +import org.junit.Before;
> +import org.junit.Test;
>
>   /**
>    * Unit tests {@link org.apache.commons.scxml2.env.AbstractSCXMLListener}.
>    */
> -public class AbstractSCXMLListenerTest extends TestCase {
> -    /**
> -     * Construct a new instance of AbstractSCXMLListenerTest with the specified name
> -     */
> -    public AbstractSCXMLListenerTest(String name) {
> -        super(name);
> -    }
> +public class AbstractSCXMLListenerTest {
>
>       // Test data
>       private TransitionTarget to;
> @@ -45,7 +41,7 @@ public class AbstractSCXMLListenerTest e
>       /**
>        * Set up instance variables required by this test case.
>        */
> -    @Override
> +    @Before
>       public void setUp() {
>           to = new State();
>           from = new State();
> @@ -58,13 +54,14 @@ public class AbstractSCXMLListenerTest e
>       /**
>        * Tear down instance variables required by this test case.
>        */
> -    @Override
> +    @After
>       public void tearDown() {
>           to = null;
>           from = null;
>           transition = null;
>       }
>
> +    @Test
>       public void testAbstractSCXMLListener0() {
>           SCXMLListener listener0 = new AbstractSCXMLListener() {
>                   /**
> @@ -93,17 +90,18 @@ public class AbstractSCXMLListenerTest e
>                   }
>               };
>
> -        assertFalse("heardOnEntry == false", heardOnEntry);
> -        assertFalse("heardOnExit == false", heardOnExit);
> -        assertFalse("heardOnTransition == false", heardOnTransition);
> +        Assert.assertFalse("heardOnEntry == false", heardOnEntry);
> +        Assert.assertFalse("heardOnExit == false", heardOnExit);
> +        Assert.assertFalse("heardOnTransition == false", heardOnTransition);
>           listener0.onEntry(to);
>           listener0.onExit(to);
>           listener0.onTransition(from, to, transition);
> -        assertTrue("heardOnEntry", heardOnEntry);
> -        assertTrue("heardOnExit", heardOnExit);
> -        assertTrue("heardOnExit", heardOnTransition);
> +        Assert.assertTrue("heardOnEntry", heardOnEntry);
> +        Assert.assertTrue("heardOnExit", heardOnExit);
> +        Assert.assertTrue("heardOnExit", heardOnTransition);
>       }
>
> +    @Test
>       public void testAbstractSCXMLListener1() {
>           SCXMLListener listener1 = new AbstractSCXMLListener() {
>                   /**
> @@ -123,17 +121,18 @@ public class AbstractSCXMLListenerTest e
>                   }
>               };
>
> -        assertFalse("heardOnEntry == false", heardOnEntry);
> -        assertFalse("heardOnExit == false", heardOnExit);
> -        assertFalse("heardOnTransition == false", heardOnTransition);
> +        Assert.assertFalse("heardOnEntry == false", heardOnEntry);
> +        Assert.assertFalse("heardOnExit == false", heardOnExit);
> +        Assert.assertFalse("heardOnTransition == false", heardOnTransition);
>           listener1.onEntry(to);
>           listener1.onExit(to);
>           listener1.onTransition(from, to, transition);
> -        assertTrue("heardOnEntry", heardOnEntry);
> -        assertTrue("heardOnExit", heardOnExit);
> -        assertFalse("heardOnTransition == false", heardOnTransition);
> +        Assert.assertTrue("heardOnEntry", heardOnEntry);
> +        Assert.assertTrue("heardOnExit", heardOnExit);
> +        Assert.assertFalse("heardOnTransition == false", heardOnTransition);
>       }
>
> +    @Test
>       public void testAbstractSCXMLListener2() {
>           SCXMLListener listener2 = new AbstractSCXMLListener() {
>                   /**
> @@ -145,30 +144,31 @@ public class AbstractSCXMLListenerTest e
>                   }
>               };
>
> -        assertFalse("heardOnEntry == false", heardOnEntry);
> -        assertFalse("heardOnExit == false", heardOnExit);
> -        assertFalse("heardOnTransition == false", heardOnTransition);
> +            Assert.assertFalse("heardOnEntry == false", heardOnEntry);
> +            Assert.assertFalse("heardOnExit == false", heardOnExit);
> +            Assert.assertFalse("heardOnTransition == false", heardOnTransition);
>           listener2.onEntry(to);
>           listener2.onExit(to);
>           listener2.onTransition(from, to, transition);
> -        assertTrue("heardOnEntry", heardOnEntry);
> -        assertFalse("heardOnExit == false", heardOnExit);
> -        assertFalse("heardOnTransition == false", heardOnTransition);
> +        Assert.assertTrue("heardOnEntry", heardOnEntry);
> +        Assert.assertFalse("heardOnExit == false", heardOnExit);
> +        Assert.assertFalse("heardOnTransition == false", heardOnTransition);
>       }
>
> +    @Test
>       public void testAbstractSCXMLListener3() {
>           SCXMLListener listener3 = new AbstractSCXMLListener() {
>                   // empty
>               };
>
> -        assertFalse("heardOnEntry == false", heardOnEntry);
> -        assertFalse("heardOnExit == false", heardOnExit);
> -        assertFalse("heardOnTransition == false", heardOnTransition);
> +            Assert.assertFalse("heardOnEntry == false", heardOnEntry);
> +            Assert.assertFalse("heardOnExit == false", heardOnExit);
> +            Assert.assertFalse("heardOnTransition == false", heardOnTransition);
>           listener3.onEntry(to);
>           listener3.onExit(to);
>           listener3.onTransition(from, to, transition);
> -        assertFalse("heardOnEntry == false", heardOnEntry);
> -        assertFalse("heardOnExit == false", heardOnExit);
> -        assertFalse("heardOnTransition == false", heardOnTransition);
> +        Assert.assertFalse("heardOnEntry == false", heardOnEntry);
> +        Assert.assertFalse("heardOnExit == false", heardOnExit);
> +        Assert.assertFalse("heardOnTransition == false", heardOnTransition);
>       }
>   }
>
> Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/AbstractStateMachineTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/AbstractStateMachineTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/AbstractStateMachineTest.java (original)
> +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/AbstractStateMachineTest.java Wed Oct 16 03:46:58 2013
> @@ -18,20 +18,15 @@ package org.apache.commons.scxml2.env;
>
>   import java.net.URL;
>
> -import junit.framework.TestCase;
> +import org.junit.Assert;
> +import org.junit.Test;
>
>   /**
>    * Unit tests {@link org.apache.commons.scxml2.env.AbstractStateMachine}.
>    */
> -public class AbstractStateMachineTest extends TestCase {
> -
> -    /**
> -     * Construct a new instance of AbstractStateMachineTest with the specified name
> -     */
> -    public AbstractStateMachineTest(String name) {
> -        super(name);
> -    }
> +public class AbstractStateMachineTest {
>
> +    @Test
>       public void testMoreThanOneScxmlDocument() throws Exception {
>           URL fooScxmlDocument = getClass().getResource("foo.xml");
>           URL barScxmlDocument = getClass().getResource("bar.xml");
> @@ -39,8 +34,8 @@ public class AbstractStateMachineTest ex
>           Foo f = new Foo(fooScxmlDocument);
>           Bar b = new Bar(barScxmlDocument);
>
> -        assertTrue(f.fooCalled());
> -        assertTrue(b.barCalled());
> +        Assert.assertTrue(f.fooCalled());
> +        Assert.assertTrue(b.barCalled());
>       }
>
>       private class Foo extends AbstractStateMachine {
>
> Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/LogUtilsTest.java
> URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/LogUtilsTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
> ==============================================================================
> --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/LogUtilsTest.java (original)
> +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/LogUtilsTest.java Wed Oct 16 03:46:58 2013
> @@ -16,25 +16,23 @@
>    */
>   package org.apache.commons.scxml2.env;
>
> -import junit.framework.TestCase;
> -
>   import org.apache.commons.scxml2.model.State;
>   import org.apache.commons.scxml2.model.Transition;
>   import org.apache.commons.scxml2.model.TransitionTarget;
> +import org.junit.Assert;
> +import org.junit.Test;
>
> -public class LogUtilsTest extends TestCase {
> -
> -    public LogUtilsTest(String testName) {
> -        super(testName);
> -    }
> +public class LogUtilsTest {
>
> +    @Test
>       public void testGetTTPathParentNull() {
>           TransitionTarget target = new State();
>           target.setId("ID");
>
> -        assertEquals("/ID", LogUtils.getTTPath(target));
> +        Assert.assertEquals("/ID", LogUtils.getTTPath(target));
>       }
>
> +    @Test
>       public void testGetTTPathParent() {
>           TransitionTarget target = new State();
>           target.setId("ID");
> @@ -48,9 +46,10 @@ public class LogUtilsTest extends TestCa
>           parent1.setParent(parent2);
>           target.setParent(parent1);
>
> -        assertEquals("/parent2/parent1/ID", LogUtils.getTTPath(target));
> +        Assert.assertEquals("/parent2/parent1/ID", LogUtils.getTTPath(target));
>       }
>
> +    @Test
>       public void testTransToString() {
>           TransitionTarget targetTo = new State();
>           targetTo.setId("TO");
> @@ -62,7 +61,7 @@ public class LogUtilsTest extends TestCa
>           transition.setCond("condition");
>           transition.setEvent("event happened");
>
> -        assertEquals( "transition (event = event happened, cond = condition, from = /FROM, to = /TO)",
> +        Assert.assertEquals( "transition (event = event happened, cond = condition, from = /FROM, to = /TO)",
>                                           LogUtils.transToString(targetFrom, targetTo, transition));
>       }
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message