Fix the test so that there's time for the Ack to be processed before the connection is closed otherwise it can be missed.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1232457 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2012-01-17 16:14:16 +00:00
parent 221da8bcd2
commit 5774d004f8
1 changed files with 9 additions and 4 deletions

View File

@ -745,7 +745,7 @@ public class StompTest extends CombinationTestSupport {
assertTrue(msg.getAction().equals("MESSAGE")); assertTrue(msg.getAction().equals("MESSAGE"));
HashMap<String, String> ackHeaders = new HashMap<String, String>(); HashMap<String, String> ackHeaders = new HashMap<String, String>();
ackHeaders.put("message-id", msg.getHeaders().get("message-id")); ackHeaders.put("message-id", msg.getHeaders().get("message-id"));
ackHeaders.put("content-length", "8511"); ackHeaders.put("content-length", "8511");
@ -753,6 +753,11 @@ public class StompTest extends CombinationTestSupport {
StompFrame ack = new StompFrame("ACK", ackHeaders); StompFrame ack = new StompFrame("ACK", ackHeaders);
stompConnection.sendFrame(ack.format()); 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(); stompDisconnect();
@ -1727,9 +1732,9 @@ public class StompTest extends CombinationTestSupport {
assertEquals(2, queueView.getDequeueCount()); assertEquals(2, queueView.getDequeueCount());
assertEquals(0, queueView.getQueueSize()); assertEquals(0, queueView.getQueueSize());
} }
public void testReplytoModification() throws Exception { 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; String frame = "CONNECT\n" + "login: system\n" + "passcode: manager\n\n" + Stomp.NULL;
stompConnection.sendFrame(frame); stompConnection.sendFrame(frame);
@ -1738,7 +1743,7 @@ public class StompTest extends CombinationTestSupport {
frame = "SUBSCRIBE\n" + "destination:/queue/" + getQueueName() + "\n" + "ack:auto\n\n" + Stomp.NULL; frame = "SUBSCRIBE\n" + "destination:/queue/" + getQueueName() + "\n" + "ack:auto\n\n" + Stomp.NULL;
stompConnection.sendFrame(frame); stompConnection.sendFrame(frame);
frame = "SEND\n" + "destination:/queue/" + getQueueName() + "\n" + "reply-to:" + replyto + "\n\nhello world" + Stomp.NULL; frame = "SEND\n" + "destination:/queue/" + getQueueName() + "\n" + "reply-to:" + replyto + "\n\nhello world" + Stomp.NULL;
stompConnection.sendFrame(frame); stompConnection.sendFrame(frame);