Add test to assert that preconditions are met before moving on to the

rest of the checks.
This commit is contained in:
Timothy Bish 2015-06-08 14:11:04 -04:00
parent 67c28b1c68
commit eaf5c12151
1 changed files with 16 additions and 2 deletions

View File

@ -523,18 +523,32 @@ public class VMTransportThreadSafeTest {
@Override
public void run() {
try {
Thread.sleep(100);
Thread.sleep(200);
} catch (InterruptedException e) {
}
((GatedVMTestTransportListener) remote.getTransportListener()).gate.countDown();
}
});
assertTrue(Wait.waitFor(new Wait.Condition() {
@Override
public boolean isSatisified() throws Exception {
return remoteReceived.size() == 1;
}
}));
gateman.start();
remote.stop();
local.stop();
assertEquals(1, remoteReceived.size());
assertTrue(Wait.waitFor(new Wait.Condition() {
@Override
public boolean isSatisified() throws Exception {
return remoteReceived.size() == 1;
}
}));
assertMessageAreOrdered(remoteReceived);
}