activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1243484 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSubscriptionRemoveTest.java
Date Mon, 13 Feb 2012 11:52:11 GMT
Author: gtully
Date: Mon Feb 13 11:52:11 2012
New Revision: 1243484

URL: http://svn.apache.org/viewvc?rev=1243484&view=rev
Log:
ensure frames are null terminated

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSubscriptionRemoveTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSubscriptionRemoveTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSubscriptionRemoveTest.java?rev=1243484&r1=1243483&r2=1243484&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSubscriptionRemoveTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompSubscriptionRemoveTest.java
Mon Feb 13 11:52:11 2012
@@ -74,11 +74,11 @@ public class StompSubscriptionRemoveTest
 
         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.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);
 
         int messagesCount = 0;
@@ -88,7 +88,7 @@ public class StompSubscriptionRemoveTest
             LOG.debug("Received: " + receiveFrame);
             assertEquals("Unexpected frame received", COMMAND_MESSAGE, getCommand(receiveFrame));
             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);
             // Thread.sleep(1000);
             ++messagesCount;
@@ -101,12 +101,12 @@ public class StompSubscriptionRemoveTest
 
         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.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);
         try {
             while (count != 2000) {
@@ -114,7 +114,7 @@ public class StompSubscriptionRemoveTest
                 LOG.debug("Received: " + receiveFrame);
                 assertEquals("Unexpected frame received", COMMAND_MESSAGE, getCommand(receiveFrame));
                 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);
                 // Thread.sleep(1000);
                 ++messagesCount;



Mime
View raw message