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

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


The following commit(s) were added to refs/heads/main by this push:
     new 8f40c2f53e NO-JIRA make STOMP test more robust
8f40c2f53e is described below

commit 8f40c2f53e34c546e0d21463e9664436a1986d11
Author: Justin Bertram <[email protected]>
AuthorDate: Wed Jun 25 15:21:52 2025 -0500

    NO-JIRA make STOMP test more robust
---
 .../stomp/StompWithRejectingInterceptorTest.java       | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWithRejectingInterceptorTest.java
 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWithRejectingInterceptorTest.java
index d03e81a03c..64ef9e2cc4 100644
--- 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWithRejectingInterceptorTest.java
+++ 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWithRejectingInterceptorTest.java
@@ -54,23 +54,19 @@ public class StompWithRejectingInterceptorTest extends 
StompTestBase {
 
       StompClientConnection conn = 
StompClientConnectionFactory.createClientConnection(uri);
       conn.connect(defUser, defPass);
+      Wait.assertEquals(1, () -> 
IncomingStompFrameRejectInterceptor.interceptedFrames.size(), 500, 10);
+      assertEquals("CONNECT", 
IncomingStompFrameRejectInterceptor.interceptedFrames.get(0).getCommand());
 
       ClientStompFrame frame = conn.createFrame("SEND");
       frame.addHeader("destination", getQueuePrefix() + getQueueName());
       frame.setBody("Hello World");
       conn.sendFrame(frame);
-      conn.disconnect();
-
-      assertTrue(Wait.waitFor(() -> 
IncomingStompFrameRejectInterceptor.interceptedFrames.size() == 3, 10000, 50));
-
-      List<String> incomingCommands = new ArrayList<>(4);
-      incomingCommands.add("CONNECT");
-      incomingCommands.add("SEND");
-      incomingCommands.add("DISCONNECT");
+      Wait.assertEquals(2, () -> 
IncomingStompFrameRejectInterceptor.interceptedFrames.size(), 500, 10);
+      assertEquals("SEND", 
IncomingStompFrameRejectInterceptor.interceptedFrames.get(1).getCommand());
 
-      for (int i = 0; i < 
IncomingStompFrameRejectInterceptor.interceptedFrames.size(); i++) {
-         assertEquals(incomingCommands.get(i), 
IncomingStompFrameRejectInterceptor.interceptedFrames.get(i).getCommand());
-      }
+      conn.disconnect();
+      Wait.assertEquals(3, () -> 
IncomingStompFrameRejectInterceptor.interceptedFrames.size(), 500, 10);
+      assertEquals("DISCONNECT", 
IncomingStompFrameRejectInterceptor.interceptedFrames.get(2).getCommand());
 
       Wait.assertFalse(() -> 
server.locateQueue(SimpleString.of(getQueuePrefix() + 
getQueueName())).getMessageCount() > 0, 1000, 100);
    }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to