--- a/jdk/test/javax/script/CauseExceptionTest.java Tue Feb 01 04:45:10 2011 -0800
+++ b/jdk/test/javax/script/CauseExceptionTest.java Tue Feb 01 21:00:09 2011 +0530
@@ -34,6 +34,10 @@
public static void main(String[] args) throws ScriptException, NoSuchMethodException {
ScriptEngineManager sem = new ScriptEngineManager();
ScriptEngine engine = sem.getEngineByName("js");
+ if (engine == null) {
+ System.out.println("Warning: No js engine found; test vacuously passes.");
+ return;
+ }
engine.eval("function hello_world() { println('hello world'); throw 'out of here'; } ");
Invocable invocable = (Invocable) engine;
try {
--- a/jdk/test/javax/script/StringWriterPrintTest.java Tue Feb 01 04:45:10 2011 -0800
+++ b/jdk/test/javax/script/StringWriterPrintTest.java Tue Feb 01 21:00:09 2011 +0530
@@ -34,6 +34,10 @@
public static void main(String[] args) throws ScriptException {
ScriptEngineManager sem = new ScriptEngineManager();
ScriptEngine engine = sem.getEngineByName("js");
+ if (engine == null) {
+ System.out.println("Warning: No js engine found; test vacuously passes.");
+ return;
+ }
StringWriter sw = new StringWriter();
engine.eval("print(\"hello world 1\\n\")");
engine.getContext().setWriter(sw);
--- a/jdk/test/javax/script/UnescapedBracketRegExTest.java Tue Feb 01 04:45:10 2011 -0800
+++ b/jdk/test/javax/script/UnescapedBracketRegExTest.java Tue Feb 01 21:00:09 2011 +0530
@@ -34,6 +34,10 @@
public static void main(String[] args) throws ScriptException {
ScriptEngineManager sem = new ScriptEngineManager();
ScriptEngine engine = sem.getEngineByName("js");
+ if (engine == null) {
+ System.out.println("Warning: No js engine found; test vacuously passes.");
+ return;
+ }
// the following throws exception
engine.eval("var x = /[a-zA-Z+/=]/;");
}