commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject svn commit: r1532637 [4/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 03:46:59 GMT
Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/DatamodelTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/DatamodelTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/DatamodelTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/DatamodelTest.java Wed Oct 16 03:46:58 2013
@@ -21,7 +21,6 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 
-import junit.framework.TestCase;
 import org.apache.commons.scxml2.SCXMLExecutor;
 import org.apache.commons.scxml2.SCXMLTestHelper;
 import org.apache.commons.scxml2.TriggerEvent;
@@ -29,17 +28,14 @@ import org.apache.commons.scxml2.env.jex
 import org.apache.commons.scxml2.env.jexl.JexlEvaluator;
 import org.apache.commons.scxml2.env.jsp.ELContext;
 import org.apache.commons.scxml2.env.jsp.ELEvaluator;
+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 DatamodelTest extends TestCase {
-    /**
-     * Construct a new instance of SCXMLExecutorTest with
-     * the specified name
-     */
-    public DatamodelTest(String name) {
-        super(name);
-    }
+public class DatamodelTest {
 
     // Test data
     private URL datamodel01jexl, datamodel02jexl, datamodel04jexl, datamodel05jexl, datamodel01jsp, datamodel02jsp;
@@ -48,7 +44,7 @@ public class DatamodelTest extends TestC
     /**
      * Set up instance variables required by this test case.
      */
-    @Override
+    @Before
     public void setUp() {
         datamodel01jexl = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/env/jexl/datamodel-01.xml");
@@ -67,71 +63,76 @@ public class DatamodelTest extends TestC
     /**
      * Tear down instance variables required by this test case.
      */
-    @Override
+    @After
     public void tearDown() {
         datamodel01jexl = datamodel02jexl = datamodel04jexl = datamodel05jexl = datamodel01jsp = datamodel02jsp = null;
     }
 
     /**
      * Test the stateless model, simultaneous executions
-     */
+     */    
+    @Test
     public void testDatamodelSimultaneousJexl() throws Exception {
         exec01 = SCXMLTestHelper.getExecutor(datamodel01jexl,
             new JexlContext(), new JexlEvaluator());
-        assertNotNull(exec01);
+        Assert.assertNotNull(exec01);
         exec02 = SCXMLTestHelper.getExecutor(datamodel01jexl,
             new JexlContext(), new JexlEvaluator());
-        assertNotNull(exec02);
-        assertFalse(exec01 == exec02);
+        Assert.assertNotNull(exec02);
+        Assert.assertFalse(exec01 == exec02);
         runtest();
     }
-
+    
+    @Test
     public void testDatamodelSimultaneousJsp() throws Exception {
         exec01 = SCXMLTestHelper.getExecutor(datamodel01jsp,
             new ELContext(), new ELEvaluator());
-        assertNotNull(exec01);
+        Assert.assertNotNull(exec01);
         exec02 = SCXMLTestHelper.getExecutor(datamodel01jsp,
             new ELContext(), new ELEvaluator());
-        assertNotNull(exec02);
-        assertFalse(exec01 == exec02);
+        Assert.assertNotNull(exec02);
+        Assert.assertFalse(exec01 == exec02);
         runtest();
     }
-
+    
+    @Test
     public void testDatamodelNamespacePrefixedXPaths() throws Exception {
         exec01 = SCXMLTestHelper.getExecutor(datamodel02jexl,
             new JexlContext(), new JexlEvaluator());
-        assertNotNull(exec01);
+        Assert.assertNotNull(exec01);
         exec02 = SCXMLTestHelper.getExecutor(datamodel02jsp,
             new ELContext(), new ELEvaluator());
-        assertNotNull(exec02);
-        assertFalse(exec01 == exec02);
+        Assert.assertNotNull(exec02);
+        Assert.assertFalse(exec01 == exec02);
         runtest();
     }
-
+    
+    @Test
     public void testDatamodel04Jexl() throws Exception {
         exec01 = SCXMLTestHelper.getExecutor(datamodel04jexl,
             new JexlContext(), new JexlEvaluator());
-        assertNotNull(exec01);
+        Assert.assertNotNull(exec01);
         Set<TransitionTarget> currentStates = exec01.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("ten", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("ten", currentStates.iterator().next().getId());
         Map<String, Object> payload = new HashMap<String, Object>();
         payload.put("one", "1");
         payload.put("two", "2");
         TriggerEvent te = new TriggerEvent("ten.done", TriggerEvent.SIGNAL_EVENT, payload);
         SCXMLTestHelper.fireEvent(exec01, te);
         currentStates = exec01.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("twenty", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("twenty", currentStates.iterator().next().getId());
         SCXMLTestHelper.fireEvent(exec01, "twenty.done");
         currentStates = exec01.getCurrentStatus().getStates();
-        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 testDatamodel05Jexl() throws Exception {
         exec01 = SCXMLTestHelper.getExecutor(datamodel05jexl);
-        assertNotNull(exec01);
+        Assert.assertNotNull(exec01);
         SCXMLTestHelper.assertState(exec01, "end");
     }
 
@@ -139,36 +140,36 @@ public class DatamodelTest extends TestC
         //// Interleaved
         // exec01
         Set<TransitionTarget> currentStates = exec01.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("ten", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("ten", currentStates.iterator().next().getId());
         exec01 = SCXMLTestHelper.testExecutorSerializability(exec01);
         currentStates = fireEvent("ten.done", exec01);
-        assertEquals(1, currentStates.size());
-        assertEquals("twenty", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("twenty", currentStates.iterator().next().getId());
         // exec02
         currentStates = exec02.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("ten", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("ten", currentStates.iterator().next().getId());
         // exec01
         currentStates = fireEvent("twenty.done", exec01);
-        assertEquals(1, currentStates.size());
-        assertEquals("thirty", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("thirty", currentStates.iterator().next().getId());
         exec01 = SCXMLTestHelper.testExecutorSerializability(exec01);
         // exec02
         currentStates = fireEvent("ten.done", exec02);
-        assertEquals(1, currentStates.size());
-        assertEquals("twenty", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("twenty", currentStates.iterator().next().getId());
         exec02 = SCXMLTestHelper.testExecutorSerializability(exec02);
         currentStates = fireEvent("twenty.done", exec02);
-        assertEquals(1, currentStates.size());
-        assertEquals("thirty", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("thirty", currentStates.iterator().next().getId());
         currentStates = fireEvent("thirty.done", exec02);
-        assertEquals(1, currentStates.size());
-        assertEquals("forty", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("forty", currentStates.iterator().next().getId());
         // exec01
         currentStates = fireEvent("thirty.done", exec01);
-        assertEquals(1, currentStates.size());
-        assertEquals("forty", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("forty", currentStates.iterator().next().getId());
     }
 
     private Set<TransitionTarget> fireEvent(String name, SCXMLExecutor exec) throws Exception {

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/HistoryTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/HistoryTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/HistoryTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/HistoryTest.java Wed Oct 16 03:46:58 2013
@@ -19,18 +19,14 @@ package org.apache.commons.scxml2.model;
 import java.net.URL;
 import java.util.Set;
 
-import junit.framework.TestCase;
 import org.apache.commons.scxml2.SCXMLExecutor;
 import org.apache.commons.scxml2.SCXMLTestHelper;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
-public class HistoryTest extends TestCase {
-    /**
-     * Construct a new instance of HistoryTest with
-     * the specified name
-     */
-    public HistoryTest(String testName) {
-        super(testName);
-    }
+public class HistoryTest {
 
     // Test data
     private History history;
@@ -40,7 +36,7 @@ public class HistoryTest extends TestCas
     /**
      * Set up instance variables required by this test case.
      */   
-    @Override
+    @Before
     public void setUp() {
         history = new History();
         shallow01 = this.getClass().getClassLoader().
@@ -56,7 +52,7 @@ public class HistoryTest extends TestCas
     /**
      * Tear down instance variables required by this test case.
      */
-    @Override
+    @After
     public void tearDown() {
         history = null;
         shallow01 = deep01 = defaults01 = parallel01 = null;
@@ -65,46 +61,52 @@ public class HistoryTest extends TestCas
 
     /**
      * Test the implementation
-     */
+     */    
+    @Test
     public void testSetTypeDeep() {
         history.setType("deep");
         
-        assertTrue(history.isDeep());
+        Assert.assertTrue(history.isDeep());
     }
-    
+        
+    @Test
     public void testSetTypeNotDeep() {
         history.setType("shallow");
         
-        assertFalse(history.isDeep());
+        Assert.assertFalse(history.isDeep());
     }
-
+    
+    @Test
     public void testShallowHistory01() throws Exception {
         exec = SCXMLTestHelper.getExecutor(shallow01);
         runHistoryFlow();
     }
-
+    
+    @Test
     public void testDeepHistory01() throws Exception {
         exec = SCXMLTestHelper.getExecutor(deep01);
         runHistoryFlow();
     }
-
+    
+    @Test
     public void testHistoryDefaults01() throws Exception {
         exec = SCXMLTestHelper.getExecutor(defaults01);
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("state11", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("state11", currentStates.iterator().next().getId());
         currentStates = SCXMLTestHelper.fireEvent(exec, "state.next");
-        assertEquals(1, currentStates.size());
-        assertEquals("state211", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("state211", currentStates.iterator().next().getId());
         currentStates = SCXMLTestHelper.fireEvent(exec, "state.next");
-        assertEquals(1, currentStates.size());
-        assertEquals("state31", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("state31", currentStates.iterator().next().getId());
     }
-
+    
+    @Test
     public void testHistoryParallel01() throws Exception {
         exec = SCXMLTestHelper.getExecutor(parallel01);
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
+        Assert.assertEquals(1, currentStates.size());
         SCXMLTestHelper.assertState(exec, "off_call");
         SCXMLTestHelper.assertPostTriggerStates(exec, "dial", new String[] { "talking", "on_call" });
         SCXMLTestHelper.assertPostTriggerStates(exec, "consult", new String[] { "consult_talking", "on_consult" });
@@ -119,36 +121,36 @@ public class HistoryTest extends TestCas
 
     private void runHistoryFlow() throws Exception {
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("phase1", currentStates.iterator().next().getId());
-        assertEquals("phase1", pauseAndResume());
-        assertEquals("phase2", nextPhase());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("phase1", currentStates.iterator().next().getId());
+        Assert.assertEquals("phase1", pauseAndResume());
+        Assert.assertEquals("phase2", nextPhase());
         // pause and resume couple of times for good measure
-        assertEquals("phase2", pauseAndResume());
-        assertEquals("phase2", pauseAndResume());
-        assertEquals("phase3", nextPhase());
-        assertEquals("phase3", pauseAndResume());
+        Assert.assertEquals("phase2", pauseAndResume());
+        Assert.assertEquals("phase2", pauseAndResume());
+        Assert.assertEquals("phase3", nextPhase());
+        Assert.assertEquals("phase3", pauseAndResume());
         exec.reset();
         currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("phase1", ((State)currentStates.iterator().
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("phase1", ((State)currentStates.iterator().
             next()).getId());
     }
 
     private String pauseAndResume() throws Exception {
         Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "flow.pause");
-        assertEquals(1, currentStates.size());
-        assertEquals("interrupted", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("interrupted", currentStates.iterator().next().getId());
         exec = SCXMLTestHelper.testExecutorSerializability(exec);
         currentStates = SCXMLTestHelper.fireEvent(exec, "flow.resume");
-        assertEquals(1, currentStates.size());
+        Assert.assertEquals(1, currentStates.size());
         exec = SCXMLTestHelper.testExecutorSerializability(exec);
         return ((State)currentStates.iterator().next()).getId();
     }
 
     private String nextPhase() throws Exception {
         Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "phase.done");
-        assertEquals(1, currentStates.size());
+        Assert.assertEquals(1, currentStates.size());
         return ((State)currentStates.iterator().next()).getId();
     }
 

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ParallelTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ParallelTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ParallelTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ParallelTest.java Wed Oct 16 03:46:58 2013
@@ -20,23 +20,22 @@ import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
 
-import junit.framework.TestCase;
 import org.apache.commons.scxml2.Builtin;
 import org.apache.commons.scxml2.SCXMLExecutor;
 import org.apache.commons.scxml2.SCXMLTestHelper;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 import org.w3c.dom.Node;
 
-public class ParallelTest extends TestCase {
-
-    public ParallelTest(String testName) {
-        super(testName);
-    }
+public class ParallelTest {
 
     // Test data
     private URL parallel01, parallel02, parallel03;
     private SCXMLExecutor exec;
     
-    @Override
+    @Before
     public void setUp() {
         parallel01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/model/parallel-01.xml");
@@ -46,40 +45,43 @@ public class ParallelTest extends TestCa
             getResource("org/apache/commons/scxml2/model/parallel-03.xml");
     }
 
-    @Override
+    @After
     public void tearDown() {
         parallel01 = parallel02 = parallel03 = null;
         exec = null;
     }
-
+    
+    @Test
     public void testParallel01() throws Exception {
         exec = SCXMLTestHelper.getExecutor(parallel01);
-        assertNotNull(exec);
+        Assert.assertNotNull(exec);
         SCXMLTestHelper.assertPostTriggerState(exec, "foo", "end");
     }
-
+    
+    @Test
     public void testParallel02() throws Exception {
         exec = SCXMLTestHelper.getExecutor(parallel02);
-        assertNotNull(exec);
+        Assert.assertNotNull(exec);
         SCXMLTestHelper.assertPostTriggerStates(exec, "dummy.event", new String[] { "state01", "state02" });
         SCXMLTestHelper.assertPostTriggerState(exec, "event1", "state1");
     }
-
+    
+    @Test
     public void testParallel03() throws Exception {
         exec = SCXMLTestHelper.getExecutor(parallel03);
-        assertNotNull(exec);
+        Assert.assertNotNull(exec);
         SCXMLTestHelper.assertPostTriggerStates(exec, "dummy.event", new String[] { "para11", "para21" });
         Node data = (Node) exec.getRootContext().get("root");
         Map<String, String> namespaces = new HashMap<String, String>();
         namespaces.put("", "http://www.w3.org/2005/07/scxml");
         Object count = Builtin.data(namespaces, data, "root/count");
-        assertEquals("5.0", count.toString());
+        Assert.assertEquals("5.0", count.toString());
         SCXMLTestHelper.assertPostTriggerStates(exec, "foo", new String[] { "para12", "para21" });
         count = Builtin.data(namespaces, data, "root/count");
-        assertEquals("7.0", count.toString());
+        Assert.assertEquals("7.0", count.toString());
         SCXMLTestHelper.assertPostTriggerState(exec, "bar", "end");
         count = Builtin.data(namespaces, data, "root/count");
-        assertEquals("14.0", count.toString());
+        Assert.assertEquals("14.0", count.toString());
     }
 
 }

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/PathTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/PathTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/PathTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/PathTest.java Wed Oct 16 03:46:58 2013
@@ -16,26 +16,26 @@
  */
 package org.apache.commons.scxml2.model;
 
-import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Test;
 
-public class PathTest extends TestCase {
-
-    public PathTest(String testName) {
-        super(testName);
-    }
+public class PathTest {
 
+    @Test
     public void testConstructorNull() {
         Path path = new Path(null, null);
         
-        assertNull(path.getPathScope());
+        Assert.assertNull(path.getPathScope());
     }
-
+    
+    @Test
     public void testConstructorNullState() {
         Path path = new Path(new State(), null);
         
-        assertTrue(path.getPathScope() instanceof State);
+        Assert.assertTrue(path.getPathScope() instanceof State);
     }
-
+    
+    @Test
     public void testConstructorStates() {
         TransitionTarget source = new State();
         source.setId("1");
@@ -45,16 +45,17 @@ public class PathTest extends TestCase {
         
         Path path = new Path(source, target);
         
-        assertNull(path.getPathScope());
-        assertEquals(1, path.getUpwardSegment().size());
-        assertEquals("1", ((State)path.getUpwardSegment().get(0)).getId());
+        Assert.assertNull(path.getPathScope());
+        Assert.assertEquals(1, path.getUpwardSegment().size());
+        Assert.assertEquals("1", ((State)path.getUpwardSegment().get(0)).getId());
 
-        assertEquals(1, path.getDownwardSegment().size());
-        assertEquals("2", ((State)path.getDownwardSegment().get(0)).getId());
+        Assert.assertEquals(1, path.getDownwardSegment().size());
+        Assert.assertEquals("2", ((State)path.getDownwardSegment().get(0)).getId());
         
-        assertFalse(path.isCrossRegion());
+        Assert.assertFalse(path.isCrossRegion());
     }
     
+    @Test
     public void testConstructorSourceCrossRegion() {
         Parallel region = new Parallel();
         
@@ -67,9 +68,10 @@ public class PathTest extends TestCase {
         
         Path path = new Path(source, target);
         
-        assertTrue(path.isCrossRegion());
+        Assert.assertTrue(path.isCrossRegion());
     }
-
+    
+    @Test
     public void testConstructorTargetCrossRegion() {
         Parallel region = new Parallel();
         
@@ -82,9 +84,10 @@ public class PathTest extends TestCase {
         
         Path path = new Path(source, target);
         
-        assertTrue(path.isCrossRegion());
+        Assert.assertTrue(path.isCrossRegion());
     }
-
+    
+    @Test
     public void testConstructorParentTarget() {
         TransitionTarget source = new State();
         source.setId("1");
@@ -96,9 +99,10 @@ public class PathTest extends TestCase {
 
         Path path = new Path(source, target);
 
-        assertNull(path.getPathScope());
+        Assert.assertNull(path.getPathScope());
     }
-
+    
+    @Test
     public void testConstructorParentSource() {
         TransitionTarget source = new State();
         source.setId("1");
@@ -110,9 +114,10 @@ public class PathTest extends TestCase {
 
         Path path = new Path(source, target);
 
-        assertNull(path.getPathScope());
+        Assert.assertNull(path.getPathScope());
     }
     
+    @Test
     public void testConstructorParent() {
         TransitionTarget source = new State();
         source.setId("1");
@@ -128,9 +133,10 @@ public class PathTest extends TestCase {
 
         Path path = new Path(source, target);
 
-        assertEquals("parentid", path.getPathScope().getId());
+        Assert.assertEquals("parentid", path.getPathScope().getId());
     }
     
+    @Test
     public void testConstructorParentParallel() {
         TransitionTarget source = new State();
         source.setId("1");
@@ -146,9 +152,10 @@ public class PathTest extends TestCase {
 
         Path path = new Path(source, target);
 
-        assertEquals("parentid", path.getPathScope().getId());
+        Assert.assertEquals("parentid", path.getPathScope().getId());
     }
     
+    @Test
     public void testConstructorParentParallelParent() {
         TransitionTarget source = new State();
         source.setId("1");
@@ -169,15 +176,17 @@ public class PathTest extends TestCase {
 
         Path path = new Path(source, target);
 
-        assertEquals("parentid", path.getPathScope().getId());
+        Assert.assertEquals("parentid", path.getPathScope().getId());
     }
     
+    @Test
     public void testGetRegionsExitedNull() {
         Path path = new Path(new State(), null);
 
-        assertEquals(0, path.getRegionsExited().size());
+        Assert.assertEquals(0, path.getRegionsExited().size());
     }
     
+    @Test
     public void testGetRegionsExitedNotRegion() {
         TransitionTarget source = new State();
         source.setId("1");
@@ -187,9 +196,10 @@ public class PathTest extends TestCase {
         
         Path path = new Path(source, target);
 
-        assertEquals(0, path.getRegionsExited().size());
+        Assert.assertEquals(0, path.getRegionsExited().size());
     }
     
+    @Test
     public void testGetRegionsExitedParallel() {
         TransitionTarget source = new Parallel();
         source.setId("1");
@@ -199,9 +209,10 @@ public class PathTest extends TestCase {
         
         Path path = new Path(source, target);
 
-        assertEquals(0, path.getRegionsExited().size());
+        Assert.assertEquals(0, path.getRegionsExited().size());
     }
     
+    @Test
     public void testGetRegionsExited() {
         Parallel region = new Parallel();
         
@@ -214,16 +225,18 @@ public class PathTest extends TestCase {
         
         Path path = new Path(source, target);
         
-        assertEquals(1, path.getRegionsExited().size());
-        assertEquals("1", (path.getRegionsExited().get(0)).getId());
+        Assert.assertEquals(1, path.getRegionsExited().size());
+        Assert.assertEquals("1", (path.getRegionsExited().get(0)).getId());
     }
-
+    
+    @Test
     public void testGetRegionsEnteredNull() {
         Path path = new Path(new State(), null);
 
-        assertEquals(0, path.getRegionsEntered().size());
+        Assert.assertEquals(0, path.getRegionsEntered().size());
     }
     
+    @Test
     public void testGetRegionsEnteredNotRegion() {
         TransitionTarget source = new State();
         source.setId("1");
@@ -233,9 +246,10 @@ public class PathTest extends TestCase {
         
         Path path = new Path(source, target);
 
-        assertEquals(0, path.getRegionsEntered().size());
+        Assert.assertEquals(0, path.getRegionsEntered().size());
     }
     
+    @Test
     public void testGetRegionsEnteredParallel() {
         TransitionTarget source = new Parallel();
         source.setId("1");
@@ -245,9 +259,10 @@ public class PathTest extends TestCase {
         
         Path path = new Path(source, target);
 
-        assertEquals(0, path.getRegionsEntered().size());
+        Assert.assertEquals(0, path.getRegionsEntered().size());
     }
     
+    @Test
     public void testGetRegionsEntered() {
         Parallel region = new Parallel();
         
@@ -260,8 +275,8 @@ public class PathTest extends TestCase {
         
         Path path = new Path(source, target);
         
-        assertEquals(1, path.getRegionsEntered().size());
-        assertEquals("2", (path.getRegionsEntered().get(0)).getId());
+        Assert.assertEquals(1, path.getRegionsEntered().size());
+        Assert.assertEquals("2", (path.getRegionsEntered().get(0)).getId());
     }
 
 }

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ScriptTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ScriptTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ScriptTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ScriptTest.java Wed Oct 16 03:46:58 2013
@@ -19,23 +19,22 @@ package org.apache.commons.scxml2.model;
 import java.net.URL;
 import java.util.Set;
 
-import junit.framework.TestCase;
 import org.apache.commons.scxml2.SCXMLExecutor;
 import org.apache.commons.scxml2.SCXMLTestHelper;
 import org.apache.commons.scxml2.env.javascript.JSEvaluator;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
-public class ScriptTest extends TestCase {
+public class ScriptTest {
 
     private URL script01jexl, script01js;
-    
-    public ScriptTest(String testName) {
-        super(testName);
-    }
 
     /**
      * Set up instance variables required by this test case.
      */
-    @Override
+    @Before
     public void setUp() {
         script01jexl = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/env/jexl/script-01.xml");
@@ -46,26 +45,28 @@ public class ScriptTest extends TestCase
     /**
      * Tear down instance variables required by this test case.
      */
-    @Override
+    @After
     public void tearDown() {
         script01jexl = script01js = null;
     }
 
     /**
      * Test JEXL script execution.
-     */
+     */    
+    @Test
     public void testJexlScriptExecution() throws Exception {
         SCXMLExecutor exec = SCXMLTestHelper.getExecutor(script01jexl);
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("end", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("end", currentStates.iterator().next().getId());
     }
-
+    
+    @Test
     public void testJavaScriptExecution() throws Exception {
         SCXMLExecutor exec = SCXMLTestHelper.getExecutor(script01js, new JSEvaluator());
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("end", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("end", currentStates.iterator().next().getId());
     }
 
 }

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/StateTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/StateTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/StateTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/StateTest.java Wed Oct 16 03:46:58 2013
@@ -21,44 +21,45 @@ import java.util.List;
 
 import org.apache.commons.scxml2.SCXMLExecutor;
 import org.apache.commons.scxml2.SCXMLTestHelper;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
-import junit.framework.TestCase;
-
-public class StateTest extends TestCase {
-
-    public StateTest(String testName) {
-        super(testName);
-    }
+public class StateTest {
 
     // Test data
     private State state;
     private URL state01;
     private SCXMLExecutor exec;
 
-    @Override
+    @Before
     public void setUp() {
         state = new State();
         state01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/model/state-01.xml");
     }
 
-    @Override
+    @After
     public void tearDown() {
         state01 = null;
         exec = null;
     }
-
+    
+    @Test
     public void testGetTransitionsListNull() {
-        assertNull(state.getTransitionsList("event"));
+        Assert.assertNull(state.getTransitionsList("event"));
     }
-    
+        
+    @Test
     public void testGetTransitionsList() {
         
         state.getTransitionsList().add(new Transition());
         
-        assertNotNull(state.getTransitionsList(null));
+        Assert.assertNotNull(state.getTransitionsList(null));
     }
-    
+        
+    @Test
     public void testAddTransitionDoesNotContainKey() {
         Transition transition = new Transition();
         transition.setEvent("event");
@@ -67,10 +68,11 @@ public class StateTest extends TestCase 
         
         List<Transition> events = state.getTransitionsList("event");
         
-        assertEquals(1, events.size());
-        assertEquals("event", events.get(0).getEvent());
+        Assert.assertEquals(1, events.size());
+        Assert.assertEquals("event", events.get(0).getEvent());
     }
-    
+        
+    @Test
     public void testAddTransitionContainKey() {
         Transition transition1 = new Transition();
         transition1.setEvent("event");
@@ -83,9 +85,10 @@ public class StateTest extends TestCase 
         
         List<Transition> events = state.getTransitionsList("event");
         
-        assertEquals(2, events.size());
+        Assert.assertEquals(2, events.size());
     }
-    
+        
+    @Test
     public void testGetTransitionList() {
         Transition transition1 = new Transition();
         transition1.setEvent("event");
@@ -98,25 +101,29 @@ public class StateTest extends TestCase 
         
         List<Transition> events = state.getTransitionsList();
         
-        assertEquals(2, events.size());
+        Assert.assertEquals(2, events.size());
     }
-    
+        
+    @Test
     public void testHasHistoryEmpty() {
-        assertFalse(state.hasHistory());
+        Assert.assertFalse(state.hasHistory());
     }
-
+    
+    @Test
     public void testHasHistory() {
         History history = new History();
         
         state.addHistory(history);
         
-        assertTrue(state.hasHistory());
+        Assert.assertTrue(state.hasHistory());
     }
-    
+        
+    @Test
     public void testIsSimple() {
-        assertTrue(state.isSimple());
+        Assert.assertTrue(state.isSimple());
     }
-    
+        
+    @Test
     public void testIsSimpleHasChildren() {
         State state1 = new State();
         
@@ -124,21 +131,24 @@ public class StateTest extends TestCase 
         // could be removed in v1.0
         state.addChild(state1);
         
-        assertFalse(state.isSimple());
+        Assert.assertFalse(state.isSimple());
     }
-    
+        
+    @Test
     public void testIsCompositeFalse() {
-        assertFalse(state.isComposite());
+        Assert.assertFalse(state.isComposite());
     }
-    
+        
+    @Test
     public void testIsCompositeParallel() {
         State child = new State();
         
         state.addChild(child);
         
-        assertTrue(state.isComposite());
+        Assert.assertTrue(state.isComposite());
     }
-    
+        
+    @Test
     public void testIsCompositeHasChildren() {
         State state1 = new State();
         
@@ -146,27 +156,30 @@ public class StateTest extends TestCase 
         // could be removed in v1.0
         state.addChild(state1);
         
-        assertTrue(state.isComposite());
+        Assert.assertTrue(state.isComposite());
     }
-    
+        
+    @Test
     public void testIsRegion() {
         state.setParent(new Parallel());
         
-        assertTrue(state.isRegion());
+        Assert.assertTrue(state.isRegion());
     }
-    
+        
+    @Test
     public void testIsRegionNotParallel() {
         state.setParent(new State());
         
-        assertFalse(state.isRegion());
+        Assert.assertFalse(state.isRegion());
     }
-
+    
+    @Test
     public void testInitialAttribute() throws Exception {
         SCXML scxml = SCXMLTestHelper.parse(state01);
-        assertNotNull(scxml);
+        Assert.assertNotNull(scxml);
         exec = SCXMLTestHelper.getExecutor(scxml);
-        assertNotNull(exec);
-        assertEquals("s11", exec.getCurrentStatus().getStates().iterator().next().getId());
+        Assert.assertNotNull(exec);
+        Assert.assertEquals("s11", exec.getCurrentStatus().getStates().iterator().next().getId());
     }
 
 }

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/StatelessModelTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/StatelessModelTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/StatelessModelTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/StatelessModelTest.java Wed Oct 16 03:46:58 2013
@@ -20,24 +20,20 @@ import java.net.URL;
 import java.util.Iterator;
 import java.util.Set;
 
-import junit.framework.TestCase;
 import org.apache.commons.scxml2.SCXMLExecutor;
 import org.apache.commons.scxml2.SCXMLTestHelper;
 import org.apache.commons.scxml2.TriggerEvent;
 import org.apache.commons.scxml2.env.SimpleSCXMLListener;
 import org.apache.commons.scxml2.env.jsp.ELContext;
 import org.apache.commons.scxml2.env.jsp.ELEvaluator;
+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 StatelessModelTest extends TestCase {
-    /**
-     * Construct a new instance of SCXMLExecutorTest with
-     * the specified name
-     */
-    public StatelessModelTest(String name) {
-        super(name);
-    }
+public class StatelessModelTest {
 
     // Test data
     private URL stateless01jexl, stateless01jsp, stateless01par;
@@ -47,7 +43,7 @@ public class StatelessModelTest extends 
     /**
      * Set up instance variables required by this test case.
      */
-    @Override
+    @Before
     public void setUp() throws Exception {
         stateless01jexl = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/env/jexl/stateless-01.xml");
@@ -64,73 +60,78 @@ public class StatelessModelTest extends 
     /**
      * Tear down instance variables required by this test case.
      */
-    @Override
+    @After
     public void tearDown() {
         stateless01jexl = null;
     }
 
     /**
      * Test the stateless model, simultaneous executions, JEXL expressions
-     */
+     */    
+    @Test
     public void testStatelessModelSimultaneousJexl() throws Exception {
     	// parse once, use many times
         exec01 = SCXMLTestHelper.getExecutor(scxml01jexl);
-        assertNotNull(exec01);
+        Assert.assertNotNull(exec01);
         exec02 = SCXMLTestHelper.getExecutor(scxml01jexl);
-        assertNotNull(exec02);
-        assertFalse(exec01 == exec02);
+        Assert.assertNotNull(exec02);
+        Assert.assertFalse(exec01 == exec02);
         runSimultaneousTest();
     }
 
     /**
      * Test the stateless model, sequential executions, JEXL expressions
-     */
+     */    
+    @Test
     public void testStatelessModelSequentialJexl() throws Exception {
         // rinse and repeat
         for (int i = 0; i < 3; i++) {
             exec01 = SCXMLTestHelper.getExecutor(scxml01jexl);
-            assertNotNull(exec01);
+            Assert.assertNotNull(exec01);
             runSequentialTest();
         }
     }
 
     /**
      * Test the stateless model, simultaneous executions, EL expressions
-     */
+     */    
+    @Test
     public void testStatelessModelSimultaneousEl() throws Exception {
     	// parse once, use many times
         exec01 = SCXMLTestHelper.getExecutor(scxml01jsp,
             new ELContext(), new ELEvaluator());
-        assertNotNull(exec01);
+        Assert.assertNotNull(exec01);
         exec02 = SCXMLTestHelper.getExecutor(scxml01jsp,
             new ELContext(), new ELEvaluator());
-        assertNotNull(exec02);
-        assertFalse(exec01 == exec02);
+        Assert.assertNotNull(exec02);
+        Assert.assertFalse(exec01 == exec02);
         runSimultaneousTest();
     }
 
     /**
      * Test the stateless model, sequential executions, EL expressions
-     */
+     */    
+    @Test
     public void testStatelessModelSequentialEl() throws Exception {
         // rinse and repeat
         for (int i = 0; i < 3; i++) {
             exec01 = SCXMLTestHelper.getExecutor(scxml01jsp,
                 new ELContext(), new ELEvaluator());
-            assertNotNull(exec01);
+            Assert.assertNotNull(exec01);
             runSequentialTest();
         }
     }
 
     /**
      * Test sharing a single SCXML object between two executors
-     */
+     */    
+    @Test
     public void testStatelessModelParallelSharedSCXML() throws Exception {
         exec01 = SCXMLTestHelper.getExecutor(scxml01par);
-        assertNotNull(exec01);
+        Assert.assertNotNull(exec01);
         exec02 = SCXMLTestHelper.getExecutor(scxml01par);
-        assertNotNull(exec02);
-        assertFalse(exec01 == exec02);
+        Assert.assertNotNull(exec02);
+        Assert.assertFalse(exec01 == exec02);
 
         Set<TransitionTarget> currentStates = exec01.getCurrentStatus().getStates();
         checkParallelStates(currentStates, "state1.init", "state2.init", "exec01");
@@ -153,11 +154,12 @@ public class StatelessModelTest extends 
 
     /**
      * Test sharing two SCXML objects between one executor (not recommended)
-     */
+     */    
+    @Test
     public void testStatelessModelParallelSwapSCXML() throws Exception {
         exec01 = SCXMLTestHelper.getExecutor(scxml01par);
-        assertNotNull(exec01);
-        assertTrue(scxml01par != scxml02par);
+        Assert.assertNotNull(exec01);
+        Assert.assertTrue(scxml01par != scxml02par);
 
         Set<TransitionTarget> currentStates = exec01.getCurrentStatus().getStates();
         checkParallelStates(currentStates, "state1.init", "state2.init", "exec01");
@@ -174,22 +176,22 @@ public class StatelessModelTest extends 
     private void checkParallelStates(Set<TransitionTarget> currentStates,
             String s1, String s2, String label) {
         Iterator<TransitionTarget> i = currentStates.iterator();
-        assertTrue("Not enough states", i.hasNext());
+        Assert.assertTrue("Not enough states", i.hasNext());
         String cs1 = i.next().getId();
         String cs2 = null;
         if (s2 != null) {
-            assertTrue("Not enough states, found one state: " + cs1, i.hasNext());
+            Assert.assertTrue("Not enough states, found one state: " + cs1, i.hasNext());
             cs2 = i.next().getId();
-            assertFalse("Too many states", i.hasNext());
+            Assert.assertFalse("Too many states", i.hasNext());
             if (s2.equals(cs2)) {
                 cs2 = null;
             } else if (s1.equals(cs2)) {
                 cs2 = null;
             } else {
-                fail(label + " in unexpected state " + cs2);
+                Assert.fail(label + " in unexpected state " + cs2);
             }
         } else {
-            assertFalse("Too many states", i.hasNext());
+            Assert.assertFalse("Too many states", i.hasNext());
         }
         if (s1 != null && s1.equals(cs1)) {
             return;
@@ -197,47 +199,47 @@ public class StatelessModelTest extends 
         if (s2 != null && s2.equals(cs1)) {
             return;
         }
-        fail(label + " in unexpected state " + cs1);
+        Assert.fail(label + " in unexpected state " + cs1);
     }
 
     private void runSimultaneousTest() throws Exception {
         //// Interleaved
         // exec01
         Set<TransitionTarget> currentStates = exec01.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 = fireEvent("ten.done", exec01);
-        assertEquals(1, currentStates.size());
-        assertEquals("twenty", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("twenty", currentStates.iterator().next().getId());
         // exec02
         currentStates = exec02.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("ten", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("ten", currentStates.iterator().next().getId());
         // exec01
         currentStates = fireEvent("twenty.done", exec01);
-        assertEquals(1, currentStates.size());
-        assertEquals("thirty", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("thirty", currentStates.iterator().next().getId());
         // exec02
         currentStates = fireEvent("ten.done", exec02);
-        assertEquals(1, currentStates.size());
-        assertEquals("twenty", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("twenty", currentStates.iterator().next().getId());
         currentStates = fireEvent("twenty.done", exec02);
-        assertEquals(1, currentStates.size());
-        assertEquals("thirty", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("thirty", currentStates.iterator().next().getId());
     }
 
     private void runSequentialTest() throws Exception {
         Set<TransitionTarget> currentStates = exec01.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("ten", ((State)currentStates.iterator().
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("ten", ((State)currentStates.iterator().
             next()).getId());
         currentStates = fireEvent("ten.done", exec01);
-        assertEquals(1, currentStates.size());
-        assertEquals("twenty", ((State)currentStates.iterator().
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("twenty", ((State)currentStates.iterator().
             next()).getId());
         currentStates = fireEvent("twenty.done", exec01);
-        assertEquals(1, currentStates.size());
-        assertEquals("thirty", ((State)currentStates.iterator().
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("thirty", ((State)currentStates.iterator().
             next()).getId());
     }
 

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/TransitionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/TransitionTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/TransitionTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/TransitionTest.java Wed Oct 16 03:46:58 2013
@@ -16,44 +16,46 @@
  */
 package org.apache.commons.scxml2.model;
 
-import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
-public class TransitionTest extends TestCase {
-
-    public TransitionTest(String testName) {
-        super(testName);
-    }
+public class TransitionTest {
 
     private Transition transition;
     
-    @Override
+    @Before
     public void setUp() {
         transition = new Transition();
     }
-    
+        
+    @Test
     public void testGetRuntimeTargetNullNoParent() {
-        assertTrue(transition.getRuntimeTargets().size() > 0);
+        Assert.assertTrue(transition.getRuntimeTargets().size() > 0);
     }
-    
+        
+    @Test
     public void testGetRuntimeTargetNullWithParent() {
         State state = new State();
         state.setId("1");
         
         transition.setParent(state);
         
-        assertEquals("1", (transition.getRuntimeTargets().get(0)).getId());
+        Assert.assertEquals("1", (transition.getRuntimeTargets().get(0)).getId());
     }
-    
+        
+    @Test
     public void testGetRuntimeTarget() {
         State state = new State();
         state.setId("2");
         
         transition.getTargets().add(state);
         
-        assertEquals("2", (transition.getRuntimeTargets().get(0)).getId());
+        Assert.assertEquals("2", (transition.getRuntimeTargets().get(0)).getId());
     }
-    
+        
+    @Test
     public void testGetPath() {
-        assertTrue(transition.getPaths().size() > 0);
+        Assert.assertTrue(transition.getPaths().size() > 0);
     }
 }

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/semantics/TransitionTargetComparatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/semantics/TransitionTargetComparatorTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/semantics/TransitionTargetComparatorTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/semantics/TransitionTargetComparatorTest.java Wed Oct 16 03:46:58 2013
@@ -18,48 +18,50 @@ package org.apache.commons.scxml2.semant
 
 import java.util.Comparator;
 
-import junit.framework.TestCase;
 import org.apache.commons.scxml2.model.Parallel;
 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;
 
-public class TransitionTargetComparatorTest extends TestCase {
-
-    public TransitionTargetComparatorTest(String testName) {
-        super(testName);
-    }
+public class TransitionTargetComparatorTest {
 
     private Comparator<TransitionTarget> comparator;
     
-    @Override
+    @Before
     public void setUp() {
         comparator = new TransitionTargetComparator<TransitionTarget>();
     }
-    
+        
+    @Test
     public void testComparatorEquals() {
         TransitionTarget target = new State();
         
-        assertEquals(0, comparator.compare(target, target));
+        Assert.assertEquals(0, comparator.compare(target, target));
     }
-    
+        
+    @Test
     public void testComparatorNegative() {
         TransitionTarget target1 = new State();
         TransitionTarget target2 = new State();
         
         target1.setParent(target2);
         
-        assertEquals(-1, comparator.compare(target1, target2));
+        Assert.assertEquals(-1, comparator.compare(target1, target2));
     }
-    
+        
+    @Test
     public void testComparatorPositive() {
         TransitionTarget target1 = new State();
         TransitionTarget target2 = new State();
         
         target2.setParent(target1);
         
-        assertEquals(1, comparator.compare(target1, target2));
+        Assert.assertEquals(1, comparator.compare(target1, target2));
     }
-    
+        
+    @Test
     public void testComparatorFirstMoreParents() {
         TransitionTarget target1 = new State();
         TransitionTarget parent1 = new State();
@@ -73,9 +75,10 @@ public class TransitionTargetComparatorT
         
         target2.setParent(parent3);
         
-        assertEquals(-1, comparator.compare(target1, target2));
+        Assert.assertEquals(-1, comparator.compare(target1, target2));
     }
-    
+        
+    @Test
     public void testComparatorSecondMoreParents() {
         TransitionTarget target1 = new State();
         TransitionTarget parent1 = new State();
@@ -89,9 +92,10 @@ public class TransitionTargetComparatorT
         
         target2.setParent(parent3);
         
-        assertEquals(1, comparator.compare(target2, target1)); // reversed
+        Assert.assertEquals(1, comparator.compare(target2, target1)); // reversed
     }
-    
+        
+    @Test
     public void testComparatorSameParent() {
         State target1 = new State();
         Parallel parent = new Parallel();
@@ -102,6 +106,6 @@ public class TransitionTargetComparatorT
         target2.setParent(parent);
         parent.addChild(target2);
         
-        assertEquals(1, comparator.compare(target1, target2));
+        Assert.assertEquals(1, comparator.compare(target1, target2));
     }
 }



Mime
View raw message