What steps will reproduce the problem?
1. When using ScriptEngine to eval script, have not using correct scope
variable.
What is the expected output? What do you see instead?
The next code can't run successful.
public class AviatorTest {
private ScriptEngineManager manager = new ScriptEngineManager();
private ScriptEngine engine = manager.getEngineByName("Aviator");
@Test
public void testGlobal2VarScope() throws ScriptException {
String script = "greeting";
Object eval;
// ScriptEngineManager scope
manager.put("greeting", "ScriptEngineManager scope");
eval = engine.eval(script);
assertEquals("ScriptEngineManager scope", eval);
// ScriptEngine scope
engine.put("greeting", "ScriptEngine scope");
eval = engine.eval(script);
assertEquals("ScriptEngine scope", eval);
// Bindings scope
Bindings bindings = engine.createBindings();
bindings.put("greeting", "Bindings scope");
eval = engine.eval(script, bindings);
assertEquals("Bindings scope", eval);
}
}
What version of the product are you using? On what operating system?
Version: aviator 2.2.1
JDK: 1.6.0_23
OS: Windows xp
Please provide any additional information below.
Original issue reported on code.google.com by bul...@gmail.com on 10 Mar 2012 at 11:55
Original issue reported on code.google.com by
bul...@gmail.com
on 10 Mar 2012 at 11:55