[rhmessaging-commits] rhmessaging commits: r4122 - store/trunk/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Fri Jul 16 11:23:15 EDT 2010


Author: rgemmell
Date: 2010-07-16 11:23:14 -0400 (Fri, 16 Jul 2010)
New Revision: 4122

Modified:
   store/trunk/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
Log:
Additional upgrade tool test to check that durable subscription queue has its exclusivity set.


Modified: store/trunk/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
===================================================================
--- store/trunk/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java	2010-07-15 20:22:48 UTC (rev 4121)
+++ store/trunk/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java	2010-07-16 15:23:14 UTC (rev 4122)
@@ -40,6 +40,8 @@
 import javax.jms.TopicSession;
 import javax.jms.TopicSubscriber;
 
+import org.apache.qpid.management.common.mbeans.ManagedQueue;
+import org.apache.qpid.test.utils.JMXTestUtils;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
 import org.apache.qpid.util.FileUtils;
 import org.slf4j.Logger;
@@ -158,6 +160,38 @@
     }
 
     /**
+     * Test that the backing queue for the durable subscription created was successfully
+     * detected and set as being exclusive during the upgrade process, and that the
+     * regular queue was not.
+     */
+    public void testQueueExclusivity() throws Exception
+    {
+        JMXTestUtils jmxUtils = null;
+        try
+        {
+            jmxUtils = new JMXTestUtils(this, "guest", "guest");
+            jmxUtils.open();
+        }
+        catch (Exception e)
+        {
+            fail("Unable to establish JMX connection, test cannot proceed");
+        }
+
+        try
+        {
+            ManagedQueue queue = jmxUtils.getManagedQueue(QUEUE_NAME);
+            assertFalse("Queue should not have been marked as Exclusive during upgrade", queue.isExclusive());
+
+            ManagedQueue dursubQueue = jmxUtils.getManagedQueue("clientid" + "-" + SUB_NAME);
+            assertTrue("DurableSubscription backing queue should have been marked as Exclusive during upgrade", dursubQueue.isExclusive());
+        }
+        finally
+        {
+            jmxUtils.close();
+        }
+    }
+
+    /**
      * Test that the upgraded queue continues to function properly when used
      * for persistent messaging and restarting the broker. 
      * 



More information about the rhmessaging-commits mailing list