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/JavaScriptScopeTest.java b/test/javax/script/JavaScriptScopeTest.java
index 1bce7b6..9793d7a 100644
--- a/test/javax/script/JavaScriptScopeTest.java
+++ b/test/javax/script/JavaScriptScopeTest.java
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 6346733
+ * @bug 6346733 6705893
* @summary Verify that independent Bindings instances don't
* get affected by default scope assignments. Also, verify
* that script globals can be created and accessed from Java
@@ -36,9 +36,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 v = 'hello';");
// Create a new scope