6705893: javax.script tests should not require a js engine on OpenJDK
Summary: Fixed the tests to pass with open JDK.
Reviewed-by: darcy
diff --git a/test/javax/script/RhinoExceptionTest.java b/test/javax/script/RhinoExceptionTest.java
index 439b947..cf52f12 100644
--- a/test/javax/script/RhinoExceptionTest.java
+++ b/test/javax/script/RhinoExceptionTest.java
@@ -23,8 +23,8 @@
/*
* @test
- * @bug 6474943
- * @summary Test that Rhion exception messages are
+ * @bug 6474943 6705893
+ * @summary Test that Rhino exception messages are
* available from ScriptException.
*/
@@ -36,7 +36,11 @@
public static void main(String[] args) throws Exception {
ScriptEngineManager m = new ScriptEngineManager();
- ScriptEngine engine = m.getEngineByName("js");
+ ScriptEngine engine = Helper.getJsEngine(m);
+ if (engine == null) {
+ System.out.println("Warning: No js engine found; test vacuously passes.");
+ return;
+ }
engine.put("msg", ERROR_MSG);
try {
engine.eval("throw new Error(msg);");