From 4e173cfa8e61406650de08caba6c16f7ec4339ca Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Wed, 7 Jun 2017 16:26:25 -0400 Subject: [PATCH] [ARTEMIS-1209] Just enhancing the OpenWire test with a Wait.waitFor() --- .../tests/integration/openwire/SimpleOpenWireTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java index cb4bd11d58..a41acc63f8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java @@ -63,6 +63,7 @@ import org.apache.activemq.artemis.core.postoffice.PostOffice; import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding; import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; +import org.apache.activemq.artemis.tests.util.Wait; import org.apache.activemq.command.ActiveMQQueue; import org.apache.activemq.command.ActiveMQTopic; import org.junit.Assert; @@ -1478,9 +1479,9 @@ public class SimpleOpenWireTest extends BasicOpenWireTest { subscriber.setMessageListener(receivedMessages::add); topicConnection.start(); - while (receivedMessages.size() == 0) { - Thread.sleep(1000); - } + Wait.waitFor(() -> receivedMessages.size() > 0); + + Assert.assertTrue(receivedMessages.size() > 0); for (Message message : receivedMessages) { assertNotNull(message);