Author: tabish
Date: Tue Jan 17 16:14:16 2012
New Revision: 1232457
URL: http://svn.apache.org/viewvc?rev=1232457&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3653
Fix the test so that there's time for the Ack to be processed before the
connection is closed otherwise it can be missed.
Modified:
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
Modified:
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java?rev=1232457&r1=1232456&r2=1232457&view=diff
==============================================================================
---
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
(original)
+++
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
Tue Jan 17 16:14:16 2012
@@ -745,7 +745,7 @@ public class StompTest extends Combinati
assertTrue(msg.getAction().equals("MESSAGE"));
-
+
HashMap<String, String> ackHeaders = new HashMap<String, String>();
ackHeaders.put("message-id", msg.getHeaders().get("message-id"));
ackHeaders.put("content-length", "8511");
@@ -753,6 +753,11 @@ public class StompTest extends Combinati
StompFrame ack = new StompFrame("ACK", ackHeaders);
stompConnection.sendFrame(ack.format());
+ // Need some time for the Ack to get processed.
+ waitForFrameToTakeEffect();
+
+ frame = "DISCONNECT\n" + "\n\n" + Stomp.NULL;
+ stompConnection.sendFrame(frame);
stompDisconnect();
@@ -1727,9 +1732,9 @@ public class StompTest extends Combinati
assertEquals(2, queueView.getDequeueCount());
assertEquals(0, queueView.getQueueSize());
}
-
+
public void testReplytoModification() throws Exception {
- String replyto = "some destination";
+ String replyto = "some destination";
String frame = "CONNECT\n" + "login: system\n" + "passcode:
manager\n\n" + Stomp.NULL;
stompConnection.sendFrame(frame);
@@ -1738,7 +1743,7 @@ public class StompTest extends Combinati
frame = "SUBSCRIBE\n" + "destination:/queue/" + getQueueName() + "\n"
+ "ack:auto\n\n" + Stomp.NULL;
stompConnection.sendFrame(frame);
-
+
frame = "SEND\n" + "destination:/queue/" + getQueueName() + "\n" +
"reply-to:" + replyto + "\n\nhello world" + Stomp.NULL;
stompConnection.sendFrame(frame);