You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jakarta.apache.org by se...@apache.org on 2010/06/03 01:34:22 UTC
svn commit: r950822 - in /jakarta/bsf/branches/bsf3.x/testing:
e4x/src/test/java/org/apache/bsf/testing/e4x/
javascript/src/test/java/org/apache/bsf/testing/javascript/
python/src/test/java/org/apache/bsf/testing/python/
Author: sebb
Date: Wed Jun 2 23:34:22 2010
New Revision: 950822
URL: http://svn.apache.org/viewvc?rev=950822&view=rev
Log:
Check engine can be found
Modified:
jakarta/bsf/branches/bsf3.x/testing/e4x/src/test/java/org/apache/bsf/testing/e4x/HelloTestCase.java
jakarta/bsf/branches/bsf3.x/testing/javascript/src/test/java/org/apache/bsf/testing/javascript/JavaScriptTestcase.java
jakarta/bsf/branches/bsf3.x/testing/python/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java
Modified: jakarta/bsf/branches/bsf3.x/testing/e4x/src/test/java/org/apache/bsf/testing/e4x/HelloTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/bsf/branches/bsf3.x/testing/e4x/src/test/java/org/apache/bsf/testing/e4x/HelloTestCase.java?rev=950822&r1=950821&r2=950822&view=diff
==============================================================================
--- jakarta/bsf/branches/bsf3.x/testing/e4x/src/test/java/org/apache/bsf/testing/e4x/HelloTestCase.java (original)
+++ jakarta/bsf/branches/bsf3.x/testing/e4x/src/test/java/org/apache/bsf/testing/e4x/HelloTestCase.java Wed Jun 2 23:34:22 2010
@@ -67,6 +67,7 @@ public class HelloTestCase extends TestC
// The default Rhino implementation provided by Java 1.6 does not support E4X,
// so use the unique name supported by the 1.6R7 version factory.
ScriptEngine engine = new ScriptEngineManager().getEngineByName("rhino-nonjdk");
+ assertNotNull("engine should not be null",engine);
XMLHelper convertor = XMLHelper.getArgHelper(engine);
Object o = convertor.toScriptXML(createOMElement("<a><b>petra</b></a>"));
OMElement om = convertor.toOMElement(o);
Modified: jakarta/bsf/branches/bsf3.x/testing/javascript/src/test/java/org/apache/bsf/testing/javascript/JavaScriptTestcase.java
URL: http://svn.apache.org/viewvc/jakarta/bsf/branches/bsf3.x/testing/javascript/src/test/java/org/apache/bsf/testing/javascript/JavaScriptTestcase.java?rev=950822&r1=950821&r2=950822&view=diff
==============================================================================
--- jakarta/bsf/branches/bsf3.x/testing/javascript/src/test/java/org/apache/bsf/testing/javascript/JavaScriptTestcase.java (original)
+++ jakarta/bsf/branches/bsf3.x/testing/javascript/src/test/java/org/apache/bsf/testing/javascript/JavaScriptTestcase.java Wed Jun 2 23:34:22 2010
@@ -31,6 +31,7 @@ public class JavaScriptTestcase extends
public void testEval() throws ScriptException {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByExtension("js");
+ assertNotNull("engine should not be null", engine);
assertTrue(((Boolean)engine.eval("true;")).booleanValue());
assertFalse(((Boolean)engine.eval("false;")).booleanValue());
}
@@ -38,6 +39,7 @@ public class JavaScriptTestcase extends
public void testInvokeFunction() throws ScriptException, NoSuchMethodException {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByExtension("js");
+ assertNotNull("engine should not be null", engine);
engine.eval("function hello(s) { return 'Hello ' + s; }" );
assertTrue(engine instanceof Invocable);
Invocable invocableScript = (Invocable) engine;
@@ -47,6 +49,7 @@ public class JavaScriptTestcase extends
public void testInvokeMethod() throws ScriptException, NoSuchMethodException {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByExtension("js");
+ assertNotNull("engine should not be null", engine);
engine.eval("function hello(s) { return 'Hello ' + s; }" );
assertTrue(engine instanceof Invocable);
Invocable invocableScript = (Invocable) engine;
Modified: jakarta/bsf/branches/bsf3.x/testing/python/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/bsf/branches/bsf3.x/testing/python/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java?rev=950822&r1=950821&r2=950822&view=diff
==============================================================================
--- jakarta/bsf/branches/bsf3.x/testing/python/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java (original)
+++ jakarta/bsf/branches/bsf3.x/testing/python/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java Wed Jun 2 23:34:22 2010
@@ -33,8 +33,9 @@ public class HelloTestCase extends TestC
public void testInvokeFunction() throws ScriptException, NoSuchMethodException {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByExtension("py");
+ assertNotNull("engine should not be null", engine);
engine.eval("def hello(name):\n return 'Hello ' + name");
- assertTrue(engine instanceof Invocable);
+ assertTrue("engine should be invocable",engine instanceof Invocable);
Invocable invocableScript = (Invocable) engine;
assertEquals("Hello Monty", invocableScript.invokeFunction("hello", new Object[] { "Monty" }));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org