qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ritch...@apache.org
Subject svn commit: r942105 - in /qpid/trunk/qpid/java: broker/src/test/java/org/apache/qpid/server/configuration/ broker/src/test/java/org/apache/qpid/server/queue/ systests/src/main/java/org/apache/qpid/server/logging/
Date Fri, 07 May 2010 15:10:55 GMT
Author: ritchiem
Date: Fri May  7 15:10:55 2010
New Revision: 942105

URL: http://svn.apache.org/viewvc?rev=942105&view=rev
Log:
QPID-2583 : Update tests to correctly throw ConfigurationException where requried and to correctly
configure configuration

Modified:
    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
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/DerbyMessageStoreLoggingTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/MemoryMessageStoreLoggingTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java

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=942105&r1=942104&r2=942105&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
Fri May  7 15:10:55 2010
@@ -22,6 +22,7 @@ package org.apache.qpid.server.configura
 
 import junit.framework.TestCase;
 
+import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.PropertiesConfiguration;
 
 public class QueueConfigurationTest extends TestCase
@@ -48,7 +49,7 @@ public class QueueConfigurationTest exte
         
     }
 
-    public void testGetMaximumMessageAge()
+    public void testGetMaximumMessageAge() throws ConfigurationException
     {
         // Check default value
         QueueConfiguration qConf = new QueueConfiguration("test", _env, _emptyConf);    
   
@@ -65,7 +66,7 @@ public class QueueConfigurationTest exte
         assertEquals(1, qConf.getMaximumMessageAge());
     }
 
-    public void testGetMaximumQueueDepth()
+    public void testGetMaximumQueueDepth() throws ConfigurationException
     {
         // Check default value
         QueueConfiguration qConf = new QueueConfiguration("test", _env, _emptyConf);    
   
@@ -82,7 +83,7 @@ public class QueueConfigurationTest exte
         assertEquals(1, qConf.getMaximumQueueDepth());
     }
 
-    public void testGetMaximumMessageSize()
+    public void testGetMaximumMessageSize() throws ConfigurationException
     {
         // Check default value
         QueueConfiguration qConf = new QueueConfiguration("test", _env, _emptyConf);    
   
@@ -99,7 +100,7 @@ public class QueueConfigurationTest exte
         assertEquals(1, qConf.getMaximumMessageSize());
     }
 
-    public void testGetMaximumMessageCount()
+    public void testGetMaximumMessageCount() throws ConfigurationException
     {
        // Check default value
         QueueConfiguration qConf = new QueueConfiguration("test", _env, _emptyConf);    
   
@@ -116,7 +117,7 @@ public class QueueConfigurationTest exte
         assertEquals(1, qConf.getMaximumMessageCount());
     }
 
-    public void testGetMinimumAlertRepeatGap()
+    public void testGetMinimumAlertRepeatGap() throws ConfigurationException
     {
         // Check default value
         QueueConfiguration qConf = new QueueConfiguration("test", _env, _emptyConf);    
   

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=942105&r1=942104&r2=942105&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
Fri May  7 15:10:55 2010
@@ -65,6 +65,7 @@ public class ServerConfigurationTest ext
     public void testSetJMXManagementPort() throws ConfigurationException
     {
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         serverConfig.setJMXManagementPort(23);
         assertEquals(23, serverConfig.getJMXManagementPort());
     }
@@ -73,6 +74,7 @@ public class ServerConfigurationTest ext
     {
         _config.setProperty("management.jmxport", 42);
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(42, serverConfig.getJMXManagementPort());
     }
 
@@ -80,11 +82,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(true, serverConfig.getPlatformMbeanserver());
 
         // Check value we set
         _config.setProperty("management.platform-mbeanserver", false);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getPlatformMbeanserver());
     }
 
@@ -92,11 +96,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(null, serverConfig.getPluginDirectory());
 
         // Check value we set
         _config.setProperty("plugin-directory", "/path/to/plugins");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals("/path/to/plugins", serverConfig.getPluginDirectory());
     }
 
@@ -104,12 +110,14 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(0, serverConfig.getPrincipalDatabaseNames().size());
 
         // Check value we set
         _config.setProperty("security.principal-databases.principal-database(0).name", "a");
         _config.setProperty("security.principal-databases.principal-database(1).name", "b");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         List<String> dbs = serverConfig.getPrincipalDatabaseNames();
         assertEquals(2, dbs.size());
         assertEquals("a", dbs.get(0));
