commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r612306 - /commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/SCXMLTestHelper.java
Date Tue, 15 Jan 2008 23:22:18 GMT
Author: rahul
Date: Tue Jan 15 15:22:14 2008
New Revision: 612306

URL: http://svn.apache.org/viewvc?rev=612306&view=rev
Log:
Use for-each to reduce clutter.

Modified:
    commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/SCXMLTestHelper.java

Modified: commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/SCXMLTestHelper.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/SCXMLTestHelper.java?rev=612306&r1=612305&r2=612306&view=diff
==============================================================================
--- commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/SCXMLTestHelper.java
(original)
+++ commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/SCXMLTestHelper.java
Tue Jan 15 15:22:14 2008
@@ -25,7 +25,6 @@
 import java.io.ObjectOutputStream;
 import java.net.URL;
 import java.util.Arrays;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -289,16 +288,15 @@
             Assert.fail("Must specify an array of one or more "
                 + "expected state IDs");
         }
-        Set currentStates = fireEvent(exec, triggerEvent);
+        Set<TransitionTarget> currentStates = fireEvent(exec, triggerEvent);
         int n = expectedStateIds.length;
         Assert.assertEquals("Expected " + n + " simple (leaf) state(s) "
             + " on firing event " + triggerEvent + " but found "
             + currentStates.size() + " states instead.",
             n, currentStates.size());
         List expectedStateIdList = Arrays.asList(expectedStateIds);
-        Iterator iter = currentStates.iterator();
-        while (iter.hasNext()) {
-            String stateId = ((State) iter.next()).getId();
+        for (TransitionTarget tt : currentStates) {
+            String stateId = tt.getId();
             if(!expectedStateIdList.remove(stateId)) {
                 Assert.fail("Expected state with id '" + stateId
                     + "' in current states on firing event "



Mime
View raw message