You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2007/02/14 12:39:35 UTC

svn commit: r507491 - in /incubator/qpid/branches/qpid.0-9/python/tests: message.py tx.py

Author: gsim
Date: Wed Feb 14 03:39:26 2007
New Revision: 507491

URL: http://svn.apache.org/viewvc?view=rev&rev=507491
Log:
Expanded the use of batched acks to a few other places in tests.


Modified:
    incubator/qpid/branches/qpid.0-9/python/tests/message.py
    incubator/qpid/branches/qpid.0-9/python/tests/tx.py

Modified: incubator/qpid/branches/qpid.0-9/python/tests/message.py
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/python/tests/message.py?view=diff&rev=507491&r1=507490&r2=507491
==============================================================================
--- incubator/qpid/branches/qpid.0-9/python/tests/message.py (original)
+++ incubator/qpid/branches/qpid.0-9/python/tests/message.py Wed Feb 14 03:39:26 2007
@@ -171,8 +171,7 @@
         self.assertEqual("Four", msg4.body)
         self.assertEqual("Five", msg5.body)
 
-        msg1.ok()
-        msg2.ok()
+        msg1.ok(batchoffset=1)#One and Two
         msg4.ok()
 
         channel.message_recover(requeue=False)
@@ -216,9 +215,8 @@
         self.assertEqual("Four", msg4.body)
         self.assertEqual("Five", msg5.body)
 
-        msg1.ok()  #One
-        msg2.ok()  #Two
-        msg4.ok()  #Two
+        msg1.ok(batchoffset=1)  #One and Two
+        msg4.ok()  #Four
 
         channel.message_cancel(destination="consumer_tag")
         channel.message_consume(queue="test-requeue", destination="consumer_tag")
@@ -263,11 +261,9 @@
             channel.message_transfer(routing_key="test-prefetch-count", body="Message %d" % i)
 
         #only 5 messages should have been delivered:
-        msgs = []
         for i in range(1, 6):
             msg = queue.get(timeout=1)
             self.assertEqual("Message %d" % i, msg.body)
-            msgs.append(msg)
         try:
             extra = queue.get(timeout=1)
             self.fail("Got unexpected 6th message in original queue: " + extra.body)
@@ -275,18 +271,13 @@
 
         #ack messages and check that the next set arrive ok:
         #todo: once batching is implmented, send a single response for all messages
-        for msg in msgs:
-            msg.ok()
-        msgs = []    
+        msg.ok(batchoffset=-4)#1-5
 
         for i in range(6, 11):
             msg = queue.get(timeout=1)
             self.assertEqual("Message %d" % i, msg.body)
-            msgs.append(msg)
 
-        for msg in msgs:
-            msg.ok()
-        msgs = []    
+        msg.ok(batchoffset=-4)#6-10
 
         try:
             extra = queue.get(timeout=1)
@@ -313,11 +304,9 @@
             channel.message_transfer(routing_key="test-prefetch-size", body="Message %d" % i)
 
         #only 5 messages should have been delivered (i.e. 45 bytes worth):
-        msgs = []
         for i in range(1, 6):
             msg = queue.get(timeout=1)
             self.assertEqual("Message %d" % i, msg.body)
-            msgs.append(msg)
 
         try:
             extra = queue.get(timeout=1)
@@ -325,18 +314,13 @@
         except Empty: None
 
         #ack messages and check that the next set arrive ok:
-        for msg in msgs:
-            msg.ok()
-        msgs = []    
+        msg.ok(batchoffset=-4)#1-5
 
         for i in range(6, 11):
             msg = queue.get(timeout=1)
             self.assertEqual("Message %d" % i, msg.body)
-            msgs.append(msg)
 
-        for msg in msgs:
-            msg.ok()
-        msgs = []    
+        msg.ok(batchoffset=-4)#6-10
 
         try:
             extra = queue.get(timeout=1)
@@ -386,7 +370,7 @@
             self.assertEqual("Message %d" % i, msg.body)
             
             if (i==13):
-              msg.ok(batchoffset=-2)
+              msg.ok(batchoffset=-2)#11, 12 & 13
             if(i in [15, 17, 19]):
               msg.ok()
 

Modified: incubator/qpid/branches/qpid.0-9/python/tests/tx.py
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/python/tests/tx.py?view=diff&rev=507491&r1=507490&r2=507491
==============================================================================
--- incubator/qpid/branches/qpid.0-9/python/tests/tx.py (original)
+++ incubator/qpid/branches/qpid.0-9/python/tests/tx.py Wed Feb 14 03:39:26 2007
@@ -163,7 +163,8 @@
         for i in range(1, 5):
             msg = queue_a.get(timeout=1)
             self.assertEqual("Message %d" % i, msg.body)
-            msg.ok()
+
+        msg.ok(batchoffset=-3)
 
         channel.message_consume(queue=name_b, destination="sub_b", no_ack=False)
         queue_b = self.client.queue("sub_b")