jdk/test/javax/script/Test2.java
changeset 1084 4d4d63dfdef9
parent 2 90ce3da70b43
child 1247 b4c26443dee5
--- a/jdk/test/javax/script/Test2.java	Sun Aug 17 17:02:04 2008 -0700
+++ b/jdk/test/javax/script/Test2.java	Mon Aug 18 15:28:54 2008 -0700
@@ -50,7 +50,11 @@
         public static void main(String[] args) throws Exception {
             System.out.println("\nTest2\n");
             ScriptEngineManager m = new ScriptEngineManager();
-            ScriptEngine eng = m.getEngineByName("js");
+            ScriptEngine eng = Helper.getJsEngine(m);
+            if (eng == null) {
+                     System.out.println("Warning: No js engine found; test vacuously passes.");
+                     return;
+            }
             eng.put("Testobj", new Testobj("Hello World"));
             eng.eval(new FileReader(
                     new File(System.getProperty("test.src", "."), "Test2.js")));