You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ra...@apache.org on 2006/02/05 09:17:29 UTC

svn commit: r374983 - in /jakarta/commons/sandbox/scxml/branches/STATELESS_MODEL/src/test/java/org/apache/commons/scxml: env/jsp/RootContextTest.java model/ActionsTest.java

Author: rahul
Date: Sun Feb  5 00:17:26 2006
New Revision: 374983

URL: http://svn.apache.org/viewcvs?rev=374983&view=rev
Log:
1) No longer using a flat document context.
2) Alphabetize imports in ActionsTest.
3) Rename ctx --> rootCtx as was more appropriate.

Modified:
    jakarta/commons/sandbox/scxml/branches/STATELESS_MODEL/src/test/java/org/apache/commons/scxml/env/jsp/RootContextTest.java
    jakarta/commons/sandbox/scxml/branches/STATELESS_MODEL/src/test/java/org/apache/commons/scxml/model/ActionsTest.java

Modified: jakarta/commons/sandbox/scxml/branches/STATELESS_MODEL/src/test/java/org/apache/commons/scxml/env/jsp/RootContextTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/branches/STATELESS_MODEL/src/test/java/org/apache/commons/scxml/env/jsp/RootContextTest.java?rev=374983&r1=374982&r2=374983&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/branches/STATELESS_MODEL/src/test/java/org/apache/commons/scxml/env/jsp/RootContextTest.java (original)
+++ jakarta/commons/sandbox/scxml/branches/STATELESS_MODEL/src/test/java/org/apache/commons/scxml/env/jsp/RootContextTest.java Sun Feb  5 00:17:26 2006
@@ -49,7 +49,7 @@
     private URL rootCtxSample;
     private ELEvaluator evaluator;
     private JspContext jspCtx;
-    private RootContext ctx;
+    private RootContext rootCtx;
     private SCXMLExecutor exec;
 
     /**
@@ -61,7 +61,7 @@
         evaluator = new ELEvaluator();
         jspCtx = new MockJspContext();
         jspCtx.setAttribute("foo", "1");
-        ctx = new RootContext(jspCtx);
+        rootCtx = new RootContext(jspCtx);
     }
 
     /**
@@ -71,7 +71,7 @@
         rootCtxSample = null;
         evaluator = null;
         jspCtx = null;
-        ctx = null;
+        rootCtx = null;
         exec = null;
     }
 
@@ -79,11 +79,14 @@
      * Test the implementation
      */
     public void testRootContext() {
-        assertEquals("1", String.valueOf(ctx.get("foo")));
-        exec = SCXMLTestHelper.getExecutor(rootCtxSample, ctx, evaluator);
+        assertEquals("1", String.valueOf(rootCtx.get("foo")));
+        exec = SCXMLTestHelper.getExecutor(rootCtxSample, rootCtx, evaluator);
         assertEquals("1", String.valueOf(jspCtx.getAttribute("foo")));
-        assertEquals("2", String.valueOf(ctx.get("foo")));
+        assertEquals("2", String.valueOf(rootCtx.get("foo")));
         assertNull(jspCtx.getAttribute("bar"));
+        ELContext ctx = (ELContext) SCXMLTestHelper.lookupContext(exec,
+            "rootCtxTest");
+        assertNotNull(ctx);
         assertNotNull(ctx.get("bar"));
         try {
             assertNull(jspCtx.getVariableResolver().resolveVariable("bar"));

Modified: jakarta/commons/sandbox/scxml/branches/STATELESS_MODEL/src/test/java/org/apache/commons/scxml/model/ActionsTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/branches/STATELESS_MODEL/src/test/java/org/apache/commons/scxml/model/ActionsTest.java?rev=374983&r1=374982&r2=374983&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/branches/STATELESS_MODEL/src/test/java/org/apache/commons/scxml/model/ActionsTest.java (original)
+++ jakarta/commons/sandbox/scxml/branches/STATELESS_MODEL/src/test/java/org/apache/commons/scxml/model/ActionsTest.java Sun Feb  5 00:17:26 2006
@@ -22,10 +22,10 @@
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
 
-import org.apache.commons.scxml.env.jsp.ELEvaluator;
-import org.apache.commons.scxml.env.jsp.ELContext;
 import org.apache.commons.scxml.SCXMLExecutor;
 import org.apache.commons.scxml.SCXMLTestHelper;
+import org.apache.commons.scxml.env.jsp.ELContext;
+import org.apache.commons.scxml.env.jsp.ELEvaluator;
 /**
  * Unit tests {@link org.apache.commons.scxml.model.Assign}.
  * Unit tests {@link org.apache.commons.scxml.model.Cancel}.
@@ -83,6 +83,8 @@
      */
     public void testModelActions() {
         exec = SCXMLTestHelper.getExecutor(actionsSample, ctx, evaluator);
+        ELContext ctx = (ELContext) SCXMLTestHelper.lookupContext(exec,
+            "actionsTest");
         assertEquals((String) ctx.get("foo"), "foobar");
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org