}
public void test_exec() throws IOException {
final ScriptProcess p = datastore.newProcess(TEST_USER, "exec.js", false, "ags", "owner", TransportType.Dummy);
ScriptAction r = p.call();
p.save();
assertTrue("Exec correctly", r instanceof Exec);
assertEquals("Exec good program", "returnArg.js", ((Exec)r).getScript());
assertEquals("Exec good args", "arg1 arg2", ((Exec)r).getArgs());
r.visit(new ScriptusFacade(datastore, c, m, conf) {
@Override
public void execute(UUID pid) {
ScriptProcess pp = datastore.getProcess(pid);
assertEquals("good pid", p.getPid(), pid);
assertEquals("good source", "returnArg.js", pp.getSourceName());
assertEquals("good args", "arg1 arg2", pp.getArgs());
ScriptAction aa = pp.call();
assertEquals("good class result", NormalTermination.class, aa.getClass());
assertEquals("goood result", "resultarg1 arg2", ((NormalTermination)aa).getResult());
}