activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [activemq-artemis] branch master updated: NO-JIRA Test improvement
Date Thu, 09 May 2019 20:59:50 GMT
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 389edd4  NO-JIRA Test improvement
389edd4 is described below

commit 389edd49760cdab3f628134acf796719725d1a4a
Author: Clebert Suconic <clebertsuconic@apache.org>
AuthorDate: Thu May 9 16:55:29 2019 -0400

    NO-JIRA Test improvement
---
 .../tests/integration/stomp/v11/StompV11Test.java       | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
index 167ad46..ec22609 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
@@ -38,6 +38,7 @@ import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.protocol.stomp.Stomp;
 import org.apache.activemq.artemis.core.protocol.stomp.StompConnection;
 import org.apache.activemq.artemis.core.protocol.stomp.v11.StompFrameHandlerV11;
+import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.integration.stomp.StompTestBase;
@@ -1505,22 +1506,28 @@ public class StompV11Test extends StompTestBase {
 
    @Test
    public void testDurableUnSubscribe() throws Exception {
+      SimpleString queueName = SimpleString.toSimpleString(CLIENT_ID + "." + getName());
+
       conn.connect(defUser, defPass, CLIENT_ID);
 
       subscribeTopic(conn, null, Stomp.Headers.Subscribe.AckModeValues.AUTO, getName());
 
+      Wait.assertTrue(() -> server.locateQueue(queueName) != null);
+
       conn.disconnect();
       conn.destroy();
+
+      Queue queue = server.locateQueue(queueName);
+      Assert.assertNotNull(queue);
+
+      Wait.assertEquals(0, queue::getConsumerCount, 10_000, 10);
+
       conn = StompClientConnectionFactory.createClientConnection(uri);
       conn.connect(defUser, defPass, CLIENT_ID);
 
       unsubscribe(conn, getName(), null, false, true);
 
-      long start = System.currentTimeMillis();
-      SimpleString queueName = SimpleString.toSimpleString(CLIENT_ID + "." + getName());
-      while (server.locateQueue(queueName) != null && (System.currentTimeMillis()
- start) < 5000) {
-         Thread.sleep(100);
-      }
+      Wait.assertTrue(() -> server.locateQueue(queueName) == null);
 
       assertNull(server.locateQueue(queueName));
 


Mime
View raw message