Author: jmesnil
Date: 2010-01-28 04:52:47 -0500 (Thu, 28 Jan 2010)
New Revision: 8852
Modified:
trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-129: Implement STOMP v1.0
* fix testSubscribeToTopic. Make sure the Stomp client is unsubscribed before sending
another message on the topic.
Modified: trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java 2010-01-27 17:07:27
UTC (rev 8851)
+++ trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java 2010-01-28 09:52:47
UTC (rev 8852)
@@ -442,7 +442,6 @@
frame = receiveFrame(10000);
Assert.assertNotNull(frame);
- System.out.println(frame);
Assert.assertTrue(frame.startsWith("MESSAGE"));
Assert.assertTrue(frame.indexOf("S:") > 0);
Assert.assertTrue(frame.indexOf("n:") > 0);
@@ -1101,14 +1100,18 @@
frame = receiveFrame(10000);
Assert.assertTrue(frame.startsWith("MESSAGE"));
Assert.assertTrue(frame.indexOf("destination:") > 0);
- Assert.assertTrue(frame.indexOf(getName()) > 0);
+ Assert.assertTrue(frame.indexOf(getTopicName()) > 0);
frame =
"UNSUBSCRIBE\n" +
"destination:/topic/" + getTopicName() + "\n" +
+ "receipt: 1234\n" +
"\n\n" +
Stomp.NULL;
sendFrame(frame);
+ // wait for UNSUBSCRIPE's receipt
+ frame = receiveFrame(10000);
+ Assert.assertTrue(frame.startsWith("RECEIPT"));
sendMessage(getName(), topic);
@@ -1151,7 +1154,6 @@
sendMessage(getName());
frame = receiveFrame(10000);
- System.out.println(frame);
Assert.assertTrue(frame.startsWith("MESSAGE"));
Assert.assertTrue(frame.indexOf("destination:") > 0);
Assert.assertTrue(frame.indexOf(getName()) > 0);
@@ -1160,7 +1162,6 @@
Matcher cl_matcher = cl.matcher(frame);
Assert.assertTrue(cl_matcher.find());
String messageID = cl_matcher.group(1);
- System.out.println(messageID);
frame =
"BEGIN\n" +