7015908: 3 javax.script tests fail with openjdk build
Reviewed-by: alanb
This commit is contained in:
parent
85a3f20cef
commit
932380b9e0
@ -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+/=]/;");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user