@@ -120,12 +128,14 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(0, serverConfig.getPrincipalDatabaseClass().size());
 
         // Check value we set
         _config.setProperty("security.principal-databases.principal-database(0).class", "a");
         _config.setProperty("security.principal-databases.principal-database(1).class", "b");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         List<String> dbs = serverConfig.getPrincipalDatabaseClass();
         assertEquals(2, dbs.size());
         assertEquals("a", dbs.get(0));
@@ -136,12 +146,14 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(0, serverConfig.getPrincipalDatabaseAttributeNames(1).size());
 
         // Check value we set
         _config.setProperty("security.principal-databases.principal-database(0).attributes(0).attribute.name",
"a");
         _config.setProperty("security.principal-databases.principal-database(0).attributes(1).attribute.name",
"b");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         List<String> dbs = serverConfig.getPrincipalDatabaseAttributeNames(0);
         assertEquals(2, dbs.size());
         assertEquals("a", dbs.get(0));
@@ -152,12 +164,14 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(0, serverConfig.getPrincipalDatabaseAttributeValues(1).size());
 
         // Check value we set
         _config.setProperty("security.principal-databases.principal-database(0).attributes(0).attribute.value",
"a");
         _config.setProperty("security.principal-databases.principal-database(0).attributes(1).attribute.value",
"b");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         List<String> dbs = serverConfig.getPrincipalDatabaseAttributeValues(0);
         assertEquals(2, dbs.size());
         assertEquals("a", dbs.get(0));
@@ -168,12 +182,14 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(0, serverConfig.getManagementAccessList().size());
 
         // Check value we set
         _config.setProperty("security.jmx.access(0)", "a");
         _config.setProperty("security.jmx.access(1)", "b");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         List<String> dbs = serverConfig.getManagementAccessList();
         assertEquals(2, dbs.size());
         assertEquals("a", dbs.get(0));
@@ -184,11 +200,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(65536, serverConfig.getFrameSize());
 
         // Check value we set
         _config.setProperty("advanced.framesize", "23");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(23, serverConfig.getFrameSize());
     }
 
@@ -196,11 +214,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getProtectIOEnabled());
 
         // Check value we set
         _config.setProperty(ServerConfiguration.CONNECTOR_PROTECTIO_ENABLED, true);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(true, serverConfig.getProtectIOEnabled());
     }
 
@@ -208,11 +228,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(262144, serverConfig.getBufferReadLimit());
 
         // Check value we set
         _config.setProperty(ServerConfiguration.CONNECTOR_PROTECTIO_READ_BUFFER_LIMIT_SIZE,
23);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(23, serverConfig.getBufferReadLimit());
     }
 
@@ -220,11 +242,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(262144, serverConfig.getBufferWriteLimit());
 
         // Check value we set
         _config.setProperty(ServerConfiguration.CONNECTOR_PROTECTIO_WRITE_BUFFER_LIMIT_SIZE,
23);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(23, serverConfig.getBufferWriteLimit());
     }
 
@@ -233,17 +257,20 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(ServerConfiguration.DEFAULT_STATUS_UPDATES.equalsIgnoreCase("on"),
                      serverConfig.getStatusUpdatesEnabled());
 
         // Check disabling we set
         _config.setProperty(ServerConfiguration.STATUS_UPDATES, "off");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getStatusUpdatesEnabled());
 
         // Check invalid values don't cause error but result in disabled
         _config.setProperty(ServerConfiguration.STATUS_UPDATES, "Yes Please");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getStatusUpdatesEnabled());
 
     }
@@ -251,11 +278,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getSynchedClocks());
 
         // Check value we set
         _config.setProperty("advanced.synced-clocks", true);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(true, serverConfig.getSynchedClocks());
     }
 
@@ -263,6 +292,7 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
 
         // The Default is what ever the VMs default is
         Locale defaultLocale = Locale.getDefault();
@@ -274,18 +304,21 @@ public class ServerConfigurationTest ext
         Locale update = new Locale("es");
         _config.setProperty(ServerConfiguration.ADVANCED_LOCALE, "es");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(update, serverConfig.getLocale());
 
         //Test Language and Country
         update = new Locale("es","ES");
         _config.setProperty(ServerConfiguration.ADVANCED_LOCALE, "es_ES");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(update, serverConfig.getLocale());
 
         //Test Language and Country and Variant
         update = new Locale("es","ES", "Traditional_WIN");
         _config.setProperty(ServerConfiguration.ADVANCED_LOCALE, "es_ES_Traditional_WIN");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(update, serverConfig.getLocale());
     }
 
