[activemq-artemis] branch master updated: NO-JIRA make OpenWire test more robust

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[activemq-artemis] branch master updated: NO-JIRA make OpenWire test more robust

clebertsuconic-2
This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new 566579f  NO-JIRA make OpenWire test more robust
     new fe7a842  This closes #2887
566579f is described below

commit 566579f96f395ce3dfc4dfa350ce0b73d8257d31
Author: Justin Bertram <[hidden email]>
AuthorDate: Thu Nov 7 20:50:00 2019 -0600

    NO-JIRA make OpenWire test more robust
---
 .../integration/openwire/cluster/TemporaryQueueClusterTest.java  | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/cluster/TemporaryQueueClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/cluster/TemporaryQueueClusterTest.java
index 417b9f1..0bf60bf 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/cluster/TemporaryQueueClusterTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/cluster/TemporaryQueueClusterTest.java
@@ -17,6 +17,8 @@
 package org.apache.activemq.artemis.tests.integration.openwire.cluster;
 
 import org.apache.activemq.artemis.api.core.RoutingType;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.utils.Wait;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -64,20 +66,23 @@ public class TemporaryQueueClusterTest extends OpenWireJMSClusteredTestBase {
          Session session2 = conn2.createSession(false, Session.AUTO_ACKNOWLEDGE);
          Queue targetQueue2 = session2.createQueue(QUEUE_NAME);
 
-
          this.waitForBindings(servers[0], QUEUE_NAME, true, 1, 0, 2000);
          this.waitForBindings(servers[1], QUEUE_NAME, true, 1, 0, 2000);
          this.waitForBindings(servers[1], QUEUE_NAME, false, 1, 0, 2000);
          this.waitForBindings(servers[0], QUEUE_NAME, false, 1, 0, 2000);
 
-
          MessageProducer prod1 = session1.createProducer(targetQueue1);
          MessageConsumer cons2 = session2.createConsumer(targetQueue2);
 
+         this.waitForBindings(servers[0], QUEUE_NAME, false, 1, 1, 2000);
+         this.waitForBindings(servers[1], QUEUE_NAME, true, 1, 1, 2000);
+
          TextMessage msg = session1.createTextMessage("hello");
 
          prod1.send(msg);
 
+         Wait.assertTrue(() -> getServer(1).locateQueue(SimpleString.toSimpleString(QUEUE_NAME)).getMessageCount() == 1, 5000, 100);
+
          TextMessage msgReceived = (TextMessage) cons2.receive(5000);
 
          assertNotNull(msgReceived);