[jboss-cvs] JBoss Messaging SVN: r5875 - trunk/tests/joram-tests/src/org/objectweb/jtests/jms/conform/message/properties.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Feb 16 10:54:21 EST 2009


Author: jmesnil
Date: 2009-02-16 10:54:21 -0500 (Mon, 16 Feb 2009)
New Revision: 5875

Modified:
   trunk/tests/joram-tests/src/org/objectweb/jtests/jms/conform/message/properties/JMSXPropertyTest.java
Log:
removed testSupportsJMSXGroupSeq (since its support is optional)
rewrote testJMSXDeliveryCount to run it only if JMSXDeliveryCount is supported

Modified: trunk/tests/joram-tests/src/org/objectweb/jtests/jms/conform/message/properties/JMSXPropertyTest.java
===================================================================
--- trunk/tests/joram-tests/src/org/objectweb/jtests/jms/conform/message/properties/JMSXPropertyTest.java	2009-02-16 15:50:49 UTC (rev 5874)
+++ trunk/tests/joram-tests/src/org/objectweb/jtests/jms/conform/message/properties/JMSXPropertyTest.java	2009-02-16 15:54:21 UTC (rev 5875)
@@ -99,63 +99,17 @@
       }
    }
 
-   /**
-    * Test that the JMSX property <code>JMSXGroupSeq</code> is supported.
-    */
-   public void testSupportsJMSXGroupSeq()
-   {
-      try
-      {
-         boolean found = false;
-         ConnectionMetaData metaData = senderConnection.getMetaData();
-         Enumeration enumeration = metaData.getJMSXPropertyNames();
-         while (enumeration.hasMoreElements())
-         {
-            String jmsxPropertyName = (String) enumeration.nextElement();
-            if (jmsxPropertyName.equals("JMSXGroupSeq"))
-            {
-               found = true;
-            }
-         }
-         assertTrue("JMSXGroupSeq property is not supported", found);
-      }
-      catch (JMSException e)
-      {
-         fail(e);
-      }
-   }
 
    /**
-    * Test that the JMSX property <code>JMSXDeliveryCount</code> is supported.
+    * Test that the JMSX property <code>JMSXDeliveryCount</code> works.
     */
-   public void testSupportsJMSXDeliveryCount()
+   public void testJMSXDeliveryCount() throws Exception
    {
-      try
+      if (!supportsJMSXDeliveryCount())
       {
-         boolean found = false;
-         ConnectionMetaData metaData = senderConnection.getMetaData();
-         Enumeration enumeration = metaData.getJMSXPropertyNames();
-         while (enumeration.hasMoreElements())
-         {
-            String jmsxPropertyName = (String) enumeration.nextElement();
-            if (jmsxPropertyName.equals("JMSXDeliveryCount"))
-            {
-               found = true;
-            }
-         }
-         assertTrue("JMSXDeliveryCount property is not supported", found);
+         return;
       }
-      catch (JMSException e)
-      {
-         fail(e);
-      }
-   }
-
-   /**
-    * Test that the JMSX property <code>JMSXDeliveryCount</code> works.
-    */
-   public void testJMSXDeliveryCount()
-   {
+      
       try
       {
          senderConnection.stop();
@@ -225,6 +179,25 @@
       }
    }
 
+
+   /**
+    * checks if the JMSX property <code>JMSXDeliveryCount</code> is supported.
+    */
+   private boolean supportsJMSXDeliveryCount() throws Exception
+   {
+      ConnectionMetaData metaData = senderConnection.getMetaData();
+      Enumeration enumeration = metaData.getJMSXPropertyNames();
+      while (enumeration.hasMoreElements())
+      {
+         String jmsxPropertyName = (String) enumeration.nextElement();
+         if (jmsxPropertyName.equals("JMSXDeliveryCount"))
+         {
+            return true;
+         }
+      }
+      return false;
+   }
+   
    /** 
     * Method to use this class in a Test suite
     */




More information about the jboss-cvs-commits mailing list