commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r799902 - /commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java
Date Sat, 01 Aug 2009 17:19:21 GMT
Author: sebb
Date: Sat Aug  1 17:19:21 2009
New Revision: 799902

URL: http://svn.apache.org/viewvc?rev=799902&view=rev
Log:
Another simple test

Modified:
    commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java

Modified: commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java?rev=799902&r1=799901&r2=799902&view=diff
==============================================================================
--- commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java
(original)
+++ commons/proper/jexl/branches/2.0/src/test/org/apache/commons/jexl/scripting/JexlScriptEngineTest.java
Sat Aug  1 17:19:21 2009
@@ -81,6 +81,18 @@
         assertEquals(Long.valueOf(8),engine.get("both"));
         assertEquals(Integer.valueOf(42),engine.get("newvar"));
         assertNull(manager.get("newvar"));
-        // TODO how to delete variables in Jexl?
+    }
+
+    public void testDottedNames() throws Exception {
+        ScriptEngine engine;
+        ScriptEngineManager manager = new ScriptEngineManager();
+        assertNotNull("Manager should not be null", manager);
+        engine = manager.getEngineByName("JEXL");
+        assertNotNull("Engine should not be null (JEXL)", engine);
+        engine.eval("this.is.a.test=null");
+        assertNull(engine.get("this.is.a.test"));
+        assertEquals(Boolean.TRUE, engine.eval("empty(this.is.a.test)"));
+        final Object mymap = engine.eval("testmap=[ 'key1' => 'value1', 'key2' => 'value2'
]");
+        assertEquals("{key1=value1, key2=value2}",mymap.toString());
     }
 }



Mime
View raw message