Author: chirino
Date: Mon Feb 27 18:39:55 2012
New Revision: 1294263
URL: http://svn.apache.org/viewvc?rev=1294263&view=rev
Log:
Change order makes test work better.
Modified:
activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala
Modified:
activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala
URL:
http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala?rev=1294263&r1=1294262&r2=1294263&view=diff
==============================================================================
---
activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala
(original)
+++
activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/StompTest.scala
Mon Feb 27 18:39:55 2012
@@ -1186,7 +1186,74 @@ class DurableSubscriptionOnLevelDBTest e
override val broker_config_uri: String =
"xml:classpath:apollo-stomp-leveldb.xml"
- test("You connection then unsubscribe form existing durable sub (APLO-157)")
{
+ test("Can directly send an recieve from a durable sub") {
+ connect("1.1")
+
+ // establish 2 durable subs..
+ client.write(
+ "SUBSCRIBE\n" +
+ "destination:/topic/sometopic\n" +
+ "id:sub1\n" +
+ "persistent:true\n" +
+ "receipt:0\n" +
+ "\n")
+ wait_for_receipt("0")
+
+ client.write(
+ "SUBSCRIBE\n" +
+ "destination:/topic/sometopic\n" +
+ "id:sub2\n" +
+ "persistent:true\n" +
+ "receipt:0\n" +
+ "\n")
+ wait_for_receipt("0")
+
+ client.close
+ connect("1.1")
+
+ // Now send a bunch of messages....
+ // Send only to sub 1
+ client.write(
+ "SEND\n" +
+ "destination:/dsub/sub1\n" +
+ "\n" +
+ "sub1 msg\n")
+
+ // Send to all subs
+ client.write(
+ "SEND\n" +
+ "destination:/topic/sometopic\n" +
+ "\n" +
+ "LAST\n")
+
+
+ // Now try to get all the previously sent messages.
+ def get(expected:String) = {
+ val frame = client.receive()
+ frame should startWith("MESSAGE\n")
+ frame should endWith("\n\n"+expected)
+ }
+
+ // Empty out the first durable sub
+ client.write(
+ "SUBSCRIBE\n" +
+ "destination:/dsub/sub1\n" +
+ "id:1\n" +
+ "\n")
+
+ get("sub1 msg\n")
+ get("LAST\n")
+
+ // Empty out the 2nd durable sub
+ client.write(
+ "SUBSCRIBE\n" +
+ "destination:/dsub/sub2\n" +
+ "id:2\n" +
+ "\n")
+
+ get("LAST\n")
+ }
+ test("You can connect and then unsubscribe from existing durable sub
(APLO-157)") {
connect("1.1")
subscribe("APLO-157", "/topic/APLO-157", "auto", true)
client.close()
@@ -1368,74 +1435,6 @@ class DurableSubscriptionOnLevelDBTest e
}
- test("Can directly send an recieve from a durable sub") {
- connect("1.1")
-
- // establish 2 durable subs..
- client.write(
- "SUBSCRIBE\n" +
- "destination:/topic/sometopic\n" +
- "id:sub1\n" +
- "persistent:true\n" +
- "receipt:0\n" +
- "\n")
- wait_for_receipt("0")
-
- client.write(
- "SUBSCRIBE\n" +
- "destination:/topic/sometopic\n" +
- "id:sub2\n" +
- "persistent:true\n" +
- "receipt:0\n" +
- "\n")
- wait_for_receipt("0")
-
- client.close
- connect("1.1")
-
- // Now send a bunch of messages....
- // Send only to sub 1
- client.write(
- "SEND\n" +
- "destination:/dsub/sub1\n" +
- "\n" +
- "sub1 msg\n")
-
- // Send to all subs
- client.write(
- "SEND\n" +
- "destination:/topic/sometopic\n" +
- "\n" +
- "LAST\n")
-
-
- // Now try to get all the previously sent messages.
- def get(expected:String) = {
- val frame = client.receive()
- frame should startWith("MESSAGE\n")
- frame should endWith("\n\n"+expected)
- }
-
- // Empty out the first durable sub
- client.write(
- "SUBSCRIBE\n" +
- "destination:/dsub/sub1\n" +
- "id:1\n" +
- "\n")
-
- get("sub1 msg\n")
- get("LAST\n")
-
- // Empty out the 2nd durable sub
- client.write(
- "SUBSCRIBE\n" +
- "destination:/dsub/sub2\n" +
- "id:2\n" +
- "\n")
-
- get("LAST\n")
- }
-
test("Direct send to a non-existant a durable sub fails") {
connect("1.1")