commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject svn commit: r1532637 [3/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/env/jsp/RootContextTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/jsp/RootContextTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/jsp/RootContextTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/jsp/RootContextTest.java Wed Oct 16 03:46:58 2013
@@ -18,24 +18,19 @@ package org.apache.commons.scxml2.env.js
 
 import java.net.URL;
 
-import javax.servlet.jsp.JspContext;
-
-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;
+
+import javax.servlet.jsp.JspContext;
 
 /**
  * Unit tests {@link org.apache.commons.scxml2.env.jsp.RootContext}.
  */
-public class RootContextTest extends TestCase {
-    /**
-     * Construct a new instance of ActionsTest with
-     * the specified name
-     */
-    public RootContextTest(String name) {
-        super(name);
-    }
+public class RootContextTest {
 
     // Test data
     private URL rootCtxSample;
@@ -47,7 +42,7 @@ public class RootContextTest extends Tes
     /**
      * Set up instance variables required by this test case.
      */
-    @Override
+    @Before
     public void setUp() {
         rootCtxSample = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/env/jsp/jsp-rootctx-test.xml");
@@ -60,7 +55,7 @@ public class RootContextTest extends Tes
     /**
      * Tear down instance variables required by this test case.
      */
-    @Override
+    @After
     public void tearDown() {
         rootCtxSample = null;
         evaluator = null;
@@ -71,21 +66,22 @@ public class RootContextTest extends Tes
 
     /**
      * Test the implementation
-     */
+     */    
+    @Test
     public void testRootContext() throws Exception {
-        assertEquals("1", String.valueOf(rootCtx.get("foo")));
+        Assert.assertEquals("1", String.valueOf(rootCtx.get("foo")));
         exec = SCXMLTestHelper.getExecutor(rootCtxSample, rootCtx, evaluator);
-        assertEquals("1", String.valueOf(jspCtx.getAttribute("foo")));
-        assertEquals("2", String.valueOf(rootCtx.get("foo")));
-        assertNull(jspCtx.getAttribute("bar"));
+        Assert.assertEquals("1", String.valueOf(jspCtx.getAttribute("foo")));
+        Assert.assertEquals("2", String.valueOf(rootCtx.get("foo")));
+        Assert.assertNull(jspCtx.getAttribute("bar"));
         ELContext ctx = (ELContext) SCXMLTestHelper.lookupContext(exec,
             "rootCtxTest");
-        assertNotNull(ctx);
-        assertNotNull(ctx.get("bar"));
-        assertNull(jspCtx.getVariableResolver().resolveVariable("bar"));
-        assertNotNull(ctx.resolveVariable("bar"));
-        assertEquals(ctx.resolveVariable("bar"), "a brand new value");
-        assertNotNull(ctx.getVars());
+        Assert.assertNotNull(ctx);
+        Assert.assertNotNull(ctx.get("bar"));
+        Assert.assertNull(jspCtx.getVariableResolver().resolveVariable("bar"));
+        Assert.assertNotNull(ctx.resolveVariable("bar"));
+        Assert.assertEquals(ctx.resolveVariable("bar"), "a brand new value");
+        Assert.assertNotNull(ctx.getVars());
     }
 }
 

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/rhino/RhinoContextTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/rhino/RhinoContextTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/rhino/RhinoContextTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/rhino/RhinoContextTest.java Wed Oct 16 03:46:58 2013
@@ -19,47 +19,29 @@ package org.apache.commons.scxml2.env.rh
 import java.util.HashMap;
 import java.util.Map;
 
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
 import org.apache.commons.scxml2.Context;
 import org.apache.commons.scxml2.Evaluator;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 import org.mozilla.javascript.Script;
 import org.mozilla.javascript.Scriptable;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
 /**
  * Tests for class {@link RhinoContext}.
  */
-public class RhinoContextTest extends TestCase {
-
-    /**
-     * Constructs a test case with the given name.
-     *
-     * @param name
-     *            The name of the test case.
-     */
-    public RhinoContextTest(String name) {
-        super(name);
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
+public class RhinoContextTest {
 
     /**
      * @throws Exception
-     */
+     */    
+    @Test
     public void testSetStringValue() throws Exception {
         Context context = new RhinoContext();
         context.set("myVar", "stringValue");
@@ -70,7 +52,8 @@ public class RhinoContextTest extends Te
 
     /**
      * @throws Exception
-     */
+     */    
+    @Test
     public void testSetIntValue() throws Exception {
         Context context = new RhinoContext();
         context.set("myVar", new Integer(27));
@@ -81,7 +64,8 @@ public class RhinoContextTest extends Te
 
     /**
      * @throws Exception
-     */
+     */    
+    @Test
     public void testSetXMLValue() throws Exception {
         Context context = new RhinoContext();
         String xmlString = "<foo><bar>bar</bar></foo>";
@@ -92,7 +76,8 @@ public class RhinoContextTest extends Te
 
     /**
      * @throws Exception
-     */
+     */    
+    @Test
     public void testSetMapValueWithStringEntry() throws Exception {
         Context context = new RhinoContext();
         Map<String, String> map = new HashMap<String, String>();
@@ -105,7 +90,8 @@ public class RhinoContextTest extends Te
 
     /**
      * @throws Exception
-     */
+     */    
+    @Test
     public void testSetMapValueWithMapEntry() throws Exception {
         Context context = new RhinoContext();
         Map<String, Map<String, String>> map1 = new HashMap<String, Map<String, String>>();
@@ -122,7 +108,8 @@ public class RhinoContextTest extends Te
 
     /**
      * @throws Exception
-     */
+     */    
+    @Test
     public void testSetMapValueWithXMLStringEntry() throws Exception {
         RhinoContext context = new RhinoContext();
         Map<String, String> map = new HashMap<String, String>();
@@ -141,7 +128,8 @@ public class RhinoContextTest extends Te
 
     /**
      * @throws Exception
-     */
+     */    
+    @Test
     public void testCompileStringWithNodeValue() throws Exception {
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         DocumentBuilder builder = factory.newDocumentBuilder();
@@ -164,7 +152,8 @@ public class RhinoContextTest extends Te
         Assert.assertTrue( returnValue instanceof String);
         Assert.assertEquals("blub", returnValue);
     }
-
+    
+    @Test
     public void testSetLocalWithMap() throws Exception {
         Evaluator evaluator = new RhinoEvaluator();
         Context ctx = evaluator.newContext(null);
@@ -173,13 +162,14 @@ public class RhinoContextTest extends Te
         m.put("data", new Integer(4711));
         ctx.setLocal("_event", m);
         Object eventname = evaluator.eval(ctx, "_event.name");
-        assertTrue(eventname instanceof String);
-        assertEquals("theEventName", eventname);
+        Assert.assertTrue(eventname instanceof String);
+        Assert.assertEquals("theEventName", eventname);
         Object evateData = evaluator.eval(ctx, "_event.data");
-        assertTrue(evateData instanceof Integer);
-        assertEquals(new Integer(4711), evateData);
+        Assert.assertTrue(evateData instanceof Integer);
+        Assert.assertEquals(new Integer(4711), evateData);
     }
-
+    
+    @Test
     public void testSetLocalWithMapInMap() throws Exception {
         Evaluator evaluator = new RhinoEvaluator();
         Context ctx = evaluator.newContext(null);
@@ -190,12 +180,13 @@ public class RhinoContextTest extends Te
         m1.put("data", m2);
         ctx.setLocal("_event", m1);
         Object eventname = evaluator.eval(ctx, "_event.name");
-        assertTrue(eventname instanceof String);
-        assertEquals("theEventName", eventname);
+        Assert.assertTrue(eventname instanceof String);
+        Assert.assertEquals("theEventName", eventname);
         Object foo = evaluator.eval(ctx, "_event.data.foo");
-        assertEquals("bar", foo);
+        Assert.assertEquals("bar", foo);
     }
-
+    
+    @Test
     public void testSetLocalWithNullValue() throws Exception {
         Context context = new RhinoContext();
         context.set("myVar", "stringValue");

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/rhino/RhinoEvaluatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/rhino/RhinoEvaluatorTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/rhino/RhinoEvaluatorTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/rhino/RhinoEvaluatorTest.java Wed Oct 16 03:46:58 2013
@@ -16,35 +16,33 @@
  */
 package org.apache.commons.scxml2.env.rhino;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.scxml2.Context;
 import org.apache.commons.scxml2.Evaluator;
 import org.apache.commons.scxml2.SCXMLExpressionException;
+import org.junit.Assert;
+import org.junit.Test;
 
-public class RhinoEvaluatorTest extends TestCase {
+public class RhinoEvaluatorTest {
 
     private String BAD_EXPRESSION = ">";
     private Context ctx = new RhinoContext();
 
-    public RhinoEvaluatorTest(String testName) {
-        super(testName);
-    }
-
+    @Test
     public void testPristine() throws SCXMLExpressionException {
         Evaluator eval = new RhinoEvaluator();
-        assertNotNull(eval);
-        assertTrue(eval.evalCond(ctx, "1+1 == 2").booleanValue());
+        Assert.assertNotNull(eval);
+        Assert.assertTrue(eval.evalCond(ctx, "1+1 == 2").booleanValue());
     }
-
+    
+    @Test
     public void testErrorMessage() {
         Evaluator eval = new RhinoEvaluator();
-        assertNotNull(eval);
+        Assert.assertNotNull(eval);
         try {
             eval.eval(ctx, BAD_EXPRESSION);
-            fail("RhinoEvaluator should throw SCXMLExpressionException");
+            Assert.fail("RhinoEvaluator should throw SCXMLExpressionException");
         } catch (SCXMLExpressionException e) {
-            assertTrue("RhinoEvaluator: Incorrect error message",
+            Assert.assertTrue("RhinoEvaluator: Incorrect error message",
                 e.getMessage().startsWith("eval('" + BAD_EXPRESSION + "'):"));
         }
     }

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/rhino/RhinoExampleTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/rhino/RhinoExampleTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/rhino/RhinoExampleTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/rhino/RhinoExampleTest.java Wed Oct 16 03:46:58 2013
@@ -19,42 +19,40 @@ package org.apache.commons.scxml2.env.rh
 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.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;
 
-public class RhinoExampleTest extends TestCase {
-
-    public RhinoExampleTest(String name) {
-        super(name);
-    }
+public class RhinoExampleTest {
 
     // Test data
     private URL example01;
     private SCXMLExecutor exec;
 
-    @Override
-    protected void setUp() throws Exception {
+    @Before
+    public void setUp() throws Exception {
         example01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/env/rhino/example-01.xml");
     }
 
-    @Override
-    protected void tearDown() throws Exception {
+    @After
+    public void tearDown() throws Exception {
         example01 = null;
     }
 
     // TEST METHODS
-
+    @Test
     public void testExample01Sample() throws Exception {
         exec = SCXMLTestHelper.getExecutor(example01, new RhinoEvaluator());
-        assertNotNull(exec);
+        Assert.assertNotNull(exec);
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("ten", ((State)currentStates.iterator().next()).getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("ten", ((State)currentStates.iterator().next()).getId());
         SCXMLTestHelper.assertPostTriggerState(exec, "ten.done", "twenty");
         SCXMLTestHelper.assertPostTriggerState(exec, "twenty.done", "thirty");
         SCXMLTestHelper.assertPostTriggerState(exec, "thirty.done", "forty");

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/servlet/ServletContextResolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/servlet/ServletContextResolverTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/servlet/ServletContextResolverTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/servlet/ServletContextResolverTest.java Wed Oct 16 03:46:58 2013
@@ -16,18 +16,16 @@
  */
 package org.apache.commons.scxml2.env.servlet;
 
-import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Test;
 
-public class ServletContextResolverTest extends TestCase {
-
-    public ServletContextResolverTest(String testName) {
-        super(testName);
-    }
+public class ServletContextResolverTest {
 
+    @Test
     public void testIllegalInstance() {
     	try {
             new ServletContextResolver(null);
-            fail("ServletContextResolver successfully instantiated with"
+            Assert.fail("ServletContextResolver successfully instantiated with"
                 + " null ServletContext");
     	} catch (IllegalArgumentException iae) {
     		// expected, ignore

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/xpath/XPathExampleTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/xpath/XPathExampleTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/xpath/XPathExampleTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/env/xpath/XPathExampleTest.java Wed Oct 16 03:46:58 2013
@@ -20,8 +20,6 @@ package org.apache.commons.scxml2.env.xp
 import java.net.URL;
 import java.util.Set;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.scxml2.Context;
 import org.apache.commons.scxml2.Evaluator;
 import org.apache.commons.scxml2.SCXMLExecutor;
@@ -30,16 +28,16 @@ import org.apache.commons.scxml2.Trigger
 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;
 
 /**
  * SCXML application for the XPath example.
  *
  */
-public class XPathExampleTest extends TestCase {
-
-    public XPathExampleTest(String name) {
-        super(name);
-    }
+public class XPathExampleTest {
 
     // Test data
     private URL example01, example02;
@@ -48,7 +46,7 @@ public class XPathExampleTest extends Te
     /**
      * Set up instance variables required by this test case.
      */
-    @Override
+    @Before
     public void setUp() {
         example01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/env/xpath/example-01.xml");
@@ -59,13 +57,13 @@ public class XPathExampleTest extends Te
     /**
      * Tear down instance variables required by this test case.
      */
-    @Override
+    @After
     public void tearDown() {
         example01 = example02 = null;
     }
 
     // TEST METHODS
-
+    @Test
     public void testExample01Sample() throws Exception {
 
         SCXML scxml = SCXMLTestHelper.parse(example01);
@@ -74,10 +72,10 @@ public class XPathExampleTest extends Te
         Context context = new XPathContext(null);
         exec = SCXMLTestHelper.getExecutor(scxml, context, evaluator);
 
-        assertNotNull(exec);
+        Assert.assertNotNull(exec);
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("mid", ((State)currentStates.iterator().
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("mid", ((State)currentStates.iterator().
             next()).getId());
 
         String payload = "<test xmlns=''><status>complete</status></test>";
@@ -87,7 +85,8 @@ public class XPathExampleTest extends Te
             "end");
 
     }
-
+    
+    @Test
     public void testExample02Sample() throws Exception {
 
         SCXML scxml = SCXMLTestHelper.parse(example02);
@@ -96,10 +95,10 @@ public class XPathExampleTest extends Te
         Context context = new XPathContext(null);
         exec = SCXMLTestHelper.getExecutor(scxml, context, evaluator);
 
-        assertNotNull(exec);
+        Assert.assertNotNull(exec);
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("end", ((State)currentStates.iterator().
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("end", ((State)currentStates.iterator().
             next()).getId());
 
     }

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/invoke/InvokeParamNameTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/invoke/InvokeParamNameTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/invoke/InvokeParamNameTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/invoke/InvokeParamNameTest.java Wed Oct 16 03:46:58 2013
@@ -19,8 +19,6 @@ package org.apache.commons.scxml2.invoke
 import java.net.URL;
 import java.util.Map;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.scxml2.SCInstance;
 import org.apache.commons.scxml2.SCXMLExecutor;
 import org.apache.commons.scxml2.SCXMLTestHelper;
@@ -28,15 +26,15 @@ import org.apache.commons.scxml2.Trigger
 import org.apache.commons.scxml2.env.jexl.JexlContext;
 import org.apache.commons.scxml2.env.jexl.JexlEvaluator;
 import org.apache.commons.scxml2.model.ModelException;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
 // Tests for 4.3.1 in WD-scxml-20080516
-public class InvokeParamNameTest extends TestCase {
-    
-    public InvokeParamNameTest(String testName) {
-        super(testName);
-    }
+public class InvokeParamNameTest {
 
     private URL invoker04;
     private SCXMLExecutor exec;
@@ -44,7 +42,7 @@ public class InvokeParamNameTest extends
     static String lastSource;
     static Map<String, Object> lastParams;
     
-    @Override
+    @Before
     public void setUp() throws Exception {
         invoker04 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/invoke/invoker-04.xml");
@@ -53,7 +51,7 @@ public class InvokeParamNameTest extends
         exec.registerInvokerClass("x-test", DummyInvoker.class);
     }
     
-    @Override
+    @After
     public void tearDown() {
         exec.unregisterInvokerClass("x-test");    
         invoker04 = null;
@@ -66,32 +64,35 @@ public class InvokeParamNameTest extends
             TriggerEvent.SIGNAL_EVENT)); 
     }
     
-    // Tests "param" element with "name" and "expr" attribute
+    // Tests "param" element with "name" and "expr" attribute    
+    @Test
     public void testNameAndExpr() throws Exception {
         trigger();
-        assertTrue(lastSource.endsWith("TestSrc"));
+        Assert.assertTrue(lastSource.endsWith("TestSrc"));
         final Map.Entry<String, Object> e =
             lastParams.entrySet().iterator().next();
-        assertEquals("ding", e.getKey());
-        assertEquals("foo", e.getValue());
+        Assert.assertEquals("ding", e.getKey());
+        Assert.assertEquals("foo", e.getValue());
     }
 
-    // Tests "param" element with only a "name" attribute 
+    // Tests "param" element with only a "name" attribute     
+    @Test
     public void testSoleNameLocation() throws Exception {
         trigger(); trigger();
         final Element e = (Element)lastParams.values().iterator().next();
-        assertNotNull(e);
-        assertEquals("bar", e.getNodeName());
-        assertEquals(Node.TEXT_NODE, e.getFirstChild().getNodeType());
-        assertEquals("foo", e.getFirstChild().getNodeValue());
+        Assert.assertNotNull(e);
+        Assert.assertEquals("bar", e.getNodeName());
+        Assert.assertEquals(Node.TEXT_NODE, e.getFirstChild().getNodeType());
+        Assert.assertEquals("foo", e.getFirstChild().getNodeValue());
     }
 
-    // Tests "param" element with a single, wrong "name" attribute
+    // Tests "param" element with a single, wrong "name" attribute    
+    @Test
     public void testWrongNameLocation() throws Exception {
         trigger(); trigger(); trigger();
-        assertEquals(1, exec.getCurrentStatus().getEvents().size());
+        Assert.assertEquals(1, exec.getCurrentStatus().getEvents().size());
         final TriggerEvent evt = exec.getCurrentStatus().getEvents().iterator().next(); 
-        assertTrue(evt.getName().endsWith("error.illegalalloc"));
+        Assert.assertTrue(evt.getName().endsWith("error.illegalalloc"));
     }
 
     public static class DummyInvoker implements Invoker {

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/invoke/InvokeTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/invoke/InvokeTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/invoke/InvokeTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/invoke/InvokeTest.java Wed Oct 16 03:46:58 2013
@@ -19,8 +19,6 @@ package org.apache.commons.scxml2.invoke
 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.SimpleDispatcher;
@@ -30,19 +28,16 @@ import org.apache.commons.scxml2.env.jex
 import org.apache.commons.scxml2.io.SCXMLReader;
 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 <invoke>
  */
-public class InvokeTest extends TestCase {
-    /**
-     * Construct a new instance of SCXMLExecutorTest with
-     * the specified name
-     */
-    public InvokeTest(String name) {
-        super(name);
-    }
+public class InvokeTest {
 
     // Test data
     private URL invoke01, invoke02, invoke03;
@@ -51,7 +46,7 @@ public class InvokeTest extends TestCase
     /**
      * Set up instance variables required by this test case.
      */
-    @Override
+    @Before
     public void setUp() {
         invoke01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/invoke/invoker-01.xml");
@@ -64,52 +59,55 @@ public class InvokeTest extends TestCase
     /**
      * Tear down instance variables required by this test case.
      */
-    @Override
+    @After
     public void tearDown() {
         invoke01 = invoke02 = invoke03 = null;
     }
 
     /**
      * Test the SCXML documents, usage of &lt;invoke&gt;
-     */
+     */    
+    @Test
     public void testInvoke01Sample() throws Exception {
         SCXML scxml = SCXMLReader.read(invoke01);
         exec = new SCXMLExecutor(new JexlEvaluator(), new SimpleDispatcher(),
             new SimpleErrorReporter());
-        assertNotNull(exec);
+        Assert.assertNotNull(exec);
         exec.setRootContext(new JexlContext());
         exec.setStateMachine(scxml);
         exec.registerInvokerClass("scxml", SimpleSCXMLInvoker.class);
         exec.go();
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("invoker", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("invoker", currentStates.iterator().next().getId());
     }
-
+    
+    @Test
     public void testInvoke02Sample() throws Exception {
         SCXML scxml = SCXMLReader.read(invoke02);
         exec = new SCXMLExecutor(new JexlEvaluator(), new SimpleDispatcher(),
             new SimpleErrorReporter());
-        assertNotNull(exec);
+        Assert.assertNotNull(exec);
         exec.setRootContext(new JexlContext());
         exec.setStateMachine(scxml);
         exec.registerInvokerClass("scxml", SimpleSCXMLInvoker.class);
         exec.go();
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
+        Assert.assertEquals(1, currentStates.size());
     }
-
+    
+    @Test
     public void testInvoke03Sample() throws Exception {
         SCXML scxml = SCXMLReader.read(invoke03);
         exec = new SCXMLExecutor(new JexlEvaluator(), new SimpleDispatcher(),
             new SimpleErrorReporter());
-        assertNotNull(exec);
+        Assert.assertNotNull(exec);
         exec.setRootContext(new JexlContext());
         exec.setStateMachine(scxml);
         exec.registerInvokerClass("scxml", SimpleSCXMLInvoker.class);
         exec.go();
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
+        Assert.assertEquals(1, currentStates.size());
         SCXMLTestHelper.fireEvent(exec, "s1.next");
         SCXMLTestHelper.fireEvent(exec, "state1.next");
     }

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/SCXMLReaderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/SCXMLReaderTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/SCXMLReaderTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/SCXMLReaderTest.java Wed Oct 16 03:46:58 2013
@@ -22,9 +22,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-import javax.xml.stream.XMLStreamException;
-
-import junit.framework.TestCase;
 import org.apache.commons.logging.Log;
 import org.apache.commons.scxml2.ErrorReporter;
 import org.apache.commons.scxml2.EventDispatcher;
@@ -41,18 +38,17 @@ import org.apache.commons.scxml2.model.S
 import org.apache.commons.scxml2.model.Send;
 import org.apache.commons.scxml2.model.State;
 import org.apache.commons.scxml2.model.Transition;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 import org.w3c.dom.Node;
+
+import javax.xml.stream.XMLStreamException;
 /**
  * Unit tests {@link org.apache.commons.scxml2.io.SCXMLReader}.
  */
-public class SCXMLReaderTest extends TestCase {
-    /**
-     * Construct a new instance of SCXMLDigesterTest with
-     * the specified name
-     */
-    public SCXMLReaderTest(String name) {
-        super(name);
-    }
+public class SCXMLReaderTest {
 
     // Test data
     private URL microwave01, microwave02, transitions01, prefix01, send01,
@@ -63,7 +59,7 @@ public class SCXMLReaderTest extends Tes
     /**
      * Set up instance variables required by this test case.
      */
-    @Override
+    @Before
     public void setUp() {
         microwave01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/env/jsp/microwave-01.xml");
@@ -88,7 +84,7 @@ public class SCXMLReaderTest extends Tes
     /**
      * Tear down instance variables required by this test case.
      */
-    @Override
+    @After
     public void tearDown() {
         microwave01 = microwave02 = microwave03 = microwave04 = transitions01 = prefix01 = send01 = action01 = null;
         scxml = null;
@@ -97,81 +93,90 @@ public class SCXMLReaderTest extends Tes
 
     /**
      * Test the implementation
-     */
+     */    
+    @Test
     public void testSCXMLReaderMicrowave01Sample() throws Exception {
         scxml = SCXMLTestHelper.parse(microwave01);
-        assertNotNull(scxml);
+        Assert.assertNotNull(scxml);
         scxmlAsString = serialize(scxml);
-        assertNotNull(scxmlAsString);
+        Assert.assertNotNull(scxmlAsString);
     }
-
+    
+    @Test
     public void testSCXMLReaderMicrowave02Sample() throws Exception {
         scxml = SCXMLTestHelper.parse(microwave02);
-        assertNotNull(scxml);
+        Assert.assertNotNull(scxml);
         scxmlAsString = serialize(scxml);
-        assertNotNull(scxmlAsString);
+        Assert.assertNotNull(scxmlAsString);
     }
-
+    
+    @Test
     public void testSCXMLReaderMicrowave03Sample() throws Exception {
         scxml = SCXMLTestHelper.parse(microwave03);
-        assertNotNull(scxml);
+        Assert.assertNotNull(scxml);
         scxmlAsString = serialize(scxml);
-        assertNotNull(scxmlAsString);
+        Assert.assertNotNull(scxmlAsString);
     }
-
+    
+    @Test
     public void testSCXMLReaderMicrowave04Sample() throws Exception {
         scxml = SCXMLTestHelper.parse(microwave04);
-        assertNotNull(scxml);
+        Assert.assertNotNull(scxml);
         scxmlAsString = serialize(scxml);
-        assertNotNull(scxmlAsString);
+        Assert.assertNotNull(scxmlAsString);
     }
-
+    
+    @Test
     public void testSCXMLReaderTransitions01Sample() throws Exception {
         scxml = SCXMLTestHelper.parse(transitions01);
-        assertNotNull(scxml);
+        Assert.assertNotNull(scxml);
         scxmlAsString = serialize(scxml);
-        assertNotNull(scxmlAsString);
+        Assert.assertNotNull(scxmlAsString);
     }
-
+    
+    @Test
     public void testSCXMLReaderPrefix01Sample() throws Exception {
         scxml = SCXMLTestHelper.parse(prefix01);
-        assertNotNull(scxml);
+        Assert.assertNotNull(scxml);
         scxmlAsString = serialize(scxml);
-        assertNotNull(scxmlAsString);
+        Assert.assertNotNull(scxmlAsString);
     }
-
+    
+    @Test
     public void testSCXMLReaderSend01Sample() throws Exception {
         // Digest
         scxml = SCXMLTestHelper.parse(send01);
         State ten = (State) scxml.getInitialTarget();
-        assertEquals("ten", ten.getId());
+        Assert.assertEquals("ten", ten.getId());
         List<Transition> ten_done = ten.getTransitionsList("ten.done");
-        assertEquals(1, ten_done.size());
+        Assert.assertEquals(1, ten_done.size());
         Transition ten2twenty = ten_done.get(0);
         List<Action> actions = ten2twenty.getActions();
-        assertEquals(1, actions.size());
+        Assert.assertEquals(1, actions.size());
         Send send = (Send) actions.get(0);
-        assertEquals("send1", send.getSendid());
+        Assert.assertEquals("send1", send.getSendid());
         /* Serialize
         scxmlAsString = serialize(scxml);
-        assertNotNull(scxmlAsString);
+        Assert.assertNotNull(scxmlAsString);
         String expectedFoo2Serialization =
             "<foo xmlns=\"http://my.test.namespace\" id=\"foo2\">"
             + "<prompt xmlns=\"http://foo.bar.com/vxml3\">This is just"
             + " an example.</prompt></foo>";
-        assertFalse(scxmlAsString.indexOf(expectedFoo2Serialization) == -1);
+        Assert.assertFalse(scxmlAsString.indexOf(expectedFoo2Serialization) == -1);
         */
     }
-
+    
+    @Test
     public void testSCXMLReaderInitialAttr() throws Exception {
         scxml = SCXMLTestHelper.parse(scxmlinitialattr);
-        assertNotNull(scxml);
+        Assert.assertNotNull(scxml);
         scxmlAsString = serialize(scxml);
-        assertNotNull(scxmlAsString);
+        Assert.assertNotNull(scxmlAsString);
         Final foo = (Final) scxml.getInitialTarget();
-        assertEquals("foo", foo.getId());
+        Assert.assertEquals("foo", foo.getId());
     }
-
+    
+    @Test
     public void testSCXMLReaderCustomActionWithBodyTextSample() throws Exception {
         List<CustomAction> cas = new ArrayList<CustomAction>();
         CustomAction ca = new CustomAction("http://my.custom-actions.domain",
@@ -179,17 +184,17 @@ public class SCXMLReaderTest extends Tes
         cas.add(ca);
         scxml = SCXMLTestHelper.parse(action01, cas);
         State state = (State) scxml.getInitialTarget();
-        assertEquals("actions", state.getId());
+        Assert.assertEquals("actions", state.getId());
         List<Action> actions = state.getOnEntry().getActions();
-        assertEquals(1, actions.size());
+        Assert.assertEquals(1, actions.size());
         MyAction my = (MyAction) actions.get(0);
-        assertNotNull(my);
-        assertTrue(my.getExternalNodes().size() > 0);
+        Assert.assertNotNull(my);
+        Assert.assertTrue(my.getExternalNodes().size() > 0);
     }
 
     private String serialize(final SCXML scxml) throws IOException, XMLStreamException {
         scxmlAsString = SCXMLWriter.write(scxml);
-        assertNotNull(scxmlAsString);
+        Assert.assertNotNull(scxmlAsString);
         return scxmlAsString;
     }
 

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/SCXMLSerializerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/SCXMLSerializerTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/SCXMLSerializerTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/SCXMLSerializerTest.java Wed Oct 16 03:46:58 2013
@@ -21,8 +21,6 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.scxml2.model.Action;
 import org.apache.commons.scxml2.model.Assign;
 import org.apache.commons.scxml2.model.Cancel;
@@ -40,13 +38,12 @@ import org.apache.commons.scxml2.model.S
 import org.apache.commons.scxml2.model.Transition;
 import org.apache.commons.scxml2.model.TransitionTarget;
 import org.apache.commons.scxml2.model.Var;
+import org.junit.Assert;
+import org.junit.Test;
 
-public class SCXMLSerializerTest extends TestCase {
-
-    public SCXMLSerializerTest(String testName) {
-        super(testName);
-    }
+public class SCXMLSerializerTest {
 
+    @Test
     public void testSerializeSCXMLNoStates() {
         SCXML scxml = new SCXML();
         Map<String, String> namespaces = new LinkedHashMap<String, String>();
@@ -65,9 +62,10 @@ public class SCXMLSerializerTest extends
             + "version=\"version1\" initial=\"off\">\n <!-- http://commons.apache.org/scxml -->\n <state>\n "
             + "</state>\n</scxml>\n";
         
-        assertEquals(assertValue, SCXMLSerializer.serialize(scxml));
+        Assert.assertEquals(assertValue, SCXMLSerializer.serialize(scxml));
     }
     
+    @Test
     public void testSerializeSend() {
         Send send = new Send();
         send.setSendid("1");
@@ -89,9 +87,10 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer(); 
         SCXMLSerializer.serializeSend(returnValue, send, " "); 
         
-        assertEquals(assertValue, returnValue.toString());
+        Assert.assertEquals(assertValue, returnValue.toString());
     }
-
+    
+    @Test
     public void testSerializeSendEmptyAttributes() {
         // test a <send event="foo"/>, i.e.most attributes are empty
         Send send = new Send();
@@ -102,9 +101,10 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         SCXMLSerializer.serializeSend(returnValue, send, " ");
 
-        assertEquals(assertValue, returnValue.toString());
+        Assert.assertEquals(assertValue, returnValue.toString());
     }
-
+    
+    @Test
     public void testSerializeActionsListNull() {
         TransitionTarget target = new State();
         target.setId("1");
@@ -112,10 +112,11 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         boolean returnBoolean = SCXMLSerializer.serializeActions(returnValue, null, " ");
         
-        assertFalse(returnBoolean);
-        assertEquals(0, returnValue.length());
+        Assert.assertFalse(returnBoolean);
+        Assert.assertEquals(0, returnValue.length());
     }
     
+    @Test
     public void testSerializeActionsVar() {
         Var var = new Var();
         var.setName("newName");
@@ -129,10 +130,11 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         boolean returnBoolean = SCXMLSerializer.serializeActions(returnValue, values, " ");
         
-        assertFalse(returnBoolean);
-        assertEquals(actualValue, returnValue.toString());
+        Assert.assertFalse(returnBoolean);
+        Assert.assertEquals(actualValue, returnValue.toString());
     }
     
+    @Test
     public void testSerializeActionsAssign() {
         Assign assign = new Assign();
         assign.setName("newName");
@@ -146,10 +148,11 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         boolean returnBoolean = SCXMLSerializer.serializeActions(returnValue, values, " ");
         
-        assertFalse(returnBoolean);
-        assertEquals(actualValue, returnValue.toString());
+        Assert.assertFalse(returnBoolean);
+        Assert.assertEquals(actualValue, returnValue.toString());
     }
     
+    @Test
     public void testSerializeActionsCancel() {
         Cancel cancel = new Cancel();
         cancel.setSendid("1");
@@ -162,10 +165,11 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         boolean returnBoolean = SCXMLSerializer.serializeActions(returnValue, values, " ");
         
-        assertFalse(returnBoolean);
-        assertEquals(actualValue, returnValue.toString());
+        Assert.assertFalse(returnBoolean);
+        Assert.assertEquals(actualValue, returnValue.toString());
     }
     
+    @Test
     public void testSerializeActionsLog() {
         Log log = new Log();
         log.setExpr("newExpression");
@@ -178,10 +182,11 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         boolean returnBoolean = SCXMLSerializer.serializeActions(returnValue, values, " ");
         
-        assertFalse(returnBoolean);
-        assertEquals(actualValue, returnValue.toString());
+        Assert.assertFalse(returnBoolean);
+        Assert.assertEquals(actualValue, returnValue.toString());
     }
     
+    @Test
     public void testSerializeActionsExit() {
         Exit exit = new Exit();
         exit.setExpr("newExpression");
@@ -195,10 +200,11 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         boolean returnBoolean = SCXMLSerializer.serializeActions(returnValue, values, " ");
         
-        assertTrue(returnBoolean);
-        assertEquals(actualValue, returnValue.toString());
+        Assert.assertTrue(returnBoolean);
+        Assert.assertEquals(actualValue, returnValue.toString());
     }
     
+    @Test
     public void testSerializeActionsElse() {
         Else elseValue = new Else();
         
@@ -210,10 +216,11 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         boolean returnBoolean = SCXMLSerializer.serializeActions(returnValue, values, " ");
         
-        assertFalse(returnBoolean);
-        assertEquals(actualValue, returnValue.toString());
+        Assert.assertFalse(returnBoolean);
+        Assert.assertEquals(actualValue, returnValue.toString());
     }
     
+    @Test
     public void testSerializeActionsElseIf() {
         ElseIf elseIf = new ElseIf();
         elseIf.setCond("newCondition");
@@ -226,10 +233,11 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         boolean returnBoolean = SCXMLSerializer.serializeActions(returnValue, values, " ");
         
-        assertFalse(returnBoolean);
-        assertEquals(actualValue, returnValue.toString());
+        Assert.assertFalse(returnBoolean);
+        Assert.assertEquals(actualValue, returnValue.toString());
     }
     
+    @Test
     public void testSerializeIf() {
         If ifValue = new If();
         ifValue.setCond("newCondition");
@@ -242,10 +250,11 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         boolean returnBoolean = SCXMLSerializer.serializeActions(returnValue, values, " ");
         
-        assertFalse(returnBoolean);
-        assertEquals(actualValue, returnValue.toString());
+        Assert.assertFalse(returnBoolean);
+        Assert.assertEquals(actualValue, returnValue.toString());
     }
     
+    @Test
     public void testSerializeOnEntrySizeZero() {
         TransitionTarget target = new State();
         target.setOnEntry(new OnEntry());
@@ -255,9 +264,10 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         SCXMLSerializer.serializeOnEntry(returnValue, target, " ");
         
-        assertEquals(actualValue, returnValue.toString());
+        Assert.assertEquals(actualValue, returnValue.toString());
     }
-
+    
+    @Test
     public void testSerializeOnEntry() {
         TransitionTarget target = new State();
         
@@ -271,9 +281,10 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         SCXMLSerializer.serializeOnEntry(returnValue, target, " ");
         
-        assertEquals(actualValue, returnValue.toString());
+        Assert.assertEquals(actualValue, returnValue.toString());
     }
     
+    @Test
     public void testSerializeOnExitSizeZero() {
         TransitionTarget target = new State();
         target.setOnExit(new OnExit());
@@ -283,9 +294,10 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         SCXMLSerializer.serializeOnExit(returnValue, target, " ");
         
-        assertEquals(actualValue, returnValue.toString());
+        Assert.assertEquals(actualValue, returnValue.toString());
     }
-
+    
+    @Test
     public void testSerializeOnExit() {
         TransitionTarget target = new State();
         
@@ -299,9 +311,10 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         SCXMLSerializer.serializeOnExit(returnValue, target, " ");
         
-        assertEquals(actualValue, returnValue.toString());
+        Assert.assertEquals(actualValue, returnValue.toString());
     }
-
+    
+    @Test
     public void testSerializeTransition() {
         Transition t = new Transition();
 
@@ -314,9 +327,10 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         SCXMLSerializer.serializeTransition(returnValue, t, "");
 
-        assertEquals(actualValue, returnValue.toString());
+        Assert.assertEquals(actualValue, returnValue.toString());
     }
-
+    
+    @Test
     public void testSerializeTransitionEscapeXML() {
         Transition t = new Transition();
 
@@ -328,9 +342,10 @@ public class SCXMLSerializerTest extends
         StringBuffer returnValue = new StringBuffer();
         SCXMLSerializer.serializeTransition(returnValue, t, "");
 
-        assertEquals(actualValue, returnValue.toString());
+        Assert.assertEquals(actualValue, returnValue.toString());
     }
-
+    
+    @Test
     public void testSerializeSCXMLState() {
         SCXML scxml = new SCXML();
         scxml.setVersion("1.0");
@@ -346,9 +361,10 @@ public class SCXMLSerializerTest extends
             + "version=\"1.0\" initial=\"S1\">\n <!-- http://commons.apache.org/scxml -->\n"
             + " <state id=\"S1\">\n </state>\n</scxml>\n";
 
-        assertEquals(assertValue, SCXMLSerializer.serialize(scxml));
+        Assert.assertEquals(assertValue, SCXMLSerializer.serialize(scxml));
     }
-
+    
+    @Test
     public void testSerializeParallel() {
 
         SCXML scxml = new SCXML();
@@ -397,7 +413,7 @@ public class SCXMLSerializerTest extends
 
         String s = SCXMLSerializer.serialize(scxml);
 
-        assertEquals(assertValue, s);
+        Assert.assertEquals(assertValue, s);
      }
 
 }

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/SCXMLWriterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/SCXMLWriterTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/SCXMLWriterTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/SCXMLWriterTest.java Wed Oct 16 03:46:58 2013
@@ -20,20 +20,17 @@ import java.io.IOException;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
-import javax.xml.stream.XMLStreamException;
-
-import junit.framework.TestCase;
-
 import org.apache.commons.scxml2.model.Parallel;
 import org.apache.commons.scxml2.model.SCXML;
 import org.apache.commons.scxml2.model.State;
+import org.junit.Assert;
+import org.junit.Test;
 
-public class SCXMLWriterTest extends TestCase {
+import javax.xml.stream.XMLStreamException;
 
-    public SCXMLWriterTest(String testName) {
-        super(testName);
-    }
+public class SCXMLWriterTest {
 
+    @Test
     public void testSerializeSCXMLNoStates() throws IOException, XMLStreamException {
         SCXML scxml = new SCXML();
         Map<String, String> namespaces = new LinkedHashMap<String, String>();
@@ -52,9 +49,10 @@ public class SCXMLWriterTest extends Tes
             + "version=\"version1\" initial=\"off\"><!--http://commons.apache.org/scxml--><state></state>"
             + "</scxml>";
 
-        assertEquals(assertValue, SCXMLWriter.write(scxml, new SCXMLWriter.Configuration(true, false)));
+        Assert.assertEquals(assertValue, SCXMLWriter.write(scxml, new SCXMLWriter.Configuration(true, false)));
     }
-
+    
+    @Test
     public void testSerializeSCXMLState() throws IOException, XMLStreamException {
         SCXML scxml = new SCXML();
         Map<String, String> namespaces = new LinkedHashMap<String, String>();
@@ -72,9 +70,10 @@ public class SCXMLWriterTest extends Tes
             + "xmlns:cs=\"http://commons.apache.org/scxml\" version=\"1.0\" initial=\"S1\">"
             + "<!--http://commons.apache.org/scxml--><state id=\"S1\"></state></scxml>";
 
-        assertEquals(assertValue, SCXMLWriter.write(scxml, new SCXMLWriter.Configuration(true, false)));
+        Assert.assertEquals(assertValue, SCXMLWriter.write(scxml, new SCXMLWriter.Configuration(true, false)));
     }
-
+    
+    @Test
     public void testSerializeParallel() throws IOException, XMLStreamException {
 
         SCXML scxml = new SCXML();
@@ -121,7 +120,7 @@ public class SCXMLWriterTest extends Tes
             + "</parallel>"
             + "</scxml>";
 
-        assertEquals(assertValue, SCXMLWriter.write(scxml, new SCXMLWriter.Configuration(true, false)));
+        Assert.assertEquals(assertValue, SCXMLWriter.write(scxml, new SCXMLWriter.Configuration(true, false)));
      }
 
 }

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/StateSrcTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/StateSrcTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/StateSrcTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/io/StateSrcTest.java Wed Oct 16 03:46:58 2013
@@ -19,25 +19,20 @@ package org.apache.commons.scxml2.io;
 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.model.ModelException;
 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.io.SCXMLDigester}
  * Test white box nature of <state> element "src" attribute.
  */
-public class StateSrcTest extends TestCase {
-    /**
-     * Construct a new instance of SCXMLDigesterTest with
-     * the specified name
-     */
-    public StateSrcTest(String name) {
-        super(name);
-    }
+public class StateSrcTest {
 
     // Test data
     private URL src01, src04, src05;
@@ -47,7 +42,7 @@ public class StateSrcTest extends TestCa
     /**
      * Set up instance variables required by this test case.
      */
-    @Override
+    @Before
     public void setUp() {
         src01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/io/src-test-1.xml");
@@ -60,7 +55,7 @@ public class StateSrcTest extends TestCa
     /**
      * Tear down instance variables required by this test case.
      */
-    @Override
+    @After
     public void tearDown() {
         src01 = src04 = src05 = null;
         scxml = null;
@@ -69,37 +64,40 @@ public class StateSrcTest extends TestCa
 
     /**
      * Test the implementation
-     */
+     */    
+    @Test
     public void testRecursiveSrcInclude() throws Exception {
         scxml = SCXMLTestHelper.parse(src01);
-        assertNotNull(scxml);
+        Assert.assertNotNull(scxml);
         exec = SCXMLTestHelper.getExecutor(scxml);
-        assertNotNull(exec);
+        Assert.assertNotNull(exec);
         Set<TransitionTarget> states = exec.getCurrentStatus().getStates();
-        assertEquals(1, states.size());
-        assertEquals("srctest3", states.iterator().next().getId());
+        Assert.assertEquals(1, states.size());
+        Assert.assertEquals("srctest3", states.iterator().next().getId());
         states = SCXMLTestHelper.fireEvent(exec, "src.test");
-        assertEquals(1, states.size());
-        assertEquals("srctest1end", states.iterator().next().getId());
-        assertTrue(exec.getCurrentStatus().isFinal());
+        Assert.assertEquals(1, states.size());
+        Assert.assertEquals("srctest1end", states.iterator().next().getId());
+        Assert.assertTrue(exec.getCurrentStatus().isFinal());
     }
-
+    
+    @Test
     public void testBadSrcInclude() throws Exception {
         try {
             scxml = SCXMLReader.read(src04);
-            fail("Document with bad <state> src attribute shouldn't be parsed!");
+            Assert.fail("Document with bad <state> src attribute shouldn't be parsed!");
         } catch (ModelException me) {
-            assertTrue("Unexpected error message for bad <state> 'src' URI",
+            Assert.assertTrue("Unexpected error message for bad <state> 'src' URI",
                 me.getMessage() != null && me.getMessage().contains("Source attribute in <state src="));
         }
     }
-
+    
+    @Test
     public void testBadSrcFragmentInclude() throws Exception {
         try {
             scxml = SCXMLReader.read(src05);
-            fail("Document with bad <state> src attribute shouldn't be parsed!");
+            Assert.fail("Document with bad <state> src attribute shouldn't be parsed!");
         } catch (ModelException me) {
-            assertTrue("Unexpected error message for bad <state> 'src' URI fragment",
+            Assert.assertTrue("Unexpected error message for bad <state> 'src' URI fragment",
                 me.getMessage() != null && me.getMessage().contains("URI Fragment in <state src="));
         }
     }

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/issues/Issue112Test.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/issues/Issue112Test.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/issues/Issue112Test.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/issues/Issue112Test.java Wed Oct 16 03:46:58 2013
@@ -23,8 +23,6 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Queue;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.scxml2.ErrorReporter;
 import org.apache.commons.scxml2.EventDispatcher;
@@ -38,16 +36,16 @@ import org.apache.commons.scxml2.model.C
 import org.apache.commons.scxml2.model.ModelException;
 import org.apache.commons.scxml2.model.SCXML;
 import org.apache.commons.scxml2.model.State;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * Test cases for issue 112.
  * OPEN
  */
-public class Issue112Test extends TestCase {
-
-    public Issue112Test(String testName) {
-        super(testName);
-    }
+public class Issue112Test {
 
     private URL queue01;
     private SCXMLExecutor exec;
@@ -55,7 +53,7 @@ public class Issue112Test extends TestCa
     /**
      * Set up instance variables required by this test case.
      */
-    @Override
+    @Before
     public void setUp() {
         queue01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/issues/queue-01.xml");
@@ -64,7 +62,7 @@ public class Issue112Test extends TestCa
     /**
      * Tear down instance variables required by this test case.
      */
-    @Override
+    @After
     public void tearDown() {
         queue01 = null;
         exec = null;
@@ -72,7 +70,8 @@ public class Issue112Test extends TestCa
     }
 
     // Example using a custom <my:enqueue> action that generates more events during event processing.
-    // An external event queue is used by <my:enqueue> instead of SCXMLExecutor#triggerEvent(TriggerEvent)
+    // An external event queue is used by <my:enqueue> instead of SCXMLExecutor#triggerEvent(TriggerEvent)    
+    @Test
     public void test01issue112() throws Exception {
 
         CustomAction ca1 =
@@ -84,7 +83,7 @@ public class Issue112Test extends TestCa
         SCXML scxml = SCXMLTestHelper.parse(queue01, customActions);
 
         exec = SCXMLTestHelper.getExecutor(scxml);
-        assertEquals("init", ((State) exec.getCurrentStatus().getStates().
+        Assert.assertEquals("init", ((State) exec.getCurrentStatus().getStates().
                 iterator().next()).getId());
 
         // Add an event, other external events could be added to the queue at any time (this test only adds one).
@@ -100,8 +99,8 @@ public class Issue112Test extends TestCa
             }
         }
 
-        assertTrue(exec.getCurrentStatus().isFinal());
-        assertEquals("end", ((State) exec.getCurrentStatus().getStates().
+        Assert.assertTrue(exec.getCurrentStatus().isFinal());
+        Assert.assertEquals("end", ((State) exec.getCurrentStatus().getStates().
                 iterator().next()).getId());
 
     }

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/issues/Issue62Test.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/issues/Issue62Test.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/issues/Issue62Test.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/issues/Issue62Test.java Wed Oct 16 03:46:58 2013
@@ -19,21 +19,19 @@ package org.apache.commons.scxml2.issues
 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.model.TransitionTarget;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * Test cases for issue 62.
  * FIXED
  */
-public class Issue62Test extends TestCase {
-
-    public Issue62Test(String name) {
-        super(name);
-    }
+public class Issue62Test {
 
     private URL test01, test02, test03;
     private SCXMLExecutor exec;
@@ -41,7 +39,7 @@ public class Issue62Test extends TestCas
     /**
      * Set up instance variables required by this test case.
      */
-    @Override
+    @Before
     public void setUp() {
         test01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/issues/issue62-01.xml");
@@ -54,25 +52,28 @@ public class Issue62Test extends TestCas
     /**
      * Tear down instance variables required by this test case.
      */
-    @Override
+    @After
     public void tearDown() {
         test01 = test02 = null;
         exec = null;
     }
-
+    
+    @Test
     public void test01issue62() throws Exception {
         exec = SCXMLTestHelper.getExecutor(test01);
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("s1.1", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("s1.1", currentStates.iterator().next().getId());
         SCXMLTestHelper.assertPostTriggerState(exec, "foo", "s1.1");
     }
-
+    
+    @Test
     public void test02issue62() throws Exception {
         exec = SCXMLTestHelper.getExecutor(test02);
         fragmenttest();
     }
-
+    
+    @Test
     public void test03issue62() throws Exception {
         exec = SCXMLTestHelper.getExecutor(SCXMLTestHelper.parse(test03));
         fragmenttest();
@@ -80,12 +81,12 @@ public class Issue62Test extends TestCas
 
     private void fragmenttest() throws Exception {
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("s1", currentStates.iterator().next().getId());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("s1", currentStates.iterator().next().getId());
         SCXMLTestHelper.assertPostTriggerState(exec, "foo", "e1.1.1");
         SCXMLTestHelper.assertPostTriggerState(exec, "bar", "e1.1.2");
         SCXMLTestHelper.assertPostTriggerState(exec, "baz", "s3");
-        assertTrue(exec.getCurrentStatus().isFinal());
+        Assert.assertTrue(exec.getCurrentStatus().isFinal());
     }
 }
 

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/issues/Issue64Test.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/issues/Issue64Test.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/issues/Issue64Test.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/issues/Issue64Test.java Wed Oct 16 03:46:58 2013
@@ -18,20 +18,17 @@ package org.apache.commons.scxml2.issues
 
 import java.net.URL;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.scxml2.SCXMLExecutor;
 import org.apache.commons.scxml2.SCXMLTestHelper;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * Test cases for issue 64.
  * WONTFIX
  */
-public class Issue64Test extends TestCase {
-
-    public Issue64Test(String name) {
-        super(name);
-    }
+public class Issue64Test {
 
     private URL works, fails;
     private SCXMLExecutor exec;
@@ -39,7 +36,7 @@ public class Issue64Test extends TestCas
     /**
      * Set up instance variables required by this test case.
      */
-    @Override
+    @Before
     public void setUp() {
         works = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/issues/issue64-01.xml");
@@ -50,17 +47,19 @@ public class Issue64Test extends TestCas
     /**
      * Tear down instance variables required by this test case.
      */
-    @Override
+    @After
     public void tearDown() {
         works = fails = null;
         exec = null;
     }
-
+    
+    @Test
     public void test01issue64() throws Exception {
         exec = SCXMLTestHelper.getExecutor(SCXMLTestHelper.parse(works));
         SCXMLTestHelper.assertPostTriggerState(exec, "show.bug", "end");
     }
-
+    
+    @Test
     public void test02issue64() throws Exception {
         exec = SCXMLTestHelper.getExecutor(SCXMLTestHelper.parse(fails));
         SCXMLTestHelper.assertPostTriggerState(exec, "show.bug", "end");

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ActionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ActionTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ActionTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ActionTest.java Wed Oct 16 03:46:58 2013
@@ -16,21 +16,19 @@
  */
 package org.apache.commons.scxml2.model;
 
-import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
 
-public class ActionTest extends TestCase {
-
-    public ActionTest(String testName) {
-        super(testName);
-    }
+public class ActionTest {
 
     private Action action;
     
-    @Override
+    @Before
     public void setUp() {
         action = new Assign();
     }
-    
+    @Test
     public void testGetParentStateIsState() throws Exception {
         Transition transition = new Transition();
         
@@ -42,9 +40,10 @@ public class ActionTest extends TestCase
 
         TransitionTarget returnValue = action.getParentTransitionTarget();
         
-        assertEquals("on", returnValue.getId());
+        Assert.assertEquals("on", returnValue.getId());
     }
-
+    
+    @Test
     public void testGetParentStateIsParallel() throws Exception {
         Transition transition = new Transition();
         
@@ -61,9 +60,10 @@ public class ActionTest extends TestCase
 
         TransitionTarget returnValue = action.getParentTransitionTarget();
         
-        assertEquals("on", returnValue.getId());
+        Assert.assertEquals("on", returnValue.getId());
     }
     
+    @Test
     public void testGetParentStateIsHistory() throws Exception {
         Transition transition = new Transition();
         
@@ -80,9 +80,10 @@ public class ActionTest extends TestCase
 
         TransitionTarget returnValue = action.getParentTransitionTarget();
         
-        assertEquals("off", returnValue.getId());
+        Assert.assertEquals("off", returnValue.getId());
     }
-
+    
+    @Test
     public void testGetParentStateIsInitial() throws Exception {
         Transition transition = new Transition();
         
@@ -99,6 +100,6 @@ public class ActionTest extends TestCase
 
         TransitionTarget returnValue = action.getParentTransitionTarget();
 
-        assertEquals("off", returnValue.getId());
+        Assert.assertEquals("off", returnValue.getId());
     }
 }

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ActionsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ActionsTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ActionsTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/ActionsTest.java Wed Oct 16 03:46:58 2013
@@ -18,12 +18,14 @@ package org.apache.commons.scxml2.model;
 
 import java.net.URL;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.scxml2.SCXMLExecutor;
 import org.apache.commons.scxml2.SCXMLTestHelper;
 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.model.Assign}.
  * Unit tests {@link org.apache.commons.scxml2.model.Cancel}.
@@ -35,14 +37,7 @@ import org.apache.commons.scxml2.env.jsp
  * Unit tests {@link org.apache.commons.scxml2.model.Send}.
  * Unit tests {@link org.apache.commons.scxml2.model.Var}.
  */
-public class ActionsTest extends TestCase {
-    /**
-     * Construct a new instance of ActionsTest with
-     * the specified name
-     */
-    public ActionsTest(String name) {
-        super(name);
-    }
+public class ActionsTest {
 
     // Test data
     private URL actionsSample01, actionsSample02, actionsSample03;
@@ -53,7 +48,7 @@ public class ActionsTest extends TestCas
     /**
      * Set up instance variables required by this test case.
      */
-    @Override
+    @Before
     public void setUp() {
         actionsSample01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/model/actions-state-test.xml");
@@ -68,7 +63,7 @@ public class ActionsTest extends TestCas
     /**
      * Tear down instance variables required by this test case.
      */
-    @Override
+    @After
     public void tearDown() {
         actionsSample01 = actionsSample02 = actionsSample03 = null;
         evaluator = null;
@@ -78,17 +73,20 @@ public class ActionsTest extends TestCas
 
     /**
      * Test the implementation
-     */
+     */    
+    @Test
     public void testStateActions() throws Exception {
         SCXML scxml = SCXMLTestHelper.parse(actionsSample01);
         runTest(scxml);
     }
-
+    
+    @Test
     public void testParallelActions() throws Exception {
         SCXML scxml = SCXMLTestHelper.parse(actionsSample02);
         runTest(scxml);
     }
-
+    
+    @Test
     public void testInitialActions() throws Exception {
         SCXML scxml = SCXMLTestHelper.parse(actionsSample03);
         runTest(scxml);
@@ -98,8 +96,8 @@ public class ActionsTest extends TestCas
         exec = SCXMLTestHelper.getExecutor(scxml, ctx, evaluator);
         ELContext ctx = (ELContext) SCXMLTestHelper.lookupContext(exec,
             "actionsTest");
-        assertEquals((String) ctx.get("foo"), "foobar");
-        assertEquals("Missed event transition",
+        Assert.assertEquals((String) ctx.get("foo"), "foobar");
+        Assert.assertEquals("Missed event transition",
             "true", (String) ctx.get("eventsent"));
     }
 }

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/AssignTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/AssignTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/AssignTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/AssignTest.java Wed Oct 16 03:46:58 2013
@@ -19,20 +19,16 @@ 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;
 /**
  * Unit tests for &lt;assign&gt; element, particular the "src" attribute.
  */
-public class AssignTest extends TestCase {
-    /**
-     * Construct a new instance of AssignTest with
-     * the specified name
-     */
-    public AssignTest(String name) {
-        super(name);
-    }
+public class AssignTest {
 
     // Test data
     private URL assign01, assign02;
@@ -41,7 +37,7 @@ public class AssignTest extends TestCase
     /**
      * Set up instance variables required by this test case.
      */
-    @Override
+    @Before
     public void setUp() {
         assign01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/model/assign-test-01.xml");
@@ -52,7 +48,7 @@ public class AssignTest extends TestCase
     /**
      * Tear down instance variables required by this test case.
      */
-    @Override
+    @After
     public void tearDown() {
         assign01 = assign02 = null;
         exec = null;
@@ -60,21 +56,23 @@ public class AssignTest extends TestCase
 
     /**
      * Test the implementation
-     */
+     */    
+    @Test
     public void testAssignSrc() throws Exception {
         exec = SCXMLTestHelper.getExecutor(assign01);
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("assign3", currentStates.iterator().next().getId());
-        assertTrue(exec.getCurrentStatus().isFinal());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("assign3", currentStates.iterator().next().getId());
+        Assert.assertTrue(exec.getCurrentStatus().isFinal());
     }
-
+    
+    @Test
     public void testAssignDeep() throws Exception {
         exec = SCXMLTestHelper.getExecutor(assign02);
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-        assertEquals(1, currentStates.size());
-        assertEquals("assign3", currentStates.iterator().next().getId());
-        assertTrue(exec.getCurrentStatus().isFinal());
+        Assert.assertEquals(1, currentStates.size());
+        Assert.assertEquals("assign3", currentStates.iterator().next().getId());
+        Assert.assertTrue(exec.getCurrentStatus().isFinal());
     }
 }
 

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/CustomActionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/CustomActionTest.java?rev=1532637&r1=1532636&r2=1532637&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/CustomActionTest.java (original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml2/model/CustomActionTest.java Wed Oct 16 03:46:58 2013
@@ -20,16 +20,18 @@ import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 
-import junit.framework.TestCase;
 import org.apache.commons.scxml2.SCXMLExecutor;
 import org.apache.commons.scxml2.SCXMLTestHelper;
 import org.apache.commons.scxml2.env.jsp.ELEvaluator;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
 
-public class CustomActionTest extends TestCase {
-
-    public CustomActionTest(String testName) {
-        super(testName);
-    }
+@FixMethodOrder(MethodSorters.JVM)
+public class CustomActionTest {
 
     private URL hello01, custom01, external01, override01, payload01, payload02;
     private SCXMLExecutor exec;
@@ -37,7 +39,7 @@ public class CustomActionTest extends Te
     /**
      * Set up instance variables required by this test case.
      */
-    @Override
+    @Before
     public void setUp() {
         hello01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml2/hello-world.xml");
@@ -56,76 +58,84 @@ public class CustomActionTest extends Te
     /**
      * Tear down instance variables required by this test case.
      */
-    @Override
+    @After
     public void tearDown() {
         hello01 = custom01 = external01 = payload01 = payload02 = null;
         exec = null;
     }
 
+    @Test
     public void testAddGoodCustomAction01() throws Exception {
         new CustomAction("http://my.actions.domain/CUSTOM", "hello",
             Hello.class);
     }
 
+    @Test
     public void testAddBadCustomAction01() {
         try {
             new CustomAction(null, "hello", Hello.class);
-            fail("Added custom action with illegal namespace");
+            Assert.fail("Added custom action with illegal namespace");
         } catch (IllegalArgumentException iae) {
             // Expected
         }
     }
 
+    @Test
     public void testAddBadCustomAction02() {
         try {
             new CustomAction("  ", "hello", Hello.class);
-            fail("Added custom action with illegal namespace");
+            Assert.fail("Added custom action with illegal namespace");
         } catch (IllegalArgumentException iae) {
             // Expected
         }
     }
 
+    @Test
     public void testAddBadCustomAction03() {
         try {
             new CustomAction("http://my.actions.domain/CUSTOM", "",
                 Hello.class);
-            fail("Added custom action with illegal local name");
+            Assert.fail("Added custom action with illegal local name");
         } catch (IllegalArgumentException iae) {
             // Expected
         }
     }
 
+    @Test
     public void testAddBadCustomAction04() {
         try {
             new CustomAction("http://my.actions.domain/CUSTOM", "  ",
                 Hello.class);
-            fail("Added custom action with illegal local name");
+            Assert.fail("Added custom action with illegal local name");
         } catch (IllegalArgumentException iae) {
             // Expected
         }
     }
 
+    @Test
     public void testAddBadCustomAction05() {
         try {            
             new CustomAction("http://www.w3.org/2005/07/scxml", "foo",
                 Hello.class);
-            fail("Added custom action in the SCXML namespace");
+            Assert.fail("Added custom action in the SCXML namespace");
         } catch (IllegalArgumentException iae) {
             // Expected
         }
     }
 
     // Hello World example using the SCXML <log> action
+    @Test
     public void testHelloWorld() throws Exception {
         // (1) Get a SCXMLExecutor
         exec = SCXMLTestHelper.getExecutor(hello01);
         // (2) Single, final state
-        assertEquals("hello", ((State) exec.getCurrentStatus().getStates().
+        Assert.assertEquals("hello", ((State) exec.getCurrentStatus().getStates().
                 iterator().next()).getId());
-        assertTrue(exec.getCurrentStatus().isFinal());
+        Assert.assertTrue(exec.getCurrentStatus().isFinal());
     }
 
     // Hello World example using a custom <hello> action
+    @Test
     public void testCustomActionHelloWorld() throws Exception {
         // (1) Form a list of custom actions defined in the SCXML
         //     document (and any included documents via "src" attributes)
@@ -145,13 +155,14 @@ public class CustomActionTest extends Te
         // (3) Get a SCXMLExecutor
         exec = SCXMLTestHelper.getExecutor(scxml);
         // (4) Single, final state
-        assertEquals("custom", ((State) exec.getCurrentStatus().getStates().
+        Assert.assertEquals("custom", ((State) exec.getCurrentStatus().getStates().
                 iterator().next()).getId());
-        assertTrue(exec.getCurrentStatus().isFinal());
+        Assert.assertTrue(exec.getCurrentStatus().isFinal());
     }
 
     // Hello World example using custom <my:hello> action
     // as part of an external state source (src attribute)
+    @Test
     public void testCustomActionExternalSrcHelloWorld() throws Exception {
         // (1) Form a list of custom actions defined in the SCXML
         //     document (and any included documents via "src" attributes)
@@ -165,12 +176,13 @@ public class CustomActionTest extends Te
         // (3) Get a SCXMLExecutor
         exec = SCXMLTestHelper.getExecutor(scxml);
         // (4) Single, final state
-        assertEquals("custom", ((State) exec.getCurrentStatus().getStates().
+        Assert.assertEquals("custom", ((State) exec.getCurrentStatus().getStates().
             iterator().next()).getId());
     }
 
     // Hello World example using custom <my:send> action
     // (overriding SCXML local name "send")
+    @Test
     public void testCustomActionOverrideLocalName() throws Exception {
         // (1) List of custom actions, use same local name as SCXML action
         CustomAction ca =
@@ -183,18 +195,20 @@ public class CustomActionTest extends Te
         // (3) Get a SCXMLExecutor
         exec = SCXMLTestHelper.getExecutor(scxml);
         // (4) Single, final state
-        assertEquals("custom", ((State) exec.getCurrentStatus().getStates().
+        Assert.assertEquals("custom", ((State) exec.getCurrentStatus().getStates().
             iterator().next()).getId());
     }
 
     // The custom action defined by Hello.class should be called
     // to execute() exactly 5 times upto this point
+    @Test
     public void testCustomActionCallbacks() {
-        assertEquals(5, Hello.callbacks);
+        Assert.assertEquals(5, Hello.callbacks);
     }
 
     // Hello World example using custom <my:hello> action that generates an
     // event which has the payload examined with JEXL expressions
+    @Test
     public void testCustomActionEventPayloadHelloWorldJexl() throws Exception {
         // (1) Form a list of custom actions defined in the SCXML
         //     document (and any included documents via "src" attributes)
@@ -208,25 +222,26 @@ public class CustomActionTest extends Te
         // (3) Get a SCXMLExecutor
         exec = SCXMLTestHelper.getExecutor(scxml);
         // (4) Single, final state
-        assertEquals("Invalid intermediate state",
+        Assert.assertEquals("Invalid intermediate state",
                      "custom1", ((State) exec.getCurrentStatus().getStates().
                                 iterator().next()).getId());
         // (5) Verify datamodel variable is correct
-        assertEquals("Missing helloName1 in root context", "custom04a",
+        Assert.assertEquals("Missing helloName1 in root context", "custom04a",
                      (String) exec.getRootContext().get("helloName1"));
         // (6) Check use of payload in non-initial state
         SCXMLTestHelper.fireEvent(exec, "custom.next");
         // (7) Verify correct end state
-        assertEquals("Missing helloName1 in root context", "custom04b",
+        Assert.assertEquals("Missing helloName1 in root context", "custom04b",
                 (String) exec.getRootContext().get("helloName1"));
-        assertEquals("Invalid final state",
+        Assert.assertEquals("Invalid final state",
                 "end", ((State) exec.getCurrentStatus().getStates().
                 iterator().next()).getId());
-        assertTrue(exec.getCurrentStatus().isFinal());
+        Assert.assertTrue(exec.getCurrentStatus().isFinal());
     }
 
     // Hello World example using custom <my:hello> action that generates an
     // event which has the payload examined with EL expressions
+    @Test
     public void testCustomActionEventPayloadHelloWorldEL() throws Exception {
         // (1) Form a list of custom actions defined in the SCXML
         //     document (and any included documents via "src" attributes)
@@ -240,13 +255,12 @@ public class CustomActionTest extends Te
         // (3) Get a SCXMLExecutor
         exec = SCXMLTestHelper.getExecutor(new ELEvaluator(), scxml);
         // (4) Single, final state
-        assertEquals("Invalid final state",
+        Assert.assertEquals("Invalid final state",
                      "custom", ((State) exec.getCurrentStatus().getStates().
                                 iterator().next()).getId());
         // (5) Verify datamodel variable is correct
-        assertEquals("Missing helloName1 in root context", "custom04",
+        Assert.assertEquals("Missing helloName1 in root context", "custom04",
                      (String) exec.getRootContext().get("helloName1"));
     }
-
 }
 



Mime
View raw message