@@ -294,11 +327,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getMsgAuth());
 
         // Check value we set
         _config.setProperty("security.msg-auth", true);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(true, serverConfig.getMsgAuth());
     }
 
@@ -306,11 +341,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(null, serverConfig.getJMXPrincipalDatabase());
 
         // Check value we set
         _config.setProperty("security.jmx.principal-database", "a");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals("a", serverConfig.getJMXPrincipalDatabase());
     }
 
@@ -318,11 +355,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(null, serverConfig.getManagementKeyStorePath());
 
         // Check value we set
         _config.setProperty("management.ssl.keyStorePath", "a");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals("a", serverConfig.getManagementKeyStorePath());
     }
 
@@ -330,11 +369,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(true, serverConfig.getManagementSSLEnabled());
 
         // Check value we set
         _config.setProperty("management.ssl.enabled", false);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getManagementSSLEnabled());
     }
 
@@ -342,11 +383,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(null, serverConfig.getManagementKeyStorePassword());
 
         // Check value we set
         _config.setProperty("management.ssl.keyStorePassword", "a");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals("a", serverConfig.getManagementKeyStorePassword());
     }
 
@@ -354,11 +397,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(true, serverConfig.getQueueAutoRegister());
 
         // Check value we set
         _config.setProperty("queue.auto_register", false);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getQueueAutoRegister());
     }
 
@@ -366,11 +411,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(true, serverConfig.getManagementEnabled());
 
         // Check value we set
         _config.setProperty("management.enabled", false);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getManagementEnabled());
     }
 
@@ -378,6 +425,7 @@ public class ServerConfigurationTest ext
     {
         // Check value we set
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         serverConfig.setManagementEnabled(false);
         assertEquals(false, serverConfig.getManagementEnabled());
     }
@@ -386,11 +434,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(5, serverConfig.getHeartBeatDelay());
 
         // Check value we set
         _config.setProperty("heartbeat.delay", 23);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(23, serverConfig.getHeartBeatDelay());
     }
 
@@ -398,11 +448,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(2.0, serverConfig.getHeartBeatTimeout());
 
         // Check value we set
         _config.setProperty("heartbeat.timeoutFactor", 2.3);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(2.3, serverConfig.getHeartBeatTimeout());
     }
 
@@ -410,11 +462,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(0, serverConfig.getMaximumMessageAge());
 
         // Check value we set
         _config.setProperty("maximumMessageAge", 10L);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(10, serverConfig.getMaximumMessageAge());
     }
 
@@ -422,11 +476,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(0, serverConfig.getMaximumMessageCount());
 
         // Check value we set
         _config.setProperty("maximumMessageCount", 10L);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(10, serverConfig.getMaximumMessageCount());
     }
 
@@ -434,11 +490,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(0, serverConfig.getMaximumQueueDepth());
 
         // Check value we set
         _config.setProperty("maximumQueueDepth", 10L);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(10, serverConfig.getMaximumQueueDepth());
     }
 
@@ -446,11 +504,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(0, serverConfig.getMaximumMessageSize());
 
         // Check value we set
         _config.setProperty("maximumMessageSize", 10L);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(10, serverConfig.getMaximumMessageSize());
     }
 
@@ -458,11 +518,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(0, serverConfig.getMinimumAlertRepeatGap());
 
         // Check value we set
         _config.setProperty("minimumAlertRepeatGap", 10L);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(10, serverConfig.getMinimumAlertRepeatGap());
     }
 
@@ -470,11 +532,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(4, serverConfig.getProcessors());
 
         // Check value we set
         _config.setProperty("connector.processors", 10);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(10, serverConfig.getProcessors());
     }
 
@@ -482,6 +546,7 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertNotNull(serverConfig.getPorts());
         assertEquals(1, serverConfig.getPorts().size());
         assertEquals(5672, serverConfig.getPorts().get(0));
@@ -490,6 +555,7 @@ public class ServerConfigurationTest ext
         // Check value we set
         _config.setProperty("connector.port", "10");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertNotNull(serverConfig.getPorts());
         assertEquals(1, serverConfig.getPorts().size());
         assertEquals("10", serverConfig.getPorts().get(0));
