mirror of https://github.com/apache/activemq.git
Add test to assert that preconditions are met before moving on to the
rest of the checks.
This commit is contained in:
parent
67c28b1c68
commit
eaf5c12151
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue