You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ra...@apache.org on 2008/04/26 03:40:56 UTC
svn commit: r651774 - in
/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env:
StopWatch.java javascript/JSExampleTest.java jexl/StaticMethodTest.java
jsp/MockJspContext.java
Author: rahul
Date: Fri Apr 25 18:40:53 2008
New Revision: 651774
URL: http://svn.apache.org/viewvc?rev=651774&view=rev
Log:
Type safety improvements.
Modified:
commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/StopWatch.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/jexl/StaticMethodTest.java
commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/jsp/MockJspContext.java
Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/StopWatch.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/StopWatch.java?rev=651774&r1=651773&r2=651774&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/StopWatch.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/StopWatch.java Fri Apr 25 18:40:53 2008
@@ -20,7 +20,7 @@
import java.util.Timer;
import java.util.TimerTask;
-import org.apache.commons.scxml.env.AbstractStateMachine;
+import org.apache.commons.scxml.model.TransitionTarget;
/**
* A SCXML document driven stop watch.
@@ -94,9 +94,8 @@
// used by the demonstration (see StopWatchDisplay usecase)
public String getCurrentState() {
- Set states = getEngine().getCurrentStatus().getStates();
- return ((org.apache.commons.scxml.model.State) states.iterator().
- next()).getId();
+ Set<TransitionTarget> states = getEngine().getCurrentStatus().getStates();
+ return states.iterator().next().getId();
}
private void increment() {
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=651774&r1=651773&r2=651774&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 Apr 25 18:40:53 2008
@@ -29,7 +29,7 @@
import org.apache.commons.scxml.SCXMLExecutor;
import org.apache.commons.scxml.SCXMLTestHelper;
import org.apache.commons.scxml.model.SCXML;
-import org.apache.commons.scxml.model.State;
+import org.apache.commons.scxml.model.TransitionTarget;
/**
* SCXML application for the example JavaScript scripts.
@@ -77,10 +77,9 @@
assertNotNull(exec);
try {
- Set currentStates = exec.getCurrentStatus().getStates();
+ Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
assertEquals(1, currentStates.size());
- assertEquals("end", ((State)currentStates.iterator().
- next()).getId());
+ assertEquals("end", currentStates.iterator().next().getId());
} catch (Exception e) {
fail(e.getMessage());
}
Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/jexl/StaticMethodTest.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/jexl/StaticMethodTest.java?rev=651774&r1=651773&r2=651774&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/jexl/StaticMethodTest.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/jexl/StaticMethodTest.java Fri Apr 25 18:40:53 2008
@@ -26,7 +26,7 @@
import org.apache.commons.scxml.Context;
import org.apache.commons.scxml.SCXMLExecutor;
import org.apache.commons.scxml.SCXMLTestHelper;
-import org.apache.commons.scxml.model.State;
+import org.apache.commons.scxml.model.TransitionTarget;
public class StaticMethodTest extends TestCase {
@@ -65,10 +65,9 @@
jc.set("System", System.class);
SCXMLExecutor exec = SCXMLTestHelper.getExecutor(staticmethod,
jc, new JexlEvaluator());
- Set currentStates = exec.getCurrentStatus().getStates();
+ Set<TransitionTarget> currentStates = exec.getCurrentStatus().getStates();
assertEquals(1, currentStates.size());
- assertEquals("static", ((State)currentStates.iterator().
- next()).getId());
+ assertEquals("static", currentStates.iterator().next().getId());
}
}
Modified: commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/jsp/MockJspContext.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/jsp/MockJspContext.java?rev=651774&r1=651773&r2=651774&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/jsp/MockJspContext.java (original)
+++ commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/env/jsp/MockJspContext.java Fri Apr 25 18:40:53 2008
@@ -68,7 +68,7 @@
public int getAttributesScope(String name) {
return 1;
}
- public Enumeration getAttributeNamesInScope(int scope) {
+ public Enumeration<String> getAttributeNamesInScope(int scope) {
return null;
}
public JspWriter getOut() {