# HG changeset patch # User sundar # Date 1296574209 -19800 # Node ID 84f2b622b407dfa3c97e0ca2e1d977b7ac1b3d36 # Parent d9bcc1208691bafe57242a88f7eda9e5dd18200a 7015908: 3 javax.script tests fail with openjdk build Reviewed-by: alanb diff -r d9bcc1208691 -r 84f2b622b407 jdk/test/javax/script/CauseExceptionTest.java --- 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 { diff -r d9bcc1208691 -r 84f2b622b407 jdk/test/javax/script/StringWriterPrintTest.java --- 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); diff -r d9bcc1208691 -r 84f2b622b407 jdk/test/javax/script/UnescapedBracketRegExTest.java --- 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+/=]/;"); }