[jboss-cvs] JBoss Messaging SVN: r7482 - in branches/Branch_1_4: tests/src/org/jboss/test/messaging/jms/server/destination and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jun 26 13:03:46 EDT 2009


Author: gaohoward
Date: 2009-06-26 13:03:46 -0400 (Fri, 26 Jun 2009)
New Revision: 7482

Modified:
   branches/Branch_1_4/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java
   branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/server/destination/QueueManagementTest.java
   branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/server/destination/TopicManagementTest.java
Log:
JBMESSAGING-1644


Modified: branches/Branch_1_4/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java	2009-06-26 16:41:27 UTC (rev 7481)
+++ branches/Branch_1_4/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java	2009-06-26 17:03:46 UTC (rev 7482)
@@ -416,7 +416,11 @@
 
    public void setMessageCounterHistoryDayLimit(int limit) throws Exception
    {
-      destination.setMessageCounterHistoryDayLimit(limit);
+      //https://jira.jboss.org/jira/browse/JBMESSAGING-1668
+      if (started || (destination instanceof ManagedQueue))
+      {
+         destination.setMessageCounterHistoryDayLimit(limit);
+      }
    }
 
    public int getMaxDeliveryAttempts()

Modified: branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/server/destination/QueueManagementTest.java
===================================================================
--- branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/server/destination/QueueManagementTest.java	2009-06-26 16:41:27 UTC (rev 7481)
+++ branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/server/destination/QueueManagementTest.java	2009-06-26 17:03:46 UTC (rev 7482)
@@ -873,6 +873,23 @@
 
    }
 
+   public void testQueueDeploymentWithRuntimeAttr() throws Exception
+   {      
+      String config =
+         "<mbean code=\"org.jboss.jms.server.destination.QueueService\" " +
+         "       name=\"somedomain:service=Queue,name=rtQueue\"" +
+         "       xmbean-dd=\"xmdesc/Queue-xmbean.xml\">" +
+         "    <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>" +
+         "    <attribute name=\"MessageCounterHistoryDayLimit\">10</attribute>" +
+         "</mbean>";
+      
+      ObjectName on = deploy(config);
+      Integer count = ((Integer)ServerManagement.getAttribute(on, "MessageCounterHistoryDayLimit")).intValue();
+      
+      assertEquals(10, count.intValue());
+      undeployDestination("rtQueue");
+   }
+
    // Package protected ---------------------------------------------
 
    // Protected -----------------------------------------------------

Modified: branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/server/destination/TopicManagementTest.java
===================================================================
--- branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/server/destination/TopicManagementTest.java	2009-06-26 16:41:27 UTC (rev 7481)
+++ branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/server/destination/TopicManagementTest.java	2009-06-26 17:03:46 UTC (rev 7482)
@@ -885,7 +885,28 @@
       
       }
    }
+   
+   //https://jira.jboss.org/jira/browse/JBMESSAGING-1668
+   public void testTopicDeploymentWithRuntimeAttr() throws Exception
+   {      
+      String config =
+         "<mbean code=\"org.jboss.jms.server.destination.TopicService\" " +
+         "       name=\"somedomain:service=Topic,name=rtTopic\"" +
+         "       xmbean-dd=\"xmdesc/Topic-xmbean.xml\">" +
+         "    <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>" +
+         "    <attribute name=\"MessageCounterHistoryDayLimit\">10</attribute>" +
+         "</mbean>";
+      
+      ObjectName on = deploy(config);
+      Integer count = ((Integer)ServerManagement.getAttribute(on, "MessageCounterHistoryDayLimit")).intValue();
+      assertEquals(-1, count.intValue());
+      
+      ServerManagement.setAttribute(on, "MessageCounterHistoryDayLimit", "10");
+      count = ((Integer)ServerManagement.getAttribute(on, "MessageCounterHistoryDayLimit")).intValue();
+      assertEquals(10, count.intValue());      
 
+      undeployDestination("rtTopic");
+   }
 
 
    // Package protected ---------------------------------------------




More information about the jboss-cvs-commits mailing list