Add the unit test for this

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1398838 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2012-10-16 15:11:25 +00:00
parent 46824cedc7
commit e9bf83fc92
1 changed files with 29 additions and 0 deletions

View File

@ -127,6 +127,35 @@ public class Stomp11Test extends CombinationTestSupport {
stompConnection.sendFrame(frame);
}
public void testConnectedNeverEncoded() throws Exception {
String connectFrame = "STOMP\n" +
"login:system\n" +
"passcode:manager\n" +
"accept-version:1.1\n" +
"host:localhost\n" +
"request-id:1\n" +
"\n" + Stomp.NULL;
stompConnection.sendFrame(connectFrame);
String f = stompConnection.receiveFrame();
LOG.debug("Broker sent: " + f);
assertTrue(f.startsWith("CONNECTED"));
assertTrue(f.indexOf("response-id:1") >= 0);
assertTrue(f.indexOf("version:1.1") >= 0);
assertTrue(f.indexOf("session:") >= 0);
int sessionHeader = f.indexOf("session:");
f = f.substring(sessionHeader + "session:".length());
LOG.info("session header follows: " + f);
assertTrue(f.startsWith("ID:"));
String frame = "DISCONNECT\n" + "\n\n" + Stomp.NULL;
stompConnection.sendFrame(frame);
}
public void testConnectWithVersionOptions() throws Exception {
String connectFrame = "STOMP\n" +