[jboss-cvs] JBoss Messaging SVN: r3689 - in trunk: tests/src/org/jboss/test/messaging/jms and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 8 14:44:35 EST 2008


Author: timfox
Date: 2008-02-08 14:44:35 -0500 (Fri, 08 Feb 2008)
New Revision: 3689

Modified:
   trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
   trunk/tests/src/org/jboss/test/messaging/jms/TransactedSessionTest.java
Log:
Fixed test


Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2008-02-08 19:11:23 UTC (rev 3688)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2008-02-08 19:44:35 UTC (rev 3689)
@@ -441,12 +441,19 @@
       {
          // Add any unacked deliveries into the tx
          // Doing this ensures all references are rolled back in the correct
-         // order
-         // in a single contiguous block
+         // orderin a single contiguous block
 
          for (Delivery del : deliveries)
          {
             tx.addAcknowledgement(del.getReference());
+            
+            //We need this - since with auto commit acks, the last ack is considered delivered before it
+            //is acked - e.g. a JMS MessageListener where a RuntimException is thrown from onMessage
+            //in this case we want to ensure that the redelivered flag is set
+            if (autoCommitAcks)
+            {
+               del.getReference().incrementDeliveryCount();
+            }
          }
 
          deliveries.clear();

Modified: trunk/tests/src/org/jboss/test/messaging/jms/TransactedSessionTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/TransactedSessionTest.java	2008-02-08 19:11:23 UTC (rev 3688)
+++ trunk/tests/src/org/jboss/test/messaging/jms/TransactedSessionTest.java	2008-02-08 19:44:35 UTC (rev 3689)
@@ -526,7 +526,7 @@
 
          assertEquals("a message", tm.getText());
 
-         assertEquals(3, tm.getIntProperty("JMSXDeliveryCount"));
+         assertEquals(2, tm.getIntProperty("JMSXDeliveryCount"));
 
          assertTrue(tm.getJMSRedelivered());
       }




More information about the jboss-cvs-commits mailing list