@@ -499,11 +565,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals("wildcard", serverConfig.getBind());
 
         // Check value we set
         _config.setProperty("connector.bind", "a");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals("a", serverConfig.getBind());
     }
 
@@ -511,11 +579,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(32767, serverConfig.getReceiveBufferSize());
 
         // Check value we set
         _config.setProperty("connector.socketReceiveBuffer", "23");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(23, serverConfig.getReceiveBufferSize());
     }
 
@@ -523,11 +593,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(32767, serverConfig.getWriteBufferSize());
 
         // Check value we set
         _config.setProperty("connector.socketWriteBuffer", "23");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(23, serverConfig.getWriteBufferSize());
     }
 
@@ -535,11 +607,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(true, serverConfig.getTcpNoDelay());
 
         // Check value we set
         _config.setProperty("connector.tcpNoDelay", false);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getTcpNoDelay());
     }
 
@@ -547,11 +621,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getEnableExecutorPool());
 
         // Check value we set
         _config.setProperty("advanced.filterchain[@enableExecutorPool]", true);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(true, serverConfig.getEnableExecutorPool());
     }
 
@@ -559,11 +635,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getEnablePooledAllocator());
 
         // Check value we set
         _config.setProperty("advanced.enablePooledAllocator", true);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(true, serverConfig.getEnablePooledAllocator());
     }
 
@@ -571,11 +649,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getEnableDirectBuffers());
 
         // Check value we set
         _config.setProperty("advanced.enableDirectBuffers", true);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(true, serverConfig.getEnableDirectBuffers());
     }
 
@@ -583,11 +663,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getEnableSSL());
 
         // Check value we set
         _config.setProperty("connector.ssl.enabled", true);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(true, serverConfig.getEnableSSL());
     }
 
@@ -595,11 +677,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getSSLOnly());
 
         // Check value we set
         _config.setProperty("connector.ssl.sslOnly", true);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(true, serverConfig.getSSLOnly());
     }
 
@@ -607,11 +691,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(8672, serverConfig.getSSLPort());
 
         // Check value we set
         _config.setProperty("connector.ssl.port", 23);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(23, serverConfig.getSSLPort());
     }
 
@@ -619,11 +705,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals("none", serverConfig.getKeystorePath());
 
         // Check value we set
         _config.setProperty("connector.ssl.keystorePath", "a");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals("a", serverConfig.getKeystorePath());
     }
 
@@ -631,11 +719,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals("none", serverConfig.getKeystorePassword());
 
         // Check value we set
         _config.setProperty("connector.ssl.keystorePassword", "a");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals("a", serverConfig.getKeystorePassword());
     }
 
@@ -643,11 +733,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals("SunX509", serverConfig.getCertType());
 
         // Check value we set
         _config.setProperty("connector.ssl.certType", "a");
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals("a", serverConfig.getCertType());
     }
 
@@ -655,11 +747,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getQpidNIO());
 
         // Check value we set
         _config.setProperty("connector.qpidnio", true);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(true, serverConfig.getQpidNIO());
     }
 
@@ -667,11 +761,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(false, serverConfig.getUseBiasedWrites());
 
         // Check value we set
         _config.setProperty("advanced.useWriteBiasedPool", true);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(true, serverConfig.getUseBiasedWrites());
     }
 
@@ -679,11 +775,13 @@ public class ServerConfigurationTest ext
     {
         // Check default
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(30000, serverConfig.getHousekeepingCheckPeriod());
 
         // Check value we set
         _config.setProperty("housekeeping.expiredMessageCheckPeriod", 23L);
         serverConfig = new ServerConfiguration(_config);
+        serverConfig.configure();
         assertEquals(23, serverConfig.getHousekeepingCheckPeriod());
         serverConfig.setHousekeepingExpiredMessageCheckPeriod(42L);
         assertEquals(42, serverConfig.getHousekeepingCheckPeriod());
@@ -697,6 +795,7 @@ public class ServerConfigurationTest ext
         out.write("<broker><connector><port>2342</port><ssl><port>4235</port></ssl></connector></broker>");
         out.close();
         ServerConfiguration conf = new ServerConfiguration(fileA);
+        conf.configure();
         assertEquals(4235, conf.getSSLPort());
     }
 
@@ -726,6 +825,7 @@ public class ServerConfigurationTest ext
         out.close();
 
         ServerConfiguration config = new ServerConfiguration(mainFile.getAbsoluteFile());
