mirror of https://github.com/apache/activemq.git
remove hard coded wait time, use condition, resolve failure
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1076283 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
93e2bd355b
commit
b98047ed8c
|
@ -16,6 +16,7 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.spring;
|
package org.apache.activemq.spring;
|
||||||
|
|
||||||
|
import org.apache.activemq.util.Wait;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
@ -60,7 +61,11 @@ public class ListenerTest {
|
||||||
public void testComposite() throws Exception {
|
public void testComposite() throws Exception {
|
||||||
sendMessages("TEST.1,TEST.2,TEST.3,TEST.4,TEST.5,TEST.6", msgNum);
|
sendMessages("TEST.1,TEST.2,TEST.3,TEST.4,TEST.5,TEST.6", msgNum);
|
||||||
|
|
||||||
Thread.sleep(3000);
|
Wait.waitFor(new Wait.Condition() {
|
||||||
|
public boolean isSatisified() throws Exception {
|
||||||
|
return (6 * msgNum) <= listener.messages.size();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
LOG.info("messages received= " + listener.messages.size());
|
LOG.info("messages received= " + listener.messages.size());
|
||||||
Assert.assertEquals(6 * msgNum, listener.messages.size());
|
Assert.assertEquals(6 * msgNum, listener.messages.size());
|
||||||
|
|
Loading…
Reference in New Issue