activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r687954 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
Date Fri, 22 Aug 2008 05:56:45 GMT
Author: jstrachan
Date: Thu Aug 21 22:56:44 2008
New Revision: 687954

URL: http://svn.apache.org/viewvc?rev=687954&view=rev
Log:
improved test to also add JMSDeliveryMode test for AMQ-1904

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java?rev=687954&r1=687953&r2=687954&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
Thu Aug 21 22:56:44 2008
@@ -144,16 +144,18 @@
         echo("Create QueueView MBean...");
         QueueViewMBean proxy = (QueueViewMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServer,
queueViewMBeanName, QueueViewMBean.class, true);
 
+        proxy.purge();
+        
         int count = 5;
         for (int i = 0; i < count; i++) {
             String body = "message:" + i;
 
             Map headers = new HashMap();
             headers.put("JMSCorrelationID", "MyCorrId");
-            headers.put("JMSDeliveryMode", Boolean.TRUE);
+            headers.put("JMSDeliveryMode", Boolean.FALSE);
             headers.put("JMSXGroupID", "MyGroupID");
             headers.put("JMSXGroupSeq", 1234);
-            headers.put("JMSPriority", i);
+            headers.put("JMSPriority", i + 1);
             headers.put("JMSType", "MyType");
             headers.put("MyHeader", i);
             headers.put("MyStringHeader", "StringHeader" + i);
@@ -174,11 +176,12 @@
                 echo("Columns: " + cdata.getCompositeType().keySet());
             }
 
-            assertComplexData(cdata, "JMSCorrelationID", "MyCorrId");
-            assertComplexData(cdata, "JMSPriority", i);
-            assertComplexData(cdata, "JMSType", "MyType");
-            assertComplexData(cdata, "JMSCorrelationID", "MyCorrId");
-            assertComplexData(cdata, "PropertiesText", "{MyStringHeader=StringHeader" + i
+ ", MyHeader=" + i + "}");
+            assertComplexData(i, cdata, "JMSCorrelationID", "MyCorrId");
+            assertComplexData(i, cdata, "JMSPriority", i + 1);
+            assertComplexData(i, cdata, "JMSType", "MyType");
+            assertComplexData(i, cdata, "JMSCorrelationID", "MyCorrId");
+            assertComplexData(i, cdata, "JMSDeliveryMode", "NON-PERSISTENT");
+            assertComplexData(i, cdata, "PropertiesText", "{MyStringHeader=StringHeader"
+ i + ", MyHeader=" + i + "}");
 
             Map intProperties = CompositeDataHelper.getTabularMap(cdata, CompositeDataConstants.INT_PROPERTIES);
             assertEquals("intProperties size()", 1, intProperties.size());
@@ -193,16 +196,16 @@
             assertEquals("properties.MyHeader", i, properties.get("MyHeader"));
             assertEquals("properties.MyHeader", "StringHeader" + i, properties.get("MyStringHeader"));
 
-            assertComplexData(cdata, "JMSXGroupSeq", 1234);
-            assertComplexData(cdata, "JMSXGroupID", "MyGroupID");
-            assertComplexData(cdata, "Text", "message:" + i);
+            assertComplexData(i, cdata, "JMSXGroupSeq", 1234);
+            assertComplexData(i, cdata, "JMSXGroupID", "MyGroupID");
+            assertComplexData(i, cdata, "Text", "message:" + i);
 
         }
     }
 
-    protected void assertComplexData(CompositeData cdata, String name, Object expected) {
+    protected void assertComplexData(int messageIndex, CompositeData cdata, String name,
Object expected) {
         Object value = cdata.get(name);
-        assertEquals("CData field: " + name, expected, value);
+        assertEquals("Message " + messageIndex + " CData field: " + name, expected, value);
     }
 
 



Mime
View raw message