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/Test4.java b/test/javax/script/Test4.java
index bae2550..de67542 100644
--- a/test/javax/script/Test4.java
+++ b/test/javax/script/Test4.java
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 6249843
+ * @bug 6249843 6705893
* @summary Test script functions implementing Java interface
*/
@@ -34,7 +34,11 @@
public static void main(String[] args) throws Exception {
System.out.println("\nTest4\n");
ScriptEngineManager m = new ScriptEngineManager();
- ScriptEngine e = m.getEngineByName("js");
+ ScriptEngine e = Helper.getJsEngine(m);
+ if (e == null) {
+ System.out.println("Warning: No js engine found; test vacuously passes.");
+ return;
+ }
e.eval(new FileReader(
new File(System.getProperty("test.src", "."), "Test4.js")));
Invocable inv = (Invocable)e;