Assert.assertTrue(registeredProcessExists(runner));
final ErlangRunner r = new ErlangRunner(erlRuntime.traceRunnerNode);
Assert.assertFalse(r.mboxOpen);
checkForCorrectException(new whatToRun() { public @Override void run() {
r.call(new OtpErlangObject[]{new OtpErlangAtom("echoA")},200);
}},IllegalArgumentException.class,"is closed");
Assert.assertFalse(registeredProcessExists(r));
r.initRunner();
Assert.assertTrue(r.mboxOpen);
OtpErlangTuple response = (OtpErlangTuple)r.call(new OtpErlangObject[]{new OtpErlangAtom("echo"),
new OtpErlangList(new OtpErlangObject[]{ new OtpErlangAtom(dataHead)})},
0);
Assert.assertEquals(dataHead,((OtpErlangAtom)response.elementAt(0)).atomValue());
Assert.assertTrue(registeredProcessExists(r));
checkForCorrectException(new whatToRun() { public @Override void run() {
r.initRunner();// this will fail because the corresponding process is already running.
}},IllegalArgumentException.class,"already_started");
Assert.assertFalse(r.mboxOpen);
Assert.assertFalse(registeredProcessExists(r));
// verify failure
checkForCorrectException(new whatToRun() { public @Override void run() {
r.call(new OtpErlangObject[]{new OtpErlangAtom("echoA")},200);
}},IllegalArgumentException.class,"is closed");
}