ensure frames are null terminated

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1243484 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2012-02-13 11:52:11 +00:00
parent 5a74d56cc1
commit 9a22fe586d
1 changed files with 6 additions and 6 deletions

View File

@ -74,11 +74,11 @@ public class StompSubscriptionRemoveTest extends TestCase {
stompConnection.open(new Socket("localhost", stompPort)); stompConnection.open(new Socket("localhost", stompPort));
String connectFrame = "CONNECT\n" + "login: brianm\n" + "passcode: wombats\n" + "\n"; String connectFrame = "CONNECT\n" + "login: brianm\n" + "passcode: wombats\n\n" + Stomp.NULL;
stompConnection.sendFrame(connectFrame); stompConnection.sendFrame(connectFrame);
stompConnection.receiveFrame(); stompConnection.receiveFrame();
String frame = "SUBSCRIBE\n" + "destination:/queue/" + getDestinationName() + "\n" + "ack:client\n\n"; String frame = "SUBSCRIBE\n" + "destination:/queue/" + getDestinationName() + "\n" + "ack:client\n\n" + Stomp.NULL;
stompConnection.sendFrame(frame); stompConnection.sendFrame(frame);
int messagesCount = 0; int messagesCount = 0;
@ -88,7 +88,7 @@ public class StompSubscriptionRemoveTest extends TestCase {
LOG.debug("Received: " + receiveFrame); LOG.debug("Received: " + receiveFrame);
assertEquals("Unexpected frame received", COMMAND_MESSAGE, getCommand(receiveFrame)); assertEquals("Unexpected frame received", COMMAND_MESSAGE, getCommand(receiveFrame));
String messageId = getHeaderValue(receiveFrame, HEADER_MESSAGE_ID); String messageId = getHeaderValue(receiveFrame, HEADER_MESSAGE_ID);
String ackmessage = "ACK\n" + HEADER_MESSAGE_ID + ":" + messageId + "\n\n"; String ackmessage = "ACK\n" + HEADER_MESSAGE_ID + ":" + messageId + "\n\n"+ Stomp.NULL;
stompConnection.sendFrame(ackmessage); stompConnection.sendFrame(ackmessage);
// Thread.sleep(1000); // Thread.sleep(1000);
++messagesCount; ++messagesCount;
@ -101,12 +101,12 @@ public class StompSubscriptionRemoveTest extends TestCase {
stompConnection.open(new Socket("localhost", stompPort)); stompConnection.open(new Socket("localhost", stompPort));
connectFrame = "CONNECT\n" + "login: brianm\n" + "passcode: wombats\n" + "\n"; connectFrame = "CONNECT\n" + "login: brianm\n" + "passcode: wombats\n\n" + Stomp.NULL;
stompConnection.sendFrame(connectFrame); stompConnection.sendFrame(connectFrame);
stompConnection.receiveFrame(); stompConnection.receiveFrame();
frame = "SUBSCRIBE\n" + "destination:/queue/" + getDestinationName() + "\n" + "ack:client\n\n"; frame = "SUBSCRIBE\n" + "destination:/queue/" + getDestinationName() + "\n" + "ack:client\n\n" + Stomp.NULL;
stompConnection.sendFrame(frame); stompConnection.sendFrame(frame);
try { try {
while (count != 2000) { while (count != 2000) {
@ -114,7 +114,7 @@ public class StompSubscriptionRemoveTest extends TestCase {
LOG.debug("Received: " + receiveFrame); LOG.debug("Received: " + receiveFrame);
assertEquals("Unexpected frame received", COMMAND_MESSAGE, getCommand(receiveFrame)); assertEquals("Unexpected frame received", COMMAND_MESSAGE, getCommand(receiveFrame));
String messageId = getHeaderValue(receiveFrame, HEADER_MESSAGE_ID); String messageId = getHeaderValue(receiveFrame, HEADER_MESSAGE_ID);
String ackmessage = "ACK\n" + HEADER_MESSAGE_ID + ":" + messageId.trim() + "\n\n"; String ackmessage = "ACK\n" + HEADER_MESSAGE_ID + ":" + messageId.trim() + "\n\n" + Stomp.NULL;
stompConnection.sendFrame(ackmessage); stompConnection.sendFrame(ackmessage);
// Thread.sleep(1000); // Thread.sleep(1000);
++messagesCount; ++messagesCount;