提交 7e99b424 编写于 作者: S sundar

7015908: 3 javax.script tests fail with openjdk build

Reviewed-by: alanb
上级 be380835
......@@ -34,6 +34,10 @@ public class CauseExceptionTest {
public static void main(String[] args) throws ScriptException, NoSuchMethodException {
ScriptEngineManager sem = new ScriptEngineManager();
ScriptEngine engine = sem.getEngineByName("js");
if (engine == null) {
System.out.println("Warning: No js engine found; test vacuously passes.");
return;
}
engine.eval("function hello_world() { println('hello world'); throw 'out of here'; } ");
Invocable invocable = (Invocable) engine;
try {
......
......@@ -34,6 +34,10 @@ public class StringWriterPrintTest {
public static void main(String[] args) throws ScriptException {
ScriptEngineManager sem = new ScriptEngineManager();
ScriptEngine engine = sem.getEngineByName("js");
if (engine == null) {
System.out.println("Warning: No js engine found; test vacuously passes.");
return;
}
StringWriter sw = new StringWriter();
engine.eval("print(\"hello world 1\\n\")");
engine.getContext().setWriter(sw);
......
......@@ -34,6 +34,10 @@ public class UnescapedBracketRegExTest {
public static void main(String[] args) throws ScriptException {
ScriptEngineManager sem = new ScriptEngineManager();
ScriptEngine engine = sem.getEngineByName("js");
if (engine == null) {
System.out.println("Warning: No js engine found; test vacuously passes.");
return;
}
// the following throws exception
engine.eval("var x = /[a-zA-Z+/=]/;");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册