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/NullUndefinedVarTest.java b/test/javax/script/NullUndefinedVarTest.java
index b07d5af..646009c 100644
--- a/test/javax/script/NullUndefinedVarTest.java
+++ b/test/javax/script/NullUndefinedVarTest.java
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 6346732
+ * @bug 6346732 6705893
* @summary should be able to assign null and undefined
* value to JavaScript global variables.
*/
@@ -34,9 +34,10 @@
public static void main(String[] args) throws Exception {
ScriptEngineManager manager = new ScriptEngineManager();
- ScriptEngine jsengine = manager.getEngineByName("js");
+ ScriptEngine jsengine = Helper.getJsEngine(manager);
if (jsengine == null) {
- throw new RuntimeException("no js engine found");
+ System.out.println("Warning: No js engine found; test vacuously passes.");
+ return;
}
jsengine.eval("var n = null; " +
"if (n !== null) throw 'expecting null';" +