/**
* Tests link creation with isolates in different states.
*/
void testIsolateStates() throws IOException, IsolateStartupException {
boolean thrown;
Isolate us = Isolate.currentIsolate();
Isolate them = new Isolate("com.sun.midp.links.Empty", null);
thrown = false;
try {
Link link = Link.newLink(us, them);
} catch (IllegalStateException ise) {
thrown = true;
}
assertTrue("started,new should throw ISE", thrown);
thrown = false;
try {
Link link = Link.newLink(them, us);
} catch (IllegalStateException ise) {
thrown = true;
}
assertTrue("new,started should throw ISE", thrown);
them.start();
thrown = false;
try {
Link link = Link.newLink(us, them);
} catch (IllegalStateException ise) {
thrown = true;
}
assertFalse("started,started should not throw ISE", thrown);
thrown = false;
try {
Link link = Link.newLink(them, us);
} catch (IllegalStateException ise) {
thrown = true;
}
assertFalse("started,started should not throw ISE", thrown);
them.exit(0);
them.waitForExit();
thrown = false;
try {
Link link = Link.newLink(us, them);
} catch (IllegalStateException ise) {