ARTEMIS-1140: Trivial test fix

This commit is contained in:
Clebert Suconic 2017-05-03 16:12:01 -04:00
parent 9e165d1733
commit 0146109d6a
1 changed files with 9 additions and 1 deletions

View File

@ -350,7 +350,15 @@ public abstract class ActiveMQServerTestCase {
if (binding != null && binding instanceof LocalQueueBinding) { if (binding != null && binding instanceof LocalQueueBinding) {
((LocalQueueBinding) binding).getQueue().flushExecutor(); ((LocalQueueBinding) binding).getQueue().flushExecutor();
} }
Long messageCount = ActiveMQServerTestCase.servers.get(0).getMessageCountForQueue(queueName); Long messageCount = null;
for (int i = 0; i < 10; i++) {
messageCount = servers.get(0).getMessageCountForQueue(queueName);
if (messageCount.longValue() == expected) {
break;
} else {
Thread.sleep(100);
}
}
ProxyAssertSupport.assertEquals(expected, messageCount.intValue()); ProxyAssertSupport.assertEquals(expected, messageCount.intValue());
return expected == messageCount.intValue(); return expected == messageCount.intValue();