Scheduler s = new Scheduler(1);
task.informOnExit(exitmb);
task.setScheduler(s);
task.start();
ExitMsg m = exitmb.getb();
if (m == null) {
fail("Timed Out");
} else {
Object res = m.result;
if (res instanceof Throwable) {
((Throwable)res).printStackTrace();
fail(m.toString());
}
if (task.getResponse != "foo") {
fail("Expected 'foo', got '" + res + "'");
}
}