103104105106107108109110111112113
p.save(); final ThreadLocal<String> tweetId = new ThreadLocal<String>(); ScriptusFacade f = new ScriptusFacade(datastore, c, m, config) { @Override public void registerMessageCorrelation(MessageCorrelation cid) { tweetId.set(cid.getMessageId()); super.registerMessageCorrelation(cid);
157158159160161162163164165166167
p.save(); // final ThreadLocal<String> tweetId = new ThreadLocal<String>(); ScriptusFacade f = new ScriptusFacade(datastore, c, m, config) { @Override public void registerMessageCorrelation(MessageCorrelation cid) { // tweetId.set(cid.getMessageId()); super.registerMessageCorrelation(cid);
8081828384858687888990
p.save(); Get g = (Get) r; g.visit(new ScriptusFacade(datastore, c, m, conf), p); p = datastore.getProcess(p.getPid()); assertTrue("got content", p.getState() instanceof String);
144145146147148149150151152153
assertTrue("Correct result", r instanceof NormalTermination); NormalTermination n = (NormalTermination) r; r.visit(new ScriptusFacade(datastore, c, m, conf), p); //sould say assertEquals("Correct result", "result", n.getResult()); }
164165166167168169170171172173
assertTrue("Correct result", r instanceof NormalTermination); NormalTermination n = (NormalTermination) r; r.visit(new ScriptusFacade(datastore, c, m, conf), p); //sould say assertEquals("Correct result", "aaarghs", n.getResult()); }
182183184185186187188189190191
205206207208209210211212213214215
assertTrue("Correct result", r instanceof Say); p.save(); r.visit(new ScriptusFacade(datastore, c, m, conf) { @Override public void execute(UUID pid) { ScriptProcess pp = datastore.getProcess(pid); ScriptAction rr = pp.call();
269270271272273274275276
ScriptAction r = p.call(); assertTrue("Forked correctly", r instanceof Fork); r.visit(new ScriptusFacade(datastore, c, m, conf), p); }
281282283284285286287288
272829303132333435363738
} @Override protected void setUp() throws Exception { ScriptusConfig c = new ScriptusConfig(); c.init(); // System.setProperty("DatastoreType", c.getDatastoreType().toString()); appContext = new ClassPathXmlApplicationContext(new String[]{getConfigFile()}, false); appContext.getEnvironment().getPropertySources().addFirst(c.new ScriptusConfigPropertySource("ScriptusConfig", c));