qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r1368506 - in /qpid/trunk/qpid/java/broker/src: main/java/org/apache/qpid/server/configuration/ test/java/org/apache/qpid/server/configuration/
Date Thu, 02 Aug 2012 15:03:25 GMT
Author: robbie
Date: Thu Aug  2 15:03:25 2012
New Revision: 1368506

URL: http://svn.apache.org/viewvc?rev=1368506&view=rev
Log:
QPID-4182: Set the default minimumAlertRepeatGap value to 30 seconds

Applied patch from Philip Harvey <phil@philharveyonline.com> and Oleksandr Rudyy<orudyy@gmail.com>

Modified:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java?rev=1368506&r1=1368505&r2=1368506&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java
Thu Aug  2 15:03:25 2012
@@ -66,6 +66,7 @@ public class ServerConfiguration extends
     public static final int JMXPORT_CONNECTORSERVER_OFFSET = 100;
     public static final int DEFAULT_HTTP_MANAGEMENT_PORT = 8080;
     public static final int DEFAULT_HTTPS_MANAGEMENT_PORT = 8443;
+    public static final long DEFAULT_MINIMUM_ALERT_REPEAT_GAP = 30000l;
 
     public static final String QPID_HOME = "QPID_HOME";
     public static final String QPID_WORK = "QPID_WORK";
@@ -713,7 +714,7 @@ public class ServerConfiguration extends
 
     public long getMinimumAlertRepeatGap()
     {
-        return getLongValue("minimumAlertRepeatGap");
+        return getLongValue("minimumAlertRepeatGap", DEFAULT_MINIMUM_ALERT_REPEAT_GAP);
     }
 
     public long getCapacity()

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java?rev=1368506&r1=1368505&r2=1368506&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
Thu Aug  2 15:03:25 2012
@@ -270,7 +270,7 @@ public class VirtualHostConfiguration ex
 
     public Long getMinimumAlertRepeatGap()
     {
-        return getLongValue("queues.minimumAlertRepeatGap");
+        return getLongValue("queues.minimumAlertRepeatGap", ApplicationRegistry.getInstance().getConfiguration().getMinimumAlertRepeatGap());
     }
 
     public long getCapacity()

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java?rev=1368506&r1=1368505&r2=1368506&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
(original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
Thu Aug  2 15:03:25 2012
@@ -176,20 +176,29 @@ public class QueueConfigurationTest exte
         assertEquals(1, qConf.getMaximumMessageCount());
     }
 
-    public void testGetMinimumAlertRepeatGap() throws ConfigurationException
+    public void testGetMinimumAlertRepeatGap() throws Exception
     {
-        // Check default value
-        QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
-        assertEquals(0, qConf.getMinimumAlertRepeatGap());
-
-        // Check explicit value
-        VirtualHostConfiguration vhostConfig = overrideConfiguration("minimumAlertRepeatGap",
2);
-        qConf = new QueueConfiguration("test", vhostConfig);
-        assertEquals(2, qConf.getMinimumAlertRepeatGap());
-
-        // Check inherited value
-        qConf = new QueueConfiguration("test", _fullHostConf);
-        assertEquals(1, qConf.getMinimumAlertRepeatGap());
+        try
+        {
+            ApplicationRegistry registry = new TestApplicationRegistry(new ServerConfiguration(_env));
+            ApplicationRegistry.initialise(registry);
+            // Check default value
+            QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
+            assertEquals(ServerConfiguration.DEFAULT_MINIMUM_ALERT_REPEAT_GAP, qConf.getMinimumAlertRepeatGap());
+
+            // Check explicit value
+            VirtualHostConfiguration vhostConfig = overrideConfiguration("minimumAlertRepeatGap",
2);
+            qConf = new QueueConfiguration("test", vhostConfig);
+            assertEquals(2, qConf.getMinimumAlertRepeatGap());
+
+            // Check inherited value
+            qConf = new QueueConfiguration("test", _fullHostConf);
+            assertEquals(1, qConf.getMinimumAlertRepeatGap());
+        }
+        finally
+        {
+            ApplicationRegistry.remove();
+        }
     }
 
     public void testSortQueueConfiguration() throws ConfigurationException

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java?rev=1368506&r1=1368505&r2=1368506&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java
(original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java
Thu Aug  2 15:03:25 2012
@@ -394,7 +394,7 @@ public class ServerConfigurationTest ext
     {
         // Check default
         _serverConfig.initialise();
-        assertEquals(0, _serverConfig.getMinimumAlertRepeatGap());
+        assertEquals(30000l, _serverConfig.getMinimumAlertRepeatGap());
 
         // Check value we set
         _config.setProperty("minimumAlertRepeatGap", 10L);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message