[jboss-cvs] JBoss Messaging SVN: r1379 - trunk/tests/src/org/jboss/test/messaging/core/local/base

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 28 16:54:38 EDT 2006


Author: ovidiu.feodorov at jboss.com
Date: 2006-09-28 16:54:37 -0400 (Thu, 28 Sep 2006)
New Revision: 1379

Modified:
   trunk/tests/src/org/jboss/test/messaging/core/local/base/PagingFilteredQueueTestBase.java
Log:
defined better the contract in case of duplicate acknowledgments: duplicated acknowledgments are NOT allowed. Fixed the failing test

Modified: trunk/tests/src/org/jboss/test/messaging/core/local/base/PagingFilteredQueueTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/local/base/PagingFilteredQueueTestBase.java	2006-09-28 20:53:03 UTC (rev 1378)
+++ trunk/tests/src/org/jboss/test/messaging/core/local/base/PagingFilteredQueueTestBase.java	2006-09-28 20:54:37 UTC (rev 1379)
@@ -5268,12 +5268,20 @@
       Message ackm = (Message)messages.get(0);
       assertEquals(0, ackm.getMessageID());
 
-      // an extra acknowledgment should be discarded
-      
-      //TODO - why should it be discarded?
-      //If you acknowledge twice surely this is a usage error?
-      r.acknowledge(ackm, null);
+      // Acknowledgment handling implemenation is NOT idempotent, the channel DOES NOT allow
+      // extraneous duplicate acknowlegments, so we test for that.
 
+      try
+      {
+         r.acknowledge(ackm, null);
+      }
+      catch(IllegalStateException e)
+      {
+         // OK
+         log.info(e);
+
+      }
+
       assertTrue(queue.browse().isEmpty());
    }
 




More information about the jboss-cvs-commits mailing list