wrote a test to answer question on mailing list, shows wildcard subscription with STOMP

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1489275 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Christian Posta 2013-06-04 02:34:00 +00:00
parent 37ede54486
commit a7f1180295
1 changed files with 38 additions and 0 deletions

View File

@ -592,6 +592,44 @@ public class Stomp11Test extends StompTestSupport {
stompConnection.sendFrame(frame);
}
@Test
public void testSubscribeWithWildcardSubscription() throws Exception {
String connectFrame = "STOMP\n" +
"login:system\n" +
"passcode:manager\n" +
"accept-version:1.1\n" +
"host:localhost\n" +
"\n" + Stomp.NULL;
stompConnection.sendFrame(connectFrame);
String f = stompConnection.receiveFrame();
LOG.debug("Broker sent: " + f);
assertTrue(f.startsWith("CONNECTED"));
String message = "SEND\n" + "destination:/queue/a.b.c" +
"\n\n" + "Hello World" + Stomp.NULL;
stompConnection.sendFrame(message);
message = "SEND\n" + "destination:/queue/a.b" +
"\n\n" + "Hello World" + Stomp.NULL;
stompConnection.sendFrame(message);
String frame = "SUBSCRIBE\n" + "destination:/queue/a.b.>" + "\n" +
"id:12345\n" + "ack:auto\n\n" + Stomp.NULL;
stompConnection.sendFrame(frame);
StompFrame received = stompConnection.receive();
assertNotNull(received);
received = stompConnection.receive();
assertNotNull(received);
frame = "DISCONNECT\n" + "\n\n" + Stomp.NULL;
stompConnection.sendFrame(frame);
}
@Test
public void testQueueBrowerSubscription() throws Exception {