commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r600775 - /commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/SCXMLTestHelper.java
Date Tue, 04 Dec 2007 03:26:00 GMT
Author: rahul
Date: Mon Dec  3 19:26:00 2007
New Revision: 600775

URL: http://svn.apache.org/viewvc?rev=600775&view=rev
Log:
Safer way to create contexts, suggested as part of SCXML-54
Patch by Mike Tillberg <mtillberg at comcast dot net>

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

Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/SCXMLTestHelper.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/SCXMLTestHelper.java?rev=600775&r1=600774&r2=600775&view=diff
==============================================================================
--- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/SCXMLTestHelper.java
(original)
+++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/SCXMLTestHelper.java
Mon Dec  3 19:26:00 2007
@@ -33,7 +33,6 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.commons.scxml.env.SimpleDispatcher;
 import org.apache.commons.scxml.env.Tracer;
-import org.apache.commons.scxml.env.jexl.JexlContext;
 import org.apache.commons.scxml.env.jexl.JexlEvaluator;
 import org.apache.commons.scxml.io.SCXMLDigester;
 import org.apache.commons.scxml.io.SCXMLParser;
@@ -138,8 +137,8 @@
 
     public static SCXMLExecutor getExecutor(SCXML scxml,
             SCXMLSemantics semantics) {
-        Context context = new JexlContext();
         Evaluator evaluator = new JexlEvaluator();
+        Context context = evaluator.newContext(null);
         EventDispatcher ed = new SimpleDispatcher();
         Tracer trc = new Tracer();
         return getExecutor(context, evaluator, scxml, ed, trc, semantics);
@@ -148,7 +147,8 @@
     public static SCXMLExecutor getExecutor(Evaluator evaluator, SCXML scxml) {
         EventDispatcher ed = new SimpleDispatcher();
         Tracer trc = new Tracer();
-        Context context = new JexlContext();
+        Assert.assertNotNull("Null evaluator", evaluator);
+        Context context = evaluator.newContext(null);
         return getExecutor(context, evaluator, scxml, ed, trc);
     }
 



Mime
View raw message