+        config.configure();
         assertEquals(4235, config.getSSLPort()); // From first file, not
                                                  // overriden by second
         assertNotNull(config.getPorts());
@@ -750,6 +850,7 @@ public class ServerConfigurationTest ext
         out.close();
 
         ServerConfiguration config = new ServerConfiguration(mainFile.getAbsoluteFile());
+        config.configure();
         assertEquals("Did not get correct interpolated value",
                 "foo", config.getManagementKeyStorePath());
     }
@@ -1348,9 +1449,10 @@ public class ServerConfigurationTest ext
         
         // Load config
         try
-        {
+        {       
             @SuppressWarnings("unused")
             ApplicationRegistry reg = new ConfigurationFileApplicationRegistry(mainFile);
+            ApplicationRegistry.initialise(reg, 1);
             fail("Different virtualhost XML configurations not allowed");
         }
         catch (ConfigurationException ce)
@@ -1385,6 +1487,7 @@ public class ServerConfigurationTest ext
         {
             @SuppressWarnings("unused")
             ApplicationRegistry reg = new ConfigurationFileApplicationRegistry(mainFile);
+            ApplicationRegistry.initialise(reg, 1);
             fail("Multiple virtualhost XML configurations not allowed");
         }
         catch (ConfigurationException ce)
@@ -1426,6 +1529,7 @@ public class ServerConfigurationTest ext
         {
             @SuppressWarnings("unused")
             ServerConfiguration config = new ServerConfiguration(mainFile.getAbsoluteFile());
+            config.configure();
             fail("Different virtualhost XML configurations not allowed");
         }
         catch (ConfigurationException ce)
@@ -1455,6 +1559,7 @@ public class ServerConfigurationTest ext
 
         // Load config
         ServerConfiguration config = new ServerConfiguration(mainFile.getAbsoluteFile());
+        config.configure();
         
         // Test config
         VirtualHostConfiguration virtualHost = config.getVirtualHostConfig("a");
@@ -1492,6 +1597,7 @@ public class ServerConfigurationTest ext
 
         // Load config
         ServerConfiguration config = new ServerConfiguration(mainFile.getAbsoluteFile());
+        config.configure();
         
         // Test config
         VirtualHostConfiguration virtualHost = config.getVirtualHostConfig("one");
@@ -1545,6 +1651,7 @@ public class ServerConfigurationTest ext
 
         // Load config
         ServerConfiguration config = new ServerConfiguration(mainFile.getAbsoluteFile());
+        config.configure();
         
         // Test config
         VirtualHostConfiguration testHost = config.getVirtualHostConfig("test");
@@ -1626,6 +1733,7 @@ public class ServerConfigurationTest ext
 
         // Load config
         ServerConfiguration config = new ServerConfiguration(mainFile.getAbsoluteFile());
+        config.configure();
         
         // Test config
         VirtualHostConfiguration testHost = config.getVirtualHostConfig("test");
@@ -1663,6 +1771,7 @@ public class ServerConfigurationTest ext
 
         // Load config
         ServerConfiguration config = new ServerConfiguration(mainFile.getAbsoluteFile());
+        config.configure();
         
         // Test config
         VirtualHostConfiguration oneHost = config.getVirtualHostConfig("test-one");

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java?rev=942105&r1=942104&r2=942105&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java
(original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java
Fri May  7 15:10:55 2010
@@ -420,6 +420,7 @@ public class AMQQueueMBeanTest extends T
         super.setUp();
 
         PropertiesConfiguration configuration = new PropertiesConfiguration();
+        configuration.setProperty("virtualhosts.virtualhost.name","test");
         configuration.setProperty("virtualhosts.virtualhost.test.store.class", TestableMemoryMessageStore.class.getName());
         IApplicationRegistry  applicationRegistry  = new TestApplicationRegistry(new ServerConfiguration(configuration));
         ApplicationRegistry.initialise(applicationRegistry );

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java?rev=942105&r1=942104&r2=942105&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
Fri May  7 15:10:55 2010
@@ -111,8 +111,10 @@ public class AlertingTest extends Abstra
             message.append("Server configuration overrides in use:\n");
             message.append(FileUtils.readFileAsString(getTestConfigFile()));
 
-            message.append("\nVirtualhost maxMessageCount:\n");                        
-            message.append(new ServerConfiguration(_configFile).getVirtualHostConfig(VIRTUALHOST).getMaximumMessageCount());
+            message.append("\nVirtualhost maxMessageCount:\n");
+            ServerConfiguration config = new ServerConfiguration(_configFile);
+            config.configure();;
+            message.append(config.getVirtualHostConfig(VIRTUALHOST).getMaximumMessageCount());
 
             fail(message.toString());
         }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/DerbyMessageStoreLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/DerbyMessageStoreLoggingTest.java?rev=942105&r1=942104&r2=942105&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/DerbyMessageStoreLoggingTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/DerbyMessageStoreLoggingTest.java
Fri May  7 15:10:55 2010
@@ -59,6 +59,7 @@ public class DerbyMessageStoreLoggingTes
 
         // Load the default configuration file to get the list of defined vhosts
         ServerConfiguration configuration = new ServerConfiguration(new File(_configFile.getParent()
+ "/config.xml"));
+        configuration.configure();
         List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
         // Make them all persistent i.e. Use DerbyMessageStore and
@@ -99,6 +100,7 @@ public class DerbyMessageStoreLoggingTes
 
         // Load VirtualHost list from file.
         ServerConfiguration configuration = new ServerConfiguration(_configFile);
+        configuration.configure();
         List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
         //Validate each vhost logs a creation
@@ -162,6 +164,7 @@ public class DerbyMessageStoreLoggingTes
 
         // Load VirtualHost list from file.
         ServerConfiguration configuration = new ServerConfiguration(_configFile);
+        configuration.configure();
         List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
         //Validate each vhost logs a creation
@@ -229,6 +232,7 @@ public class DerbyMessageStoreLoggingTes
 
         // Load VirtualHost list from file.
         ServerConfiguration configuration = new ServerConfiguration(_configFile);
+        configuration.configure();
         List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
         //Validate each vhost logs a creation
@@ -295,6 +299,7 @@ public class DerbyMessageStoreLoggingTes
 
         // Load VirtualHost list from file.
         ServerConfiguration configuration = new ServerConfiguration(_configFile);
+        configuration.configure();
         List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
         //Validate each vhost logs a creation
@@ -360,6 +365,7 @@ public class DerbyMessageStoreLoggingTes
 
         // Load VirtualHost list from file.
         ServerConfiguration configuration = new ServerConfiguration(_configFile);
+        configuration.configure();
         List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
         //Validate each vhost logs a creation
@@ -502,6 +508,7 @@ public class DerbyMessageStoreLoggingTes
 
             // Load VirtualHost list from file.
             ServerConfiguration configuration = new ServerConfiguration(_configFile);
+            configuration.configure();
             List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
             //Validate each vhost logs a creation

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/MemoryMessageStoreLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/MemoryMessageStoreLoggingTest.java?rev=942105&r1=942104&r2=942105&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/MemoryMessageStoreLoggingTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/MemoryMessageStoreLoggingTest.java
Fri May  7 15:10:55 2010
@@ -90,6 +90,7 @@ public class MemoryMessageStoreLoggingTe
 
         // Load VirtualHost list from file.
         ServerConfiguration configuration = new ServerConfiguration(_configFile);
+        configuration.configure();
         List<String> vhosts = Arrays.asList(configuration.getVirtualHosts());
 
         //Validate each vhost logs a creation
@@ -154,6 +155,7 @@ public class MemoryMessageStoreLoggingTe
 
         // Load VirtualHost list from file.
         ServerConfiguration configuration = new ServerConfiguration(_configFile);
+        configuration.configure();
         List<String> vhosts = Arrays.asList(configuration.getVirtualHosts());
 
         //Validate each vhost logs a creation

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java?rev=942105&r1=942104&r2=942105&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java
Fri May  7 15:10:55 2010
@@ -70,6 +70,7 @@ public class VirtualHostLoggingTest exte
         {
             // Load VirtualHost list from file. 
             ServerConfiguration configuration = new ServerConfiguration(_configFile);
+            configuration.configure();
             List<String> vhosts = Arrays.asList(configuration.getVirtualHosts());
 
             assertEquals("Each vhost did not create a store.", vhosts.size(), results.size());
@@ -123,6 +124,7 @@ public class VirtualHostLoggingTest exte
         {
             // Load VirtualHost list from file. 
             ServerConfiguration configuration = new ServerConfiguration(_configFile);
+            configuration.configure();
             List<String> vhosts = Arrays.asList(configuration.getVirtualHosts());
 
             assertEquals("Each vhost did not close their store.", vhosts.size(), results.size());



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message