[jboss-cvs] JBoss Messaging SVN: r7794 - in branches/Branch_1_4: 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
Mon Aug 31 03:03:58 EDT 2009


Author: gaohoward
Date: 2009-08-31 03:03:58 -0400 (Mon, 31 Aug 2009)
New Revision: 7794

Modified:
   branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/ChannelSupport.java
   branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/OrderingGroupAckTest.java
Log:
https://jira.jboss.org/jira/browse/JBMESSAGING-1727


Modified: branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/ChannelSupport.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/ChannelSupport.java	2009-08-31 05:32:04 UTC (rev 7793)
+++ branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/ChannelSupport.java	2009-08-31 07:03:58 UTC (rev 7794)
@@ -1064,7 +1064,7 @@
                   }
                   synchronized (lock)
                   {
-                     promptDelivery = (promptDelivery || monitor.messageCompleted(ref));
+                     promptDelivery = (monitor.messageCompleted(ref) || promptDelivery);
                   }
                }
             }

Modified: branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/OrderingGroupAckTest.java
===================================================================
--- branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/OrderingGroupAckTest.java	2009-08-31 05:32:04 UTC (rev 7793)
+++ branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/OrderingGroupAckTest.java	2009-08-31 07:03:58 UTC (rev 7794)
@@ -1485,7 +1485,60 @@
          }
       }
    }
+   
+   /*
+    * https://jira.jboss.org/jira/browse/JBMESSAGING-1727
+    * This test sends 5 ordering messages, then in a tx sends one and receive one messages.
+    * Then try to receive all the rest messages.
+    */
+   public void testTransactionalDelivery() throws Exception
+   {
+      QueueConnection conn = null;
 
+      try
+      {
+         conn = cf.createQueueConnection();
+         QueueSession sess = conn.createQueueSession(true, Session.SESSION_TRANSACTED);
+         JBossMessageProducer producer = (JBossMessageProducer)sess.createProducer(queue1);
+         producer.enableOrderingGroup(null);
+
+         QueueReceiver cons = sess.createReceiver(queue1);
+
+         conn.start();
+
+         int numMsg = 5;
+         TextMessage msg = null;
+         for (int i = 0; i < numMsg; i++)
+         {
+            msg = sess.createTextMessage("tx-delivery" + i);
+            producer.send(msg);
+         }
+         sess.commit();
+         
+         msg = sess.createTextMessage("tx-delivery" + numMsg);
+         producer.send(msg);
+         TextMessage rm = (TextMessage)cons.receive(5000);
+         assertEquals("tx-delivery0", rm.getText());
+         sess.commit();
+         
+         for (int i = 0; i < numMsg; i++)
+         {
+            rm = (TextMessage)cons.receive(5000);
+            assertEquals("tx-delivery" + (i+1), rm.getText());
+            sess.commit();
+         }
+
+         checkEmpty(queue1);
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            conn.close();
+         }
+      }
+   }
+
    // Package protected ---------------------------------------------
 
    // Protected -----------------------------------------------------




More information about the jboss-cvs-commits mailing list