You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2013/02/18 17:41:26 UTC

svn commit: r1447383 - /activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/test/StompParallelTest.scala

Author: chirino
Date: Mon Feb 18 16:41:25 2013
New Revision: 1447383

URL: http://svn.apache.org/r1447383
Log:
also test topic variations of the transction test

Modified:
    activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/test/StompParallelTest.scala

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/test/StompParallelTest.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/test/StompParallelTest.scala?rev=1447383&r1=1447382&r2=1447383&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/test/StompParallelTest.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/test/StompParallelTest.scala Mon Feb 18 16:41:25 2013
@@ -1628,36 +1628,39 @@ class StompParallelTest extends StompTes
 
   }
 
-  test("Transaction commit order") {
-    connect("1.1")
-    val dest = next_id("/queue/send_transaction-")
-
-    async_send(dest, "m1")
-
-    client.write(
-      "BEGIN\n" +
-      "transaction:x\n" +
-      "\n")
-
-    async_send(dest, "t1", "transaction:x\n")
-    async_send(dest, "m2")
-    async_send(dest, "t2", "transaction:x\n")
-
-    client.write(
-      "COMMIT\n" +
-      "transaction:x\n" +
-      "receipt:0\n"+
-      "\n")
-    wait_for_receipt("0")
-
-    async_send(dest, "m3")
-
-    subscribe("mysub",dest)
-
-    assert_received("m1")
-    assert_received("m2")
-    assert_received("t1")
-    assert_received("t2")
-    assert_received("m3")
+  for( kind <- Array("/queue/", "/topic/", "/topic/queued.")) {
+    test("Transaction commit order on "+kind) {
+
+      val dest = next_id(kind+"send_transaction-")
+
+      val receiver = connect("1.1", new StompClient)
+      subscribe("mysub",dest,c=receiver)
+
+      connect("1.1")
+      async_send(dest, "m1")
+
+      client.write(
+        "BEGIN\n" +
+        "transaction:x\n" +
+        "\n")
+
+      async_send(dest, "t1", "transaction:x\n")
+      async_send(dest, "m2")
+      async_send(dest, "t2", "transaction:x\n")
+
+      client.write(
+        "COMMIT\n" +
+        "transaction:x\n" +
+        "receipt:0\n"+
+        "\n")
+      wait_for_receipt("0")
+      async_send(dest, "m3")
+
+      assert_received("m1",c=receiver)
+      assert_received("m2",c=receiver)
+      assert_received("t1",c=receiver)
+      assert_received("t2",c=receiver)
+      assert_received("m3",c=receiver)
+    }
   }
 }