commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r730808 - in /commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml: ./ env/javascript/ env/jsp/ env/xpath/ invoke/ io/ model/
Date Fri, 02 Jan 2009 18:34:48 GMT
Author: sebb
Date: Fri Jan  2 10:34:48 2009
New Revision: 730808

URL: http://svn.apache.org/viewvc?rev=730808&view=rev
Log:
SCXML-91 (1) - Test cases should only catch Exception if that is part of the test
Add @overrides to setUp and tearDown

Modified:
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/EventDataTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/NamespacePrefixedXPathsTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/SCXMLExecutorTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/WildcardTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/WizardsTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSBindingsTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSEvaluatorTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSExampleTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/jsp/RootContextTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/xpath/XPathExampleTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/invoke/InvokeParamNameTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/invoke/InvokeTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/io/StateSrcTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/CustomActionTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/DatamodelTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/HistoryTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/ParallelTest.java
    commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/StatelessModelTest.java

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/EventDataTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/EventDataTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/EventDataTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/EventDataTest.java Fri Jan  2 10:34:48 2009
@@ -55,6 +55,7 @@
     /**
      * Set up instance variables required by this test case.
      */
+    @Override
     public void setUp() {
         eventdata01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/env/jexl/eventdata-01.xml");
@@ -69,6 +70,7 @@
     /**
      * Tear down instance variables required by this test case.
      */
+    @Override
     public void tearDown() {
         eventdata01 = eventdata02 = eventdata03 = eventdata04 = null;
     }
@@ -76,87 +78,71 @@
     /**
      * Test the SCXML documents, usage of "_eventdata"
      */
-    public void testEventdata01Sample() {
+    public void testEventdata01Sample() throws Exception {
     	exec = SCXMLTestHelper.getExecutor(eventdata01);
         assertNotNull(exec);
-        try {
-            Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("state1", currentStates.iterator().next().getId());
-            TriggerEvent te = new TriggerEvent("event.foo",
-                TriggerEvent.SIGNAL_EVENT, new Integer(3));
-            currentStates = SCXMLTestHelper.fireEvent(exec, te);
-            assertEquals(1, currentStates.size());
-            assertEquals("state3", currentStates.iterator().next().getId());
-            TriggerEvent[] evts = new TriggerEvent[] { te,
-                new TriggerEvent("event.bar", TriggerEvent.SIGNAL_EVENT,
-                new Integer(6))};
-            currentStates = SCXMLTestHelper.fireEvents(exec, evts);
-            assertEquals(1, currentStates.size());
-            assertEquals("state6", currentStates.iterator().next().getId());
-            te = new TriggerEvent("event.baz",
-                TriggerEvent.SIGNAL_EVENT, new Integer(7));
-            currentStates = SCXMLTestHelper.fireEvent(exec, te);
-            assertEquals(1, currentStates.size());
-            assertEquals("state7", currentStates.iterator().next().getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("state1", currentStates.iterator().next().getId());
+        TriggerEvent te = new TriggerEvent("event.foo",
+            TriggerEvent.SIGNAL_EVENT, new Integer(3));
+        currentStates = SCXMLTestHelper.fireEvent(exec, te);
+        assertEquals(1, currentStates.size());
+        assertEquals("state3", currentStates.iterator().next().getId());
+        TriggerEvent[] evts = new TriggerEvent[] { te,
+            new TriggerEvent("event.bar", TriggerEvent.SIGNAL_EVENT,
+            new Integer(6))};
+        currentStates = SCXMLTestHelper.fireEvents(exec, evts);
+        assertEquals(1, currentStates.size());
+        assertEquals("state6", currentStates.iterator().next().getId());
+        te = new TriggerEvent("event.baz",
+            TriggerEvent.SIGNAL_EVENT, new Integer(7));
+        currentStates = SCXMLTestHelper.fireEvent(exec, te);
+        assertEquals(1, currentStates.size());
+        assertEquals("state7", currentStates.iterator().next().getId());
     }
 
-    public void testEventdata02Sample() {
+    public void testEventdata02Sample() throws Exception {
     	exec = SCXMLTestHelper.getExecutor(eventdata02);
         assertNotNull(exec);
-        try {
-            Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("state0", currentStates.iterator().next().getId());
-            TriggerEvent te1 = new TriggerEvent("connection.alerting",
-                TriggerEvent.SIGNAL_EVENT, "line2");
-            currentStates = SCXMLTestHelper.fireEvent(exec, te1);
-            assertEquals(1, currentStates.size());
-            assertEquals("state2", currentStates.iterator().next().getId());
-            TriggerEvent te2 = new TriggerEvent("connection.alerting",
-                TriggerEvent.SIGNAL_EVENT,
-                new ConnectionAlertingPayload(4));
-            currentStates = SCXMLTestHelper.fireEvent(exec, te2);
-            assertEquals(1, currentStates.size());
-            assertEquals("state4", currentStates.iterator().next().getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("state0", currentStates.iterator().next().getId());
+        TriggerEvent te1 = new TriggerEvent("connection.alerting",
+            TriggerEvent.SIGNAL_EVENT, "line2");
+        currentStates = SCXMLTestHelper.fireEvent(exec, te1);
+        assertEquals(1, currentStates.size());
+        assertEquals("state2", currentStates.iterator().next().getId());
+        TriggerEvent te2 = new TriggerEvent("connection.alerting",
+            TriggerEvent.SIGNAL_EVENT,
+            new ConnectionAlertingPayload(4));
+        currentStates = SCXMLTestHelper.fireEvent(exec, te2);
+        assertEquals(1, currentStates.size());
+        assertEquals("state4", currentStates.iterator().next().getId());
     }
 
-    public void testEventdata03Sample() {
+    public void testEventdata03Sample() throws Exception {
         exec = SCXMLTestHelper.getExecutor(eventdata03);
         assertNotNull(exec);
-        try {
-            Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("ten", currentStates.iterator().next().getId());
-            TriggerEvent te = new TriggerEvent("event.foo",
-                TriggerEvent.SIGNAL_EVENT);
-            currentStates = SCXMLTestHelper.fireEvent(exec, te);
-            assertEquals(1, currentStates.size());
-            assertEquals("thirty", currentStates.iterator().next().getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("ten", currentStates.iterator().next().getId());
+        TriggerEvent te = new TriggerEvent("event.foo",
+            TriggerEvent.SIGNAL_EVENT);
+        currentStates = SCXMLTestHelper.fireEvent(exec, te);
+        assertEquals(1, currentStates.size());
+        assertEquals("thirty", currentStates.iterator().next().getId());
     }
 
-    public void testEventdata04Sample() throws InterruptedException {
+    public void testEventdata04Sample() throws Exception {
         SCXML scxml = SCXMLTestHelper.parse(eventdata04);
         Tracer trc = new Tracer();
-        try {
-            exec = new SCXMLExecutor(new JexlEvaluator(), null, trc);
-            exec.setEventdispatcher(new SimpleScheduler(exec));
-            exec.addListener(scxml, trc);
-            exec.setStateMachine(scxml);
-            exec.go();
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        exec = new SCXMLExecutor(new JexlEvaluator(), null, trc);
         assertNotNull(exec);
+        exec.setEventdispatcher(new SimpleScheduler(exec));
+        exec.addListener(scxml, trc);
+        exec.setStateMachine(scxml);
+        exec.go();
         Thread.sleep(200); // let the 100 delay lapse
     }
 

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/NamespacePrefixedXPathsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/NamespacePrefixedXPathsTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/NamespacePrefixedXPathsTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/NamespacePrefixedXPathsTest.java Fri Jan  2 10:34:48 2009
@@ -55,6 +55,7 @@
     /**
      * Set up instance variables required by this test case.
      */
+    @Override
     public void setUp() {
         datamodel03jexl = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/env/jexl/datamodel-03.xml");
@@ -67,6 +68,7 @@
     /**
      * Tear down instance variables required by this test case.
      */
+    @Override
     public void tearDown() {
         datamodel03jexl = datamodel03jsp = null;
         exec01 = exec02 = null;
@@ -76,69 +78,61 @@
      * Test the XPath evaluation
      */
     // JEXL
-    public void testNamespacePrefixedXPathsJexl() {
+    public void testNamespacePrefixedXPathsJexl() throws Exception {
         runtest(exec01);
     }
 
     // EL
-    public void testNamespacePrefixedXPathsEL() {
+    public void testNamespacePrefixedXPathsEL() throws Exception {
         runtest(exec02);
     }
 
     // Same test, since same documents (different expression languages)
-    private void runtest(SCXMLExecutor exec) {
-
-        try {
-
-            // must be in state "ten" at the onset
-            Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("ten", currentStates.iterator().next().getId());
-
-            // should move to "twenty"
-            currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
-            assertEquals(1, currentStates.size());
-            assertEquals("twenty", currentStates.iterator().next().getId());
-
-            // This is set while exiting "ten"
-            Double retval = (Double) exec.getRootContext().get("retval");
-            assertEquals(Double.valueOf("11"), retval);
-
-            // On to "thirty"
-            currentStates = SCXMLTestHelper.fireEvent(exec, "twenty.done");
-            assertEquals(1, currentStates.size());
-            assertEquals("thirty", currentStates.iterator().next().getId());
-            exec = SCXMLTestHelper.testExecutorSerializability(exec);
-
-            // Tests XPath on SCXML actions, set while exiting "twenty"
-            String retvalstr = (String) exec.getRootContext().get("retval");
-            assertEquals("Equal to 20", retvalstr);
-
-            // and so on ...
-            currentStates = SCXMLTestHelper.fireEvent(exec, "thirty.done");
-            assertEquals(1, currentStates.size());
-            assertEquals("forty", currentStates.iterator().next().getId());
-
-            currentStates = SCXMLTestHelper.fireEvent(exec, "forty.done");
-            assertEquals(1, currentStates.size());
-            assertEquals("fifty", currentStates.iterator().next().getId());
-
-            currentStates = SCXMLTestHelper.fireEvent(exec, "fifty.done");
-            assertEquals(1, currentStates.size());
-            assertEquals("sixty", ((State)currentStates.iterator().
-                next()).getId());
-
-            currentStates = SCXMLTestHelper.fireEvent(exec, "sixty.done");
-            assertEquals(1, currentStates.size());
-            assertEquals("seventy", currentStates.iterator().next().getId());
-
-            // done
-            assertTrue(exec.getCurrentStatus().isFinal());
-
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+    private void runtest(SCXMLExecutor exec) throws Exception {
+        // must be in state "ten" at the onset
+        Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("ten", currentStates.iterator().next().getId());
+
+        // should move to "twenty"
+        currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
+        assertEquals(1, currentStates.size());
+        assertEquals("twenty", currentStates.iterator().next().getId());
+
+        // This is set while exiting "ten"
+        Double retval = (Double) exec.getRootContext().get("retval");
+        assertEquals(Double.valueOf("11"), retval);
+
+        // On to "thirty"
+        currentStates = SCXMLTestHelper.fireEvent(exec, "twenty.done");
+        assertEquals(1, currentStates.size());
+        assertEquals("thirty", currentStates.iterator().next().getId());
+        exec = SCXMLTestHelper.testExecutorSerializability(exec);
+
+        // Tests XPath on SCXML actions, set while exiting "twenty"
+        String retvalstr = (String) exec.getRootContext().get("retval");
+        assertEquals("Equal to 20", retvalstr);
+
+        // and so on ...
+        currentStates = SCXMLTestHelper.fireEvent(exec, "thirty.done");
+        assertEquals(1, currentStates.size());
+        assertEquals("forty", currentStates.iterator().next().getId());
+
+        currentStates = SCXMLTestHelper.fireEvent(exec, "forty.done");
+        assertEquals(1, currentStates.size());
+        assertEquals("fifty", currentStates.iterator().next().getId());
+
+        currentStates = SCXMLTestHelper.fireEvent(exec, "fifty.done");
+        assertEquals(1, currentStates.size());
+        assertEquals("sixty", ((State)currentStates.iterator().
+            next()).getId());
+
+        currentStates = SCXMLTestHelper.fireEvent(exec, "sixty.done");
+        assertEquals(1, currentStates.size());
+        assertEquals("seventy", currentStates.iterator().next().getId());
 
+        // done
+        assertTrue(exec.getCurrentStatus().isFinal());
     }
 
     public static void main(String args[]) {

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/SCXMLExecutorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/SCXMLExecutorTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/SCXMLExecutorTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/SCXMLExecutorTest.java Fri Jan  2 10:34:48 2009
@@ -57,6 +57,7 @@
     /**
      * Set up instance variables required by this test case.
      */
+    @Override
     public void setUp() {
         microwave01jsp = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/env/jsp/microwave-01.xml");
@@ -91,6 +92,7 @@
     /**
      * Tear down instance variables required by this test case.
      */
+    @Override
     public void tearDown() {
         microwave01jsp = microwave02jsp = microwave01jexl = microwave02jexl =
             microwave04jexl = microwave05jexl = transitions01 = transitions02 = transitions03 =
@@ -100,34 +102,34 @@
     /**
      * Test the implementation
      */
-    public void testSCXMLExecutorMicrowave01JspSample() {
+    public void testSCXMLExecutorMicrowave01JspSample() throws Exception {
         exec = SCXMLTestHelper.getExecutor(microwave01jsp,
             new SimpleContext(), new ELEvaluator());
         assertNotNull(exec);
         checkMicrowave01Sample();
     }
 
-    public void testSCXMLExecutorMicrowave02JspSample() {
+    public void testSCXMLExecutorMicrowave02JspSample() throws Exception {
         exec = SCXMLTestHelper.getExecutor(microwave02jsp,
             new SimpleContext(), new ELEvaluator());
         assertNotNull(exec);
         checkMicrowave02Sample();
     }
 
-    public void testSCXMLExecutorMicrowave01JexlSample() {
+    public void testSCXMLExecutorMicrowave01JexlSample() throws Exception {
         exec = SCXMLTestHelper.getExecutor(microwave01jexl);
         assertNotNull(exec);
         checkMicrowave01Sample();
     }
 
-    public void testSCXMLExecutorMicrowave02JexlSample() {
+    public void testSCXMLExecutorMicrowave02JexlSample() throws Exception {
         exec = SCXMLTestHelper.getExecutor(microwave02jexl);
         assertNotNull(exec);
         checkMicrowave02Sample();
     }
 
     // Uses SCXMLParser (latest WD)
-    public void testSCXMLExecutorMicrowave03JexlSample() {
+    public void testSCXMLExecutorMicrowave03JexlSample() throws Exception {
         SCXML scxml = SCXMLTestHelper.parse(microwave03jexl);
         assertNotNull(scxml);
         exec = SCXMLTestHelper.getExecutor(scxml);
@@ -136,7 +138,7 @@
     }
 
     // Uses SCXMLParser (latest WD)
-    public void testSCXMLExecutorMicrowave04JexlSample() {
+    public void testSCXMLExecutorMicrowave04JexlSample() throws Exception {
         SCXML scxml = SCXMLTestHelper.parse(microwave04jexl);
         assertNotNull(scxml);
         exec = SCXMLTestHelper.getExecutor(scxml);
@@ -145,7 +147,7 @@
     }
 
     // Uses SCXMLParser (latest WD)
-    public void testSCXMLExecutorMicrowave05JexlSample() {
+    public void testSCXMLExecutorMicrowave05JexlSample() throws Exception {
         SCXML scxml = SCXMLTestHelper.parse(microwave05jexl);
         assertNotNull(scxml);
         exec = SCXMLTestHelper.getExecutor(scxml);
@@ -164,138 +166,106 @@
         assertEquals("twenty", currentStates.iterator().next().getId());
     }
 
-    public void testSCXMLExecutorTransitions01Sample() {
+    public void testSCXMLExecutorTransitions01Sample() throws Exception {
         exec = SCXMLTestHelper.getExecutor(transitions01);
         assertNotNull(exec);
-        try {
-            Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
-            assertEquals(1, currentStates.size());
-            assertEquals("twenty_one", currentStates.iterator().next().getId());
-            currentStates = SCXMLTestHelper.fireEvent(exec, "twenty_one.done");
-            assertEquals(1, currentStates.size());
-            assertEquals("twenty_two", currentStates.iterator().next().getId());
-            currentStates = SCXMLTestHelper.fireEvent(exec, "twenty_two.done");
-            assertEquals(3, exec.getCurrentStatus().getStates().size());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
+        assertEquals(1, currentStates.size());
+        assertEquals("twenty_one", currentStates.iterator().next().getId());
+        currentStates = SCXMLTestHelper.fireEvent(exec, "twenty_one.done");
+        assertEquals(1, currentStates.size());
+        assertEquals("twenty_two", currentStates.iterator().next().getId());
+        currentStates = SCXMLTestHelper.fireEvent(exec, "twenty_two.done");
+        assertEquals(3, exec.getCurrentStatus().getStates().size());
     }
 
-    public void testSCXMLExecutorTransitions02Sample() {
+    public void testSCXMLExecutorTransitions02Sample() throws Exception {
         exec = SCXMLTestHelper.getExecutor(transitions02);
         assertNotNull(exec);
-        try {
-            Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "ten.stay");
-            assertEquals(1, currentStates.size());
-            assertEquals("ten", currentStates.iterator().next().getId());
-            exec = SCXMLTestHelper.testExecutorSerializability(exec);
-            currentStates = SCXMLTestHelper.fireEvent(exec, "ten.self");
-            assertEquals(1, currentStates.size());
-            assertEquals("ten", currentStates.iterator().next().getId());
-            currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
-            assertEquals(1, currentStates.size());
-            assertEquals("twenty", currentStates.iterator().next().getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "ten.stay");
+        assertEquals(1, currentStates.size());
+        assertEquals("ten", currentStates.iterator().next().getId());
+        exec = SCXMLTestHelper.testExecutorSerializability(exec);
+        currentStates = SCXMLTestHelper.fireEvent(exec, "ten.self");
+        assertEquals(1, currentStates.size());
+        assertEquals("ten", currentStates.iterator().next().getId());
+        currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
+        assertEquals(1, currentStates.size());
+        assertEquals("twenty", currentStates.iterator().next().getId());
     }
 
-    public void testSCXMLExecutorTransitions03Sample() {
+    public void testSCXMLExecutorTransitions03Sample() throws Exception {
         exec = SCXMLTestHelper.getExecutor(transitions03);
         assertNotNull(exec);
-        try {
-            Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
-            assertEquals(3, currentStates.size());
-            Set<String> expected = new HashSet<String>();
-            expected.add("twenty_one_2");
-            expected.add("twenty_two_2");
-            expected.add("twenty_three_2");
-            for (TransitionTarget tt : currentStates) {
-                if (!expected.remove(tt.getId())) {
-                    fail("'" + tt.getId()
-                        + "' is not an expected current state ID");
-                }
+        Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
+        assertEquals(3, currentStates.size());
+        Set<String> expected = new HashSet<String>();
+        expected.add("twenty_one_2");
+        expected.add("twenty_two_2");
+        expected.add("twenty_three_2");
+        for (TransitionTarget tt : currentStates) {
+            if (!expected.remove(tt.getId())) {
+                fail("'" + tt.getId()
+                    + "' is not an expected current state ID");
             }
-        } catch (Exception e) {
-            fail(e.getMessage());
         }
     }
 
     // Uses SCXMLParser (latest WD)
-    public void testSCXMLExecutorTransitions04Sample() {
+    public void testSCXMLExecutorTransitions04Sample() throws Exception {
         SCXML scxml = SCXMLTestHelper.parse(transitions04);
         assertNotNull(scxml);
         exec = SCXMLTestHelper.getExecutor(scxml);
         assertNotNull(exec);
-        try {
-            Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
-            assertEquals(3, currentStates.size());
-            Set<String> expected = new HashSet<String>();
-            expected.add("twenty_one_1");
-            expected.add("twenty_two_1");
-            expected.add("twenty_three_1");
-            for (TransitionTarget tt : currentStates) {
-                if (!expected.remove(tt.getId())) {
-                    fail("'" + tt.getId()
-                        + "' is not an expected current state ID");
-                }
+        Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
+        assertEquals(3, currentStates.size());
+        Set<String> expected = new HashSet<String>();
+        expected.add("twenty_one_1");
+        expected.add("twenty_two_1");
+        expected.add("twenty_three_1");
+        for (TransitionTarget tt : currentStates) {
+            if (!expected.remove(tt.getId())) {
+                fail("'" + tt.getId()
+                    + "' is not an expected current state ID");
             }
-            currentStates = SCXMLTestHelper.fireEvent(exec, "bar");
-            assertEquals(1, currentStates.size());
-            assertEquals("thirty", ((State)currentStates.iterator().
-                next()).getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
         }
+        currentStates = SCXMLTestHelper.fireEvent(exec, "bar");
+        assertEquals(1, currentStates.size());
+        assertEquals("thirty", ((State)currentStates.iterator().
+            next()).getId());
     }
 
-    public void testSend01Sample() {
+    public void testSend01Sample() throws Exception {
         exec = SCXMLTestHelper.getExecutor(send01);
         assertNotNull(exec);
-        try {
-            Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("ten", currentStates.iterator().next().getId());
-            currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
-            assertEquals(1, currentStates.size());
-            assertEquals("twenty", currentStates.iterator().next().getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("ten", currentStates.iterator().next().getId());
+        currentStates = SCXMLTestHelper.fireEvent(exec, "ten.done");
+        assertEquals(1, currentStates.size());
+        assertEquals("twenty", currentStates.iterator().next().getId());
     }
 
-    public void testSend02TargettypeSCXMLSample() {
+    public void testSend02TargettypeSCXMLSample() throws Exception {
         exec = SCXMLTestHelper.getExecutor(send02);
         assertNotNull(exec);
-        try {
-            Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("ninety", currentStates.iterator().next().getId());
-            assertTrue(exec.getCurrentStatus().isFinal());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("ninety", currentStates.iterator().next().getId());
+        assertTrue(exec.getCurrentStatus().isFinal());
     }
 
-    private void checkMicrowave01Sample() {
-        try {
-            Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "turn_on");
-            assertEquals(1, currentStates.size());
-            assertEquals("cooking", currentStates.iterator().next().getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+    private void checkMicrowave01Sample() throws Exception {
+        Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "turn_on");
+        assertEquals(1, currentStates.size());
+        assertEquals("cooking", currentStates.iterator().next().getId());
     }
 
-    private void checkMicrowave02Sample() {
-        try {
-            Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "turn_on");
-            assertEquals(2, currentStates.size());
-            String id = ((State)currentStates.iterator().next()).getId();
-            assertTrue(id.equals("closed") || id.equals("cooking"));
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+    private void checkMicrowave02Sample() throws Exception {
+        Set<TransitionTarget> currentStates = SCXMLTestHelper.fireEvent(exec, "turn_on");
+        assertEquals(2, currentStates.size());
+        String id = ((State)currentStates.iterator().next()).getId();
+        assertTrue(id.equals("closed") || id.equals("cooking"));
     }
 
     public static void main(String args[]) {

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/WildcardTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/WildcardTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/WildcardTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/WildcardTest.java Fri Jan  2 10:34:48 2009
@@ -51,6 +51,7 @@
     /**
      * Set up instance variables required by this test case.
      */
+    @Override
     public void setUp() {
         wildcard01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/env/jexl/wildcard-01.xml");
@@ -61,6 +62,7 @@
     /**
      * Tear down instance variables required by this test case.
      */
+    @Override
     public void tearDown() {
         wildcard01 = wildcard02 = null;
     }
@@ -68,32 +70,24 @@
     /**
      * Test the SCXML documents, usage of "_eventdata"
      */
-    public void testWildcard01Sample() {
+    public void testWildcard01Sample() throws Exception {
     	exec = SCXMLTestHelper.getExecutor(wildcard01);
         assertNotNull(exec);
-        try {
-            Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("state1", currentStates.iterator().next().getId());
-            exec = SCXMLTestHelper.testExecutorSerializability(exec);
-            currentStates = SCXMLTestHelper.fireEvent(exec, "foo.bar.baz");
-            assertEquals(1, currentStates.size());
-            assertEquals("state4", currentStates.iterator().next().getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("state1", currentStates.iterator().next().getId());
+        exec = SCXMLTestHelper.testExecutorSerializability(exec);
+        currentStates = SCXMLTestHelper.fireEvent(exec, "foo.bar.baz");
+        assertEquals(1, currentStates.size());
+        assertEquals("state4", currentStates.iterator().next().getId());
     }
 
-    public void testWildcard02Sample() {
+    public void testWildcard02Sample() throws Exception {
         exec = SCXMLTestHelper.getExecutor(SCXMLTestHelper.parse(wildcard02));
         assertNotNull(exec);
-        try {
-            Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("state2", currentStates.iterator().next().getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("state2", currentStates.iterator().next().getId());
     }
 
     public static void main(String args[]) {

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/WizardsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/WizardsTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/WizardsTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/WizardsTest.java Fri Jan  2 10:34:48 2009
@@ -58,6 +58,7 @@
     /**
      * Set up instance variables required by this test case.
      */
+    @Override
     public void setUp() {
         wizard01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/env/jexl/wizard-01.xml");
@@ -68,6 +69,7 @@
     /**
      * Tear down instance variables required by this test case.
      */
+    @Override
     public void tearDown() {
         wizard01 = wizard02 = null;
     }
@@ -75,51 +77,43 @@
     /**
      * Test the wizard style SCXML documents, and send usage
      */
-    public void testWizard01Sample() {
+    public void testWizard01Sample() throws Exception {
     	exec = SCXMLTestHelper.getExecutor(wizard01);
         assertNotNull(exec);
-        try {
-            Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("state1", currentStates.iterator().next().getId());
-            exec = SCXMLTestHelper.testExecutorSerializability(exec);
-            currentStates = SCXMLTestHelper.fireEvent(exec, "event2");
-            assertEquals(1, currentStates.size());
-            assertEquals("state2", currentStates.iterator().next().getId());
-            currentStates = SCXMLTestHelper.fireEvent(exec, "event4");
-            assertEquals(1, currentStates.size());
-            assertEquals("state4", currentStates.iterator().next().getId());
-            currentStates = SCXMLTestHelper.fireEvent(exec, "event3");
-            assertEquals(1, currentStates.size());
-            assertEquals("state3", currentStates.iterator().next().getId());
-            exec = SCXMLTestHelper.testExecutorSerializability(exec);
-            currentStates = SCXMLTestHelper.fireEvent(exec, "event3"); // ensure we stay put
-            assertEquals(1, currentStates.size());
-            assertEquals("state3", currentStates.iterator().next().getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("state1", currentStates.iterator().next().getId());
+        exec = SCXMLTestHelper.testExecutorSerializability(exec);
+        currentStates = SCXMLTestHelper.fireEvent(exec, "event2");
+        assertEquals(1, currentStates.size());
+        assertEquals("state2", currentStates.iterator().next().getId());
+        currentStates = SCXMLTestHelper.fireEvent(exec, "event4");
+        assertEquals(1, currentStates.size());
+        assertEquals("state4", currentStates.iterator().next().getId());
+        currentStates = SCXMLTestHelper.fireEvent(exec, "event3");
+        assertEquals(1, currentStates.size());
+        assertEquals("state3", currentStates.iterator().next().getId());
+        exec = SCXMLTestHelper.testExecutorSerializability(exec);
+        currentStates = SCXMLTestHelper.fireEvent(exec, "event3"); // ensure we stay put
+        assertEquals(1, currentStates.size());
+        assertEquals("state3", currentStates.iterator().next().getId());
     }
 
-    public void testWizard02Sample() {
+    public void testWizard02Sample() throws Exception {
         SCXML scxml = SCXMLTestHelper.parse(wizard02);
         exec = SCXMLTestHelper.getExecutor(new JexlContext(),
             new JexlEvaluator(), scxml, new TestEventDispatcher(),
             new Tracer());
         assertNotNull(exec);
-        try {
-            // If you change this, you must also change
-            // the TestEventDispatcher
-            Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("state2", currentStates.iterator().next().getId());
-            exec = SCXMLTestHelper.testExecutorSerializability(exec);
-            currentStates = SCXMLTestHelper.fireEvent(exec, "event4");
-            assertEquals(1, currentStates.size());
-            assertEquals("state4", currentStates.iterator().next().getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        // If you change this, you must also change
+        // the TestEventDispatcher
+        Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("state2", currentStates.iterator().next().getId());
+        exec = SCXMLTestHelper.testExecutorSerializability(exec);
+        currentStates = SCXMLTestHelper.fireEvent(exec, "event4");
+        assertEquals(1, currentStates.size());
+        assertEquals("state4", currentStates.iterator().next().getId());
     }
 
     static class TestEventDispatcher implements EventDispatcher, Serializable {

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSBindingsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSBindingsTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSBindingsTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSBindingsTest.java Fri Jan  2 10:34:48 2009
@@ -54,6 +54,7 @@
     /**
      * Creates and initializes an SCXML data model in the context.
      */
+    @Override
     protected void setUp() throws Exception {
     }
 
@@ -101,6 +102,7 @@
              fail("JSBindings constructor accepted invalid SCXML context");
 
         } catch (IllegalArgumentException x) {
+             // expected, ignore
         }
     }
 
@@ -113,6 +115,7 @@
              fail("JSBindings constructor accepted invalid Javascript bindings");
 
         } catch (IllegalArgumentException x) {
+             // expected, ignore
         }
     }
 

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSEvaluatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSEvaluatorTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSEvaluatorTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSEvaluatorTest.java Fri Jan  2 10:34:48 2009
@@ -113,6 +113,7 @@
      * Creates and initialises an SCXML data model in the context.
      *
      */
+    @Override
     protected void setUp() throws Exception {
             StringReader reader = new StringReader(SCRIPT);
             InputSource  source = new InputSource (reader);
@@ -198,16 +199,11 @@
      * Tests evaluation with simple standard expressions.
      *
      */
-    public void testStandardExpressions() {
-        try {
-            for (TestItem item: SIMPLE_EXPRESSIONS) {
-                assertEquals("Invalid result: " + item.expression,
-                             item.result,
-                             evaluator.eval(context,item.expression));
-            }
-
-        } catch (Exception x) {
-            fail(x.getMessage());
+    public void testStandardExpressions() throws Exception {
+        for (TestItem item: SIMPLE_EXPRESSIONS) {
+            assertEquals("Invalid result: " + item.expression,
+                         item.result,
+                         evaluator.eval(context,item.expression));
         }
     }
 
@@ -215,19 +211,15 @@
      * Tests evaluation with SCXML context variables.
      *
      */
-    public void testVarExpressions() {
-        try {
-            context.set("fibonacci",12);
+    public void testVarExpressions() throws Exception {
+        context.set("fibonacci",12);
 
-            for (TestItem item: VAR_EXPRESSIONS) {
-                assertNotNull(context.get("fibonacci"));
-                assertEquals (12,context.get("fibonacci"));
-                assertEquals ("Invalid result: " + item.expression,
-                              item.result,
-                              evaluator.eval(context,item.expression));
-            }
-        } catch (Exception x) {
-            fail(x.getMessage());
+        for (TestItem item: VAR_EXPRESSIONS) {
+            assertNotNull(context.get("fibonacci"));
+            assertEquals (12,context.get("fibonacci"));
+            assertEquals ("Invalid result: " + item.expression,
+                          item.result,
+                          evaluator.eval(context,item.expression));
         }
     }
 
@@ -243,6 +235,7 @@
                 fail          ("Evaluated invalid <var... expression: " + item.expression);
 
             } catch (SCXMLExpressionException x) {
+                // expected, ignore
             }
         }
     }
@@ -251,15 +244,10 @@
      * Tests evaluation with SCXML data model expressions.
      *
      */
-    public void testDataModelExpressions() {
-        try {
-            assertEquals("Invalid result: " + "Data(forest,'tree/branch/twig')",
-                         "leaf",
-                         evaluator.eval(context,"Data(forest,'tree/branch/twig')"));
-
-        } catch (Exception x) {
-            fail(x.getMessage());
-        }
+    public void testDataModelExpressions() throws Exception {
+        assertEquals("Invalid result: " + "Data(forest,'tree/branch/twig')",
+                     "leaf",
+                     evaluator.eval(context,"Data(forest,'tree/branch/twig')"));
     }
 
     /**
@@ -274,6 +262,7 @@
             fail          ("Evaluated invalid Data() expression: " + "Data(forestx,'tree/branch/twig')");
 
         } catch (SCXMLExpressionException x) {
+            // expected, ignore
         }
     }
 
@@ -281,56 +270,38 @@
      * Tests evaluation of SCXML data model locations.
      *
      */
-    public void testDataModelLocations() {
+    public void testDataModelLocations() throws Exception {
             assertNotNull(context.get("forest"));
-
-            try {
-                XPath  xpath = XPathFactory.newInstance().newXPath();
-                Node   node  = (Node)   context.get("forest");
-                Node   twig  = (Node)   xpath.evaluate("tree/branch/twig",        node,XPathConstants.NODE);
-
-                assertTrue  ("Invalid result: " + "Data(forest,'tree/branch/twig')",
-                              evaluator.evalLocation(context,"Data(forest,'tree/branch/twig')") instanceof Element);
-
-                assertSame ("Incorrect node returned: " + "Data(forest,'tree/branch/twig')",
-                             twig,
-                             evaluator.evalLocation(context,"Data(forest,'tree/branch/twig')"));
-
-            } catch (Exception x) {
-                fail(x.getMessage());
-            }
+            XPath  xpath = XPathFactory.newInstance().newXPath();
+            Node   node  = (Node)   context.get("forest");
+            Node   twig  = (Node)   xpath.evaluate("tree/branch/twig",        node,XPathConstants.NODE);
+
+            assertTrue  ("Invalid result: " + "Data(forest,'tree/branch/twig')",
+                          evaluator.evalLocation(context,"Data(forest,'tree/branch/twig')") instanceof Element);
+
+            assertSame ("Incorrect node returned: " + "Data(forest,'tree/branch/twig')",
+                         twig,
+                         evaluator.evalLocation(context,"Data(forest,'tree/branch/twig')"));
     }
 
     /**
      * Tests evaluation of invalid SCXML data model locations.
      *
      */
-    public void testInvalidDataModelLocations() {
+    public void testInvalidDataModelLocations() throws Exception {
             assertNotNull(context.get("forest"));
-
-            try {
-                assertNull("Invalid result: " + "Data(forest,'tree/branch/twigx')",
-                           evaluator.evalLocation(context,"Data(forest,'tree/branch/twigx')"));
-
-            } catch (Exception x) {
-                fail(x.getMessage());
-            }
+            assertNull("Invalid result: " + "Data(forest,'tree/branch/twigx')",
+                       evaluator.evalLocation(context,"Data(forest,'tree/branch/twigx')"));
     }
 
     /**
      * Tests evaluation of Javascript functions with variables from SCXML context.
      *
      */
-    public void testScriptFunctions() {
-            context.set("FIVE",5);
-
-        try {
-            assertEquals(5,context.get("FIVE"));
-            assertEquals("Invalid function result",120.0,evaluator.eval(context,FUNCTION));
-
-        } catch (Exception x) {
-            fail(x.getMessage());
-        }
+    public void testScriptFunctions() throws Exception {
+        context.set("FIVE",5);
+        assertEquals(5,context.get("FIVE"));
+        assertEquals("Invalid function result",120.0,evaluator.eval(context,FUNCTION));
     }
 
 

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSExampleTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSExampleTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSExampleTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/javascript/JSExampleTest.java Fri Jan  2 10:34:48 2009
@@ -67,6 +67,7 @@
     /**
      * Set up instance variables required by this test case.
      */
+    @Override
     public void setUp() {
         example01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/env/javascript/example-01.xml");
@@ -75,13 +76,14 @@
     /**
      * Tear down instance variables required by this test case.
      */
+    @Override
     public void tearDown() {
         example01 = null;
     }
 
     // TEST METHODS
 
-    public void testExample01Sample() {
+    public void testExample01Sample() throws Exception {
 
         List<CustomAction> actions  = new ArrayList<CustomAction>();        
         actions.add(new CustomAction("http://commons.apache.org/scxml",
@@ -93,14 +95,10 @@
         exec = SCXMLTestHelper.getExecutor(scxml, context, evaluator);
 
         assertNotNull(exec);
-        try {
-            Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("end", ((State)currentStates.iterator().
-                next()).getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("end", ((State)currentStates.iterator().
+            next()).getId());
     }
 
     // INNER CLASSES
@@ -108,6 +106,7 @@
     public static class EventDataMapTest extends Action {
         private static final long serialVersionUID = 1L;
 
+        @Override
         public void execute(EventDispatcher dispatcher, ErrorReporter reporter,
                 SCInstance instance, Log log, Collection<TriggerEvent> events)
         throws ModelException,SCXMLExpressionException { 

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/jsp/RootContextTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/jsp/RootContextTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/jsp/RootContextTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/jsp/RootContextTest.java Fri Jan  2 10:34:48 2009
@@ -56,6 +56,7 @@
     /**
      * Set up instance variables required by this test case.
      */
+    @Override
     public void setUp() {
         rootCtxSample = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/env/jsp/jsp-rootctx-test.xml");
@@ -68,6 +69,7 @@
     /**
      * Tear down instance variables required by this test case.
      */
+    @Override
     public void tearDown() {
         rootCtxSample = null;
         evaluator = null;
@@ -79,7 +81,7 @@
     /**
      * Test the implementation
      */
-    public void testRootContext() {
+    public void testRootContext() throws Exception {
         assertEquals("1", String.valueOf(rootCtx.get("foo")));
         exec = SCXMLTestHelper.getExecutor(rootCtxSample, rootCtx, evaluator);
         assertEquals("1", String.valueOf(jspCtx.getAttribute("foo")));
@@ -89,13 +91,9 @@
             "rootCtxTest");
         assertNotNull(ctx);
         assertNotNull(ctx.get("bar"));
-        try {
-            assertNull(jspCtx.getVariableResolver().resolveVariable("bar"));
-            assertNotNull(ctx.resolveVariable("bar"));
-            assertEquals(ctx.resolveVariable("bar"), "a brand new value");
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        assertNull(jspCtx.getVariableResolver().resolveVariable("bar"));
+        assertNotNull(ctx.resolveVariable("bar"));
+        assertEquals(ctx.resolveVariable("bar"), "a brand new value");
         assertNotNull(ctx.getVars());
     }
 

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/xpath/XPathExampleTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/xpath/XPathExampleTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/xpath/XPathExampleTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/xpath/XPathExampleTest.java Fri Jan  2 10:34:48 2009
@@ -55,6 +55,7 @@
     /**
      * Set up instance variables required by this test case.
      */
+    @Override
     public void setUp() {
         example01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/env/xpath/example-01.xml");
@@ -63,33 +64,26 @@
     /**
      * Tear down instance variables required by this test case.
      */
+    @Override
     public void tearDown() {
         example01 = null;
     }
 
     // TEST METHODS
 
-    public void testExample01Sample() {
+    public void testExample01Sample() throws Exception {
 
         SCXML scxml = SCXMLTestHelper.parse(example01);
         Evaluator evaluator = null;
-        try {
-            evaluator = new XPathEvaluator();
-        } catch (InstantiationException ie) {
-            fail(ie.getMessage());
-        }
+        evaluator = new XPathEvaluator();
         Context context = new XPathContext(null);
         exec = SCXMLTestHelper.getExecutor(scxml, context, evaluator);
 
         assertNotNull(exec);
-        try {
-            Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("end", ((State)currentStates.iterator().
-                next()).getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("end", ((State)currentStates.iterator().
+            next()).getId());
     }
 
 }

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/invoke/InvokeParamNameTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/invoke/InvokeParamNameTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/invoke/InvokeParamNameTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/invoke/InvokeParamNameTest.java Fri Jan  2 10:34:48 2009
@@ -57,6 +57,7 @@
     static String lastSource;
     static Map<String, Object> lastParams;
     
+    @Override
     public void setUp() {
         invoker04 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/invoke/invoker-04.xml");
@@ -65,6 +66,7 @@
         exec.registerInvokerClass("x-test", DummyInvoker.class);
     }
     
+    @Override
     public void tearDown() {
         exec.unregisterInvokerClass("x-test");    
         invoker04 = null;
@@ -78,44 +80,31 @@
     }
     
     // Tests "param" element with "name" and "expr" attribute
-    public void testNameAndExpr() {
-        try {
-            trigger();
-            assertTrue(lastSource.endsWith("TestSrc"));
-            final Map.Entry<String, Object> e = (Map.Entry<String, Object>)
-                lastParams.entrySet().iterator().next();
-            assertEquals("ding", e.getKey());
-            assertEquals("foo", e.getValue());
-        } catch (ModelException e) {
-           fail("ModelException: " + e.getMessage());
-        }
+    public void testNameAndExpr() throws Exception {
+        trigger();
+        assertTrue(lastSource.endsWith("TestSrc"));
+        final Map.Entry<String, Object> e =
+            lastParams.entrySet().iterator().next();
+        assertEquals("ding", e.getKey());
+        assertEquals("foo", e.getValue());
     }
 
     // Tests "param" element with only a "name" attribute 
-    public void testSoleNameLocation() {
-        try {
-            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());
-        } catch (ModelException e) {
-           fail("ModelException: " + e.getMessage());
-        }
+    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());
     }
 
     // Tests "param" element with a single, wrong "name" attribute
-    public void testWrongNameLocation() {
-        try {
-            trigger(); trigger(); trigger();
-            assertEquals(1, exec.getCurrentStatus().getEvents().size());
-            final TriggerEvent evt = (TriggerEvent) 
-                exec.getCurrentStatus().getEvents().iterator().next(); 
-            assertTrue(evt.getName().endsWith("error.illegalalloc"));
-        } catch (ModelException e) {
-           fail("ModelException: " + e.getMessage());
-        }
+    public void testWrongNameLocation() throws Exception {
+        trigger(); trigger(); trigger();
+        assertEquals(1, exec.getCurrentStatus().getEvents().size());
+        final TriggerEvent evt = exec.getCurrentStatus().getEvents().iterator().next(); 
+        assertTrue(evt.getName().endsWith("error.illegalalloc"));
     }
 
     public static class DummyInvoker implements Invoker {

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/invoke/InvokeTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/invoke/InvokeTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/invoke/InvokeTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/invoke/InvokeTest.java Fri Jan  2 10:34:48 2009
@@ -61,6 +61,7 @@
     /**
      * Set up instance variables required by this test case.
      */
+    @Override
     public void setUp() {
         invoke01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/invoke/invoker-01.xml");
@@ -73,6 +74,7 @@
     /**
      * Tear down instance variables required by this test case.
      */
+    @Override
     public void tearDown() {
         invoke01 = invoke02 = invoke03 = null;
     }
@@ -80,64 +82,49 @@
     /**
      * Test the SCXML documents, usage of &lt;invoke&gt;
      */
-    public void testInvoke01Sample() {
-        try {
-            SCXML scxml = SCXMLParser.parse(invoke01,
-                new SimpleErrorHandler());
-            exec = new SCXMLExecutor(new JexlEvaluator(), new SimpleDispatcher(),
-                new SimpleErrorReporter());
-            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());
-        } catch (Exception e) {
-            e.printStackTrace();
-            fail(e.getMessage());
-        }
-    }
-
-    public void testInvoke02Sample() {
-        try {
-            SCXML scxml = SCXMLParser.parse(invoke02,
-                new SimpleErrorHandler());
-            exec = new SCXMLExecutor(new JexlEvaluator(), new SimpleDispatcher(),
-                new SimpleErrorReporter());
-            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());
-        } catch (Exception e) {
-            e.printStackTrace();
-            fail(e.getMessage());
-        }
-    }
-
-    public void testInvoke03Sample() {
-        try {
-            SCXML scxml = SCXMLParser.parse(invoke03,
-                new SimpleErrorHandler());
-            exec = new SCXMLExecutor(new JexlEvaluator(), new SimpleDispatcher(),
-                new SimpleErrorReporter());
-            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());
-            SCXMLTestHelper.fireEvent(exec, "s1.next");
-            SCXMLTestHelper.fireEvent(exec, "state1.next");
-        } catch (Exception e) {
-            e.printStackTrace();
-            fail(e.getMessage());
-        }
+    public void testInvoke01Sample() throws Exception {
+        SCXML scxml = SCXMLParser.parse(invoke01,
+            new SimpleErrorHandler());
+        exec = new SCXMLExecutor(new JexlEvaluator(), new SimpleDispatcher(),
+            new SimpleErrorReporter());
+        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());
+    }
+
+    public void testInvoke02Sample() throws Exception {
+        SCXML scxml = SCXMLParser.parse(invoke02,
+            new SimpleErrorHandler());
+        exec = new SCXMLExecutor(new JexlEvaluator(), new SimpleDispatcher(),
+            new SimpleErrorReporter());
+        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());
+    }
+
+    public void testInvoke03Sample() throws Exception {
+        SCXML scxml = SCXMLParser.parse(invoke03,
+            new SimpleErrorHandler());
+        exec = new SCXMLExecutor(new JexlEvaluator(), new SimpleDispatcher(),
+            new SimpleErrorReporter());
+        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());
+        SCXMLTestHelper.fireEvent(exec, "s1.next");
+        SCXMLTestHelper.fireEvent(exec, "state1.next");
     }
 
     public static void main(String args[]) {

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/io/StateSrcTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/io/StateSrcTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/io/StateSrcTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/io/StateSrcTest.java Fri Jan  2 10:34:48 2009
@@ -57,6 +57,7 @@
     /**
      * Set up instance variables required by this test case.
      */
+    @Override
     public void setUp() {
         src01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/io/src-test-1.xml");
@@ -69,6 +70,7 @@
     /**
      * Tear down instance variables required by this test case.
      */
+    @Override
     public void tearDown() {
         src01 = src04 = src05 = null;
         scxml = null;
@@ -92,29 +94,23 @@
         assertTrue(exec.getCurrentStatus().isFinal());
     }
 
-    public void testBadSrcInclude() {
+    public void testBadSrcInclude() throws Exception {
         try {
             scxml = SCXMLParser.parse(src04, new SimpleErrorHandler());
             fail("Document with bad <state> src attribute shouldn't be parsed!");
         } catch (SAXException me) {
             assertTrue("Unexpected error message for bad <state> 'src' URI",
                 me.getMessage() != null && me.getMessage().contains("Source attribute in <state src="));
-        } catch (Exception e) {
-            fail("Unexpected exception [" + e.getClass().getName() + ":" +
-                e.getMessage());
         }
     }
 
-    public void testBadSrcFragmentInclude() {
+    public void testBadSrcFragmentInclude() throws Exception {
         try {
             scxml = SCXMLParser.parse(src05, new SimpleErrorHandler());
             fail("Document with bad <state> src attribute shouldn't be parsed!");
         } catch (SAXException me) {
             assertTrue("Unexpected error message for bad <state> 'src' URI fragment",
                 me.getMessage() != null && me.getMessage().contains("URI Fragment in <state src="));
-        } catch (Exception e) {
-            fail("Unexpected exception [" + e.getClass().getName() + ":" +
-                e.getMessage());
         }
     }
 

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/CustomActionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/CustomActionTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/CustomActionTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/CustomActionTest.java Fri Jan  2 10:34:48 2009
@@ -72,13 +72,9 @@
         exec = null;
     }
 
-    public void testAddGoodCustomAction01() {
-        try {
-            new CustomAction("http://my.actions.domain/CUSTOM", "hello",
-                Hello.class);
-        } catch (IllegalArgumentException iae) {
-            fail("Failed to add custom action &quot;Hello&quot;");
-        }
+    public void testAddGoodCustomAction01() throws Exception {
+        new CustomAction("http://my.actions.domain/CUSTOM", "hello",
+            Hello.class);
     }
 
     public void testAddBadCustomAction01() {

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/DatamodelTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/DatamodelTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/DatamodelTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/DatamodelTest.java Fri Jan  2 10:34:48 2009
@@ -58,6 +58,7 @@
     /**
      * Set up instance variables required by this test case.
      */
+    @Override
     public void setUp() {
         datamodel01jexl = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/env/jexl/datamodel-01.xml");
@@ -74,6 +75,7 @@
     /**
      * Tear down instance variables required by this test case.
      */
+    @Override
     public void tearDown() {
         datamodel01jexl = datamodel02jexl = datamodel01jsp = datamodel02jsp = null;
     }
@@ -81,7 +83,7 @@
     /**
      * Test the stateless model, simultaneous executions
      */
-    public void testDatamodelSimultaneousJexl() {
+    public void testDatamodelSimultaneousJexl() throws Exception {
         exec01 = SCXMLTestHelper.getExecutor(datamodel01jexl,
             new JexlContext(), new JexlEvaluator());
         assertNotNull(exec01);
@@ -92,7 +94,7 @@
         runtest();
     }
 
-    public void testDatamodelSimultaneousJsp() {
+    public void testDatamodelSimultaneousJsp() throws Exception {
         exec01 = SCXMLTestHelper.getExecutor(datamodel01jsp,
             new ELContext(), new ELEvaluator());
         assertNotNull(exec01);
@@ -103,7 +105,7 @@
         runtest();
     }
 
-    public void testDatamodelNamespacePrefixedXPaths() {
+    public void testDatamodelNamespacePrefixedXPaths() throws Exception {
         exec01 = SCXMLTestHelper.getExecutor(datamodel02jexl,
             new JexlContext(), new JexlEvaluator());
         assertNotNull(exec01);
@@ -135,54 +137,46 @@
         assertEquals("thirty", currentStates.iterator().next().getId());
     }
 
-    private void runtest() {
-        try {
-            //// Interleaved
-            // exec01
-            Set<TransitionTarget> currentStates = exec01.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            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());
-            // exec02
-            currentStates = exec02.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("ten", currentStates.iterator().next().getId());
-            // exec01
-            currentStates = fireEvent("twenty.done", exec01);
-            assertEquals(1, currentStates.size());
-            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());
-            exec02 = SCXMLTestHelper.testExecutorSerializability(exec02);
-            currentStates = fireEvent("twenty.done", exec02);
-            assertEquals(1, currentStates.size());
-            assertEquals("thirty", currentStates.iterator().next().getId());
-            currentStates = fireEvent("thirty.done", exec02);
-            assertEquals(1, currentStates.size());
-            assertEquals("forty", currentStates.iterator().next().getId());
-            // exec01
-            currentStates = fireEvent("thirty.done", exec01);
-            assertEquals(1, currentStates.size());
-            assertEquals("forty", currentStates.iterator().next().getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+    private void runtest() throws Exception {
+        //// Interleaved
+        // exec01
+        Set<TransitionTarget> currentStates = exec01.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        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());
+        // exec02
+        currentStates = exec02.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("ten", currentStates.iterator().next().getId());
+        // exec01
+        currentStates = fireEvent("twenty.done", exec01);
+        assertEquals(1, currentStates.size());
+        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());
+        exec02 = SCXMLTestHelper.testExecutorSerializability(exec02);
+        currentStates = fireEvent("twenty.done", exec02);
+        assertEquals(1, currentStates.size());
+        assertEquals("thirty", currentStates.iterator().next().getId());
+        currentStates = fireEvent("thirty.done", exec02);
+        assertEquals(1, currentStates.size());
+        assertEquals("forty", currentStates.iterator().next().getId());
+        // exec01
+        currentStates = fireEvent("thirty.done", exec01);
+        assertEquals(1, currentStates.size());
+        assertEquals("forty", currentStates.iterator().next().getId());
     }
 
-    private Set<TransitionTarget> fireEvent(String name, SCXMLExecutor exec) {
+    private Set<TransitionTarget> fireEvent(String name, SCXMLExecutor exec) throws Exception {
         TriggerEvent[] evts = {new TriggerEvent(name,
                 TriggerEvent.SIGNAL_EVENT, null)};
-        try {
-            exec.triggerEvents(evts);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        exec.triggerEvents(evts);
         return exec.getCurrentStatus().getStates();
     }
 

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/HistoryTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/HistoryTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/HistoryTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/HistoryTest.java Fri Jan  2 10:34:48 2009
@@ -52,6 +52,7 @@
     /**
      * Set up instance variables required by this test case.
      */   
+    @Override
     public void setUp() {
         history = new History();
         shallow01 = this.getClass().getClassLoader().
@@ -65,6 +66,7 @@
     /**
      * Tear down instance variables required by this test case.
      */
+    @Override
     public void tearDown() {
         history = null;
         shallow01 = deep01 = defaults01 = null;
@@ -86,12 +88,12 @@
         assertFalse(history.isDeep());
     }
 
-    public void testShallowHistory01() {
+    public void testShallowHistory01() throws Exception {
         exec = SCXMLTestHelper.getExecutor(shallow01);
         runHistoryFlow();
     }
 
-    public void testDeepHistory01() {
+    public void testDeepHistory01() throws Exception {
         exec = SCXMLTestHelper.getExecutor(deep01);
         runHistoryFlow();
     }
@@ -109,7 +111,7 @@
         assertEquals("state31", currentStates.iterator().next().getId());
     }
 
-    private void runHistoryFlow() {
+    private void runHistoryFlow() throws Exception {
         Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
         assertEquals(1, currentStates.size());
         assertEquals("phase1", currentStates.iterator().next().getId());
@@ -120,11 +122,7 @@
         assertEquals("phase2", pauseAndResume());
         assertEquals("phase3", nextPhase());
         assertEquals("phase3", pauseAndResume());
-        try {
-            exec.reset();
-        } catch (ModelException me) {
-            fail(me.getMessage());
-        }
+        exec.reset();
         currentStates = exec.getCurrentStatus().getStates();
         assertEquals(1, currentStates.size());
         assertEquals("phase1", ((State)currentStates.iterator().

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/ParallelTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/ParallelTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/ParallelTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/ParallelTest.java Fri Jan  2 10:34:48 2009
@@ -48,6 +48,7 @@
     private URL parallel01, parallel02, parallel03;
     private SCXMLExecutor exec;
     
+    @Override
     public void setUp() {
         parallel01 = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/model/parallel-01.xml");
@@ -57,51 +58,40 @@
             getResource("org/apache/commons/scxml/model/parallel-03.xml");
     }
 
+    @Override
     public void tearDown() {
         parallel01 = parallel02 = parallel03 = null;
         exec = null;
     }
 
-    public void testParallel01() {
+    public void testParallel01() throws Exception {
         exec = SCXMLTestHelper.getExecutor(parallel01);
         assertNotNull(exec);
-        try {
-            SCXMLTestHelper.assertPostTriggerState(exec, "foo", "end");
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        SCXMLTestHelper.assertPostTriggerState(exec, "foo", "end");
     }
 
-    public void testParallel02() {
+    public void testParallel02() throws Exception {
         exec = SCXMLTestHelper.getExecutor(parallel02);
         assertNotNull(exec);
-        try {
-            SCXMLTestHelper.assertPostTriggerStates(exec, "dummy.event", new String[] { "state01", "state02" });
-            SCXMLTestHelper.assertPostTriggerState(exec, "event1", "state1");
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        SCXMLTestHelper.assertPostTriggerStates(exec, "dummy.event", new String[] { "state01", "state02" });
+        SCXMLTestHelper.assertPostTriggerState(exec, "event1", "state1");
     }
 
-    public void testParallel03() {
+    public void testParallel03() throws Exception {
         exec = SCXMLTestHelper.getExecutor(parallel03);
         assertNotNull(exec);
-        try {
-            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());
-            SCXMLTestHelper.assertPostTriggerStates(exec, "foo", new String[] { "para12", "para21" });
-            count = Builtin.data(namespaces, data, "root/count");
-            assertEquals("7.0", count.toString());
-            SCXMLTestHelper.assertPostTriggerState(exec, "bar", "end");
-            count = Builtin.data(namespaces, data, "root/count");
-            assertEquals("14.0", count.toString());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        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());
+        SCXMLTestHelper.assertPostTriggerStates(exec, "foo", new String[] { "para12", "para21" });
+        count = Builtin.data(namespaces, data, "root/count");
+        assertEquals("7.0", count.toString());
+        SCXMLTestHelper.assertPostTriggerState(exec, "bar", "end");
+        count = Builtin.data(namespaces, data, "root/count");
+        assertEquals("14.0", count.toString());
     }
 
 }

Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/StatelessModelTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/StatelessModelTest.java?rev=730808&r1=730807&r2=730808&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/StatelessModelTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/model/StatelessModelTest.java Fri Jan  2 10:34:48 2009
@@ -57,6 +57,7 @@
     /**
      * Set up instance variables required by this test case.
      */
+    @Override
     public void setUp() {
         stateless01jexl = this.getClass().getClassLoader().
             getResource("org/apache/commons/scxml/env/jexl/stateless-01.xml");
@@ -73,6 +74,7 @@
     /**
      * Tear down instance variables required by this test case.
      */
+    @Override
     public void tearDown() {
         stateless01jexl = null;
     }
@@ -80,7 +82,7 @@
     /**
      * Test the stateless model, simultaneous executions, JEXL expressions
      */
-    public void testStatelessModelSimultaneousJexl() {
+    public void testStatelessModelSimultaneousJexl() throws Exception {
     	// parse once, use many times
         exec01 = SCXMLTestHelper.getExecutor(scxml01jexl);
         assertNotNull(exec01);
@@ -93,7 +95,7 @@
     /**
      * Test the stateless model, sequential executions, JEXL expressions
      */
-    public void testStatelessModelSequentialJexl() {
+    public void testStatelessModelSequentialJexl() throws Exception {
         // rinse and repeat
         for (int i = 0; i < 3; i++) {
             exec01 = SCXMLTestHelper.getExecutor(scxml01jexl);
@@ -105,7 +107,7 @@
     /**
      * Test the stateless model, simultaneous executions, EL expressions
      */
-    public void testStatelessModelSimultaneousEl() {
+    public void testStatelessModelSimultaneousEl() throws Exception {
     	// parse once, use many times
         exec01 = SCXMLTestHelper.getExecutor(scxml01jsp,
             new ELContext(), new ELEvaluator());
@@ -120,7 +122,7 @@
     /**
      * Test the stateless model, sequential executions, EL expressions
      */
-    public void testStatelessModelSequentialEl() {
+    public void testStatelessModelSequentialEl() throws Exception {
         // rinse and repeat
         for (int i = 0; i < 3; i++) {
             exec01 = SCXMLTestHelper.getExecutor(scxml01jsp,
@@ -133,7 +135,7 @@
     /**
      * Test sharing a single SCXML object between two executors
      */
-    public void testStatelessModelParallelSharedSCXML() {
+    public void testStatelessModelParallelSharedSCXML() throws Exception {
         exec01 = SCXMLTestHelper.getExecutor(scxml01par);
         assertNotNull(exec01);
         exec02 = SCXMLTestHelper.getExecutor(scxml01par);
@@ -162,7 +164,7 @@
     /**
      * Test sharing two SCXML objects between one executor (not recommended)
      */
-    public void testStatelessModelParallelSwapSCXML() {
+    public void testStatelessModelParallelSwapSCXML() throws Exception {
         exec01 = SCXMLTestHelper.getExecutor(scxml01par);
         assertNotNull(exec01);
         assertTrue(scxml01par != scxml02par);
@@ -208,63 +210,51 @@
         fail(label + " in unexpected state " + cs1);
     }
 
-    private void runSimultaneousTest() {
-        try {
-            //// Interleaved
-            // exec01
-            Set<TransitionTarget> currentStates = exec01.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("ten", currentStates.iterator().next().getId());
-            currentStates = fireEvent("ten.done", exec01);
-            assertEquals(1, currentStates.size());
-            assertEquals("twenty", currentStates.iterator().next().getId());
-            // exec02
-            currentStates = exec02.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("ten", currentStates.iterator().next().getId());
-            // exec01
-            currentStates = fireEvent("twenty.done", exec01);
-            assertEquals(1, currentStates.size());
-            assertEquals("thirty", currentStates.iterator().next().getId());
-            // exec02
-            currentStates = fireEvent("ten.done", exec02);
-            assertEquals(1, currentStates.size());
-            assertEquals("twenty", currentStates.iterator().next().getId());
-            currentStates = fireEvent("twenty.done", exec02);
-            assertEquals(1, currentStates.size());
-            assertEquals("thirty", currentStates.iterator().next().getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+    private void runSimultaneousTest() throws Exception {
+        //// Interleaved
+        // exec01
+        Set<TransitionTarget> currentStates = exec01.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("ten", currentStates.iterator().next().getId());
+        currentStates = fireEvent("ten.done", exec01);
+        assertEquals(1, currentStates.size());
+        assertEquals("twenty", currentStates.iterator().next().getId());
+        // exec02
+        currentStates = exec02.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("ten", currentStates.iterator().next().getId());
+        // exec01
+        currentStates = fireEvent("twenty.done", exec01);
+        assertEquals(1, currentStates.size());
+        assertEquals("thirty", currentStates.iterator().next().getId());
+        // exec02
+        currentStates = fireEvent("ten.done", exec02);
+        assertEquals(1, currentStates.size());
+        assertEquals("twenty", currentStates.iterator().next().getId());
+        currentStates = fireEvent("twenty.done", exec02);
+        assertEquals(1, currentStates.size());
+        assertEquals("thirty", currentStates.iterator().next().getId());
     }
 
-    private void runSequentialTest() {
-        try {
-            Set<TransitionTarget> currentStates = exec01.getCurrentStatus().getStates();
-            assertEquals(1, currentStates.size());
-            assertEquals("ten", ((State)currentStates.iterator().
-                next()).getId());
-            currentStates = fireEvent("ten.done", exec01);
-            assertEquals(1, currentStates.size());
-            assertEquals("twenty", ((State)currentStates.iterator().
-                next()).getId());
-            currentStates = fireEvent("twenty.done", exec01);
-            assertEquals(1, currentStates.size());
-            assertEquals("thirty", ((State)currentStates.iterator().
-                next()).getId());
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }    	
+    private void runSequentialTest() throws Exception {
+        Set<TransitionTarget> currentStates = exec01.getCurrentStatus().getStates();
+        assertEquals(1, currentStates.size());
+        assertEquals("ten", ((State)currentStates.iterator().
+            next()).getId());
+        currentStates = fireEvent("ten.done", exec01);
+        assertEquals(1, currentStates.size());
+        assertEquals("twenty", ((State)currentStates.iterator().
+            next()).getId());
+        currentStates = fireEvent("twenty.done", exec01);
+        assertEquals(1, currentStates.size());
+        assertEquals("thirty", ((State)currentStates.iterator().
+            next()).getId());
     }
 
-    private Set<TransitionTarget> fireEvent(String name, SCXMLExecutor exec) {
+    private Set<TransitionTarget> fireEvent(String name, SCXMLExecutor exec) throws Exception {
         TriggerEvent[] evts = {new TriggerEvent(name,
                 TriggerEvent.SIGNAL_EVENT, null)};
-        try {
-            exec.triggerEvents(evts);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
+        exec.triggerEvents(evts);
         return exec.getCurrentStatus().getStates();
     }
 



Mime
View raw message