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
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(100);
|
Thread.sleep(200);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
}
|
}
|
||||||
((GatedVMTestTransportListener) remote.getTransportListener()).gate.countDown();
|
((GatedVMTestTransportListener) remote.getTransportListener()).gate.countDown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
assertTrue(Wait.waitFor(new Wait.Condition() {
|
||||||
|
@Override
|
||||||
|
public boolean isSatisified() throws Exception {
|
||||||
|
return remoteReceived.size() == 1;
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
gateman.start();
|
gateman.start();
|
||||||
|
|
||||||
remote.stop();
|
remote.stop();
|
||||||
local.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);
|
assertMessageAreOrdered(remoteReceived);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue