velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dish...@apache.org
Subject svn commit: r1358581 - /velocity/sandbox/jsr223/velocity-engine-scripting/src/test/java/org/apache/velocity/script/test/ScriptEngineTest.java
Date Sat, 07 Jul 2012 14:48:45 GMT
Author: dishara
Date: Sat Jul  7 14:48:45 2012
New Revision: 1358581

URL: http://svn.apache.org/viewvc?rev=1358581&view=rev
Log:
Adding tests

Modified:
    velocity/sandbox/jsr223/velocity-engine-scripting/src/test/java/org/apache/velocity/script/test/ScriptEngineTest.java

Modified: velocity/sandbox/jsr223/velocity-engine-scripting/src/test/java/org/apache/velocity/script/test/ScriptEngineTest.java
URL: http://svn.apache.org/viewvc/velocity/sandbox/jsr223/velocity-engine-scripting/src/test/java/org/apache/velocity/script/test/ScriptEngineTest.java?rev=1358581&r1=1358580&r2=1358581&view=diff
==============================================================================
--- velocity/sandbox/jsr223/velocity-engine-scripting/src/test/java/org/apache/velocity/script/test/ScriptEngineTest.java
(original)
+++ velocity/sandbox/jsr223/velocity-engine-scripting/src/test/java/org/apache/velocity/script/test/ScriptEngineTest.java
Sat Jul  7 14:48:45 2012
@@ -64,10 +64,15 @@ public class ScriptEngineTest extends Ab
     }
 
     public void testEngineEvals() throws ScriptException {
-//        System.setProperty(VelocityScriptEngine.VELOCITY_PROPERTIES,  "../resources/velocity.properties")
;
+        String path = ScriptEngineTest.class.getProtectionDomain().getCodeSource().getLocation().getPath();
+        String propertyFile = path.substring(0,path.indexOf("target/test-classes")) +
+                "src/test/java/org/apache/velocity/script/test/resources/velocity.properties";
+        System.setProperty(VelocityScriptEngine.VELOCITY_PROPERTIES,  propertyFile) ;
         //Comment test case
-//        Object result = engine.eval("## This is a comment ");
-//        assertTrue(Boolean.valueOf(result.toString()));
+        Object result = engine.eval("## This is a comment ");
+        assertTrue(Boolean.valueOf(result.toString()));
+
+        //TODO add more engine script evaluation test cases
 
     }
 



Mime
View raw message