assertEquals("PASSED", getOutput());
resetOutBuffer();
}
public void testCompileScript() {
CompiledScript script = null;
StringReader reader = new StringReader(
"context.getWriter().println(\"PASSED\");");
try {
script = engine.compile(reader);
} catch (ScriptException ex) {
fail(buildMessage("RhinoScriptEngine.compileScript(): Unexpected " +
"ScriptException ..", ex.getMessage()));
}
try {
script.eval();
String str = getOutput();
assertEquals("PASSED", str);
} catch (ScriptException ex) {
fail(buildMessage("RhinoScriptEngine.compileScript(): Unexpected " +
"ScriptException ..", ex.getMessage()));