qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1583597 [7/8] - in /qpid/trunk: ./ qpid/ qpid/cpp/src/ qpid/cpp/src/tests/ qpid/java/ qpid/java/bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/ qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleyd...
Date Tue, 01 Apr 2014 10:35:37 GMT
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BindingRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BindingRestTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BindingRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BindingRestTest.java Tue Apr  1 10:35:33 2014
@@ -30,12 +30,18 @@ import org.apache.qpid.server.model.Bind
 public class BindingRestTest extends QpidRestTestCase
 {
 
+    @Override
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        getRestTestHelper().createTestQueues();
+    }
+
     public void testGetAllBindings() throws Exception
     {
-        List<Map<String, Object>> bindings = getRestTestHelper().getJsonAsList("/rest/binding");
+        List<Map<String, Object>> bindings = getRestTestHelper().getJsonAsList("/rest/binding/test");
         assertNotNull("Bindings cannot be null", bindings);
-        assertTrue("Unexpected number of bindings: " + bindings.size(),
-                bindings.size() >= EXPECTED_VIRTUALHOSTS.length * EXPECTED_QUEUES.length);
+        assertEquals("Unexpected number of bindings", RestTestHelper.EXPECTED_QUEUES.length, bindings.size());
         for (Map<String, Object> binding : bindings)
         {
             Asserts.assertBinding((String) binding.get(Binding.NAME), (String) binding.get(Binding.EXCHANGE), binding);
@@ -46,8 +52,8 @@ public class BindingRestTest extends Qpi
     {
         List<Map<String, Object>> bindings = getRestTestHelper().getJsonAsList("/rest/binding/test");
         assertNotNull("Bindings cannot be null", bindings);
-        assertEquals("Unexpected number of bindings", EXPECTED_QUEUES.length, bindings.size());
-        for (String queueName : EXPECTED_QUEUES)
+        assertEquals("Unexpected number of bindings", RestTestHelper.EXPECTED_QUEUES.length, bindings.size());
+        for (String queueName : RestTestHelper.EXPECTED_QUEUES)
         {
             Map<String, Object> searchAttributes = new HashMap<String, Object>();
             searchAttributes.put(Binding.NAME, queueName);
@@ -62,8 +68,8 @@ public class BindingRestTest extends Qpi
     {
         List<Map<String, Object>> bindings = getRestTestHelper().getJsonAsList("/rest/binding/test/amq.direct");
         assertNotNull("Bindings cannot be null", bindings);
-        assertEquals("Unexpected number of bindings", EXPECTED_QUEUES.length, bindings.size());
-        for (String queueName : EXPECTED_QUEUES)
+        assertEquals("Unexpected number of bindings", RestTestHelper.EXPECTED_QUEUES.length, bindings.size());
+        for (String queueName : RestTestHelper.EXPECTED_QUEUES)
         {
             Map<String, Object> binding = getRestTestHelper().find(Binding.NAME, queueName, bindings);
             Asserts.assertBinding(queueName, "amq.direct", binding);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsClientCertAuthTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsClientCertAuthTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsClientCertAuthTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsClientCertAuthTest.java Tue Apr  1 10:35:33 2014
@@ -20,25 +20,22 @@
  */
 package org.apache.qpid.systest.rest;
 
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
-import org.apache.qpid.server.model.Port;
-import org.apache.qpid.server.model.Protocol;
-import org.apache.qpid.server.model.Transport;
-import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManagerFactory;
-import org.apache.qpid.server.security.auth.manager.ExternalAuthenticationManagerFactory;
-import org.apache.qpid.test.utils.TestBrokerConfiguration;
+import static org.apache.qpid.test.utils.TestSSLConstants.KEYSTORE;
+import static org.apache.qpid.test.utils.TestSSLConstants.KEYSTORE_PASSWORD;
+import static org.apache.qpid.test.utils.TestSSLConstants.TRUSTSTORE;
+import static org.apache.qpid.test.utils.TestSSLConstants.TRUSTSTORE_PASSWORD;
 
 import java.io.IOException;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
-import static org.apache.qpid.test.utils.TestSSLConstants.KEYSTORE;
-import static org.apache.qpid.test.utils.TestSSLConstants.KEYSTORE_PASSWORD;
-import static org.apache.qpid.test.utils.TestSSLConstants.TRUSTSTORE;
-import static org.apache.qpid.test.utils.TestSSLConstants.TRUSTSTORE_PASSWORD;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.Protocol;
+import org.apache.qpid.server.model.Transport;
+import org.apache.qpid.server.security.auth.manager.ExternalAuthenticationManagerFactory;
+import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
 public class BrokerRestHttpsClientCertAuthTest extends QpidRestTestCase
 {
@@ -56,7 +53,7 @@ public class BrokerRestHttpsClientCertAu
     }
 
     @Override
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         super.customizeConfiguration();
         getRestTestHelper().setUseSslAuth(true);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java Tue Apr  1 10:35:33 2014
@@ -28,7 +28,6 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.model.Port;
@@ -49,7 +48,7 @@ public class BrokerRestHttpsTest extends
     }
 
     @Override
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         super.customizeConfiguration();
         getRestTestHelper().setUseSsl(true);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java Tue Apr  1 10:35:33 2014
@@ -41,7 +41,7 @@ import org.apache.qpid.server.model.Port
 import org.apache.qpid.server.model.State;
 import org.apache.qpid.server.model.VirtualHost;
 import org.apache.qpid.server.model.adapter.AbstractConfiguredObject;
-import org.apache.qpid.server.store.MessageStoreCreator;
+import org.apache.qpid.server.plugin.MessageStoreFactory;
 import org.apache.qpid.test.client.UnroutableMessageTestExceptionListener;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
 import org.apache.qpid.util.SystemUtils;
@@ -271,7 +271,7 @@ public class BrokerRestTest extends Qpid
 
         @SuppressWarnings("unchecked")
         Collection<String> supportedVirtualHostStoreTypes = (Collection<String>)brokerDetails.get(Broker.SUPPORTED_VIRTUALHOST_STORE_TYPES);
-        Collection<String> expectedSupportedVirtualHostStoreTypes = new MessageStoreCreator().getStoreTypes();
+        Collection<String> expectedSupportedVirtualHostStoreTypes = MessageStoreFactory.FACTORY_LOADER.getSupportedTypes();
         assertEquals("Unexpected supported virtual host store types",  new HashSet<String>(expectedSupportedVirtualHostStoreTypes), new HashSet<String>(supportedVirtualHostStoreTypes));
     }
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ExchangeRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ExchangeRestTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ExchangeRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ExchangeRestTest.java Tue Apr  1 10:35:33 2014
@@ -30,6 +30,13 @@ import org.apache.qpid.server.model.Exch
 
 public class ExchangeRestTest extends QpidRestTestCase
 {
+    @Override
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        getRestTestHelper().createTestQueues();
+    }
+
     public void testGet() throws Exception
     {
         List<Map<String, Object>> exchanges = getRestTestHelper().getJsonAsList("/rest/exchange");
@@ -98,7 +105,7 @@ public class ExchangeRestTest extends Qp
     {
         @SuppressWarnings("unchecked")
         List<Map<String, Object>> bindings = (List<Map<String, Object>>) exchange.get("bindings");
-        for (String queueName : EXPECTED_QUEUES)
+        for (String queueName : RestTestHelper.EXPECTED_QUEUES)
         {
             Map<String, Object> binding = getRestTestHelper().find(Binding.NAME, queueName, bindings);
             Asserts.assertBinding(queueName, (String) exchange.get(Exchange.NAME), binding);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java Tue Apr  1 10:35:33 2014
@@ -27,7 +27,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.model.AuthenticationProvider;
 import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.model.LifetimePolicy;
@@ -71,7 +70,7 @@ public class PreferencesProviderRestTest
     }
 
     @Override
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         super.customizeConfiguration();
         Map<String, Object> anonymousAuthProviderAttributes = new HashMap<String, Object>();

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesRestTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesRestTest.java Tue Apr  1 10:35:33 2014
@@ -25,7 +25,6 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.model.PreferencesProvider;
 import org.apache.qpid.server.model.adapter.FileSystemPreferencesProvider;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
@@ -58,7 +57,7 @@ public class PreferencesRestTest extends
     }
 
     @Override
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         super.customizeConfiguration();
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QpidRestTestCase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QpidRestTestCase.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QpidRestTestCase.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QpidRestTestCase.java Tue Apr  1 10:35:33 2014
@@ -24,7 +24,6 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.management.plugin.HttpManagement;
 import org.apache.qpid.server.model.AuthenticationProvider;
 import org.apache.qpid.server.model.Port;
@@ -42,7 +41,6 @@ public class QpidRestTestCase extends Qp
     public static final String TEST3_VIRTUALHOST = "test3";
 
     public static final String[] EXPECTED_VIRTUALHOSTS = { TEST1_VIRTUALHOST, TEST2_VIRTUALHOST, TEST3_VIRTUALHOST};
-    public static final String[] EXPECTED_QUEUES = { "queue", "ping" };
     public static final String[] EXPECTED_EXCHANGES = { "amq.fanout", "amq.match", "amq.direct","amq.topic" };
 
     private RestTestHelper _restTestHelper = new RestTestHelper(findFreePort());
@@ -60,12 +58,6 @@ public class QpidRestTestCase extends Qp
         for (String virtualhost : EXPECTED_VIRTUALHOSTS)
         {
             createTestVirtualHost(0, virtualhost);
-
-            for (String queue : EXPECTED_QUEUES)
-            {
-                setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + virtualhost + ".queues.exchange", "amq.direct");
-                setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + virtualhost + ".queues.queue(-1).name", queue);
-            }
         }
 
         customizeConfiguration();
@@ -85,7 +77,7 @@ public class QpidRestTestCase extends Qp
         }
     }
 
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         TestBrokerConfiguration config = getBrokerConfiguration();
         config.addHttpManagementConfiguration();

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java Tue Apr  1 10:35:33 2014
@@ -83,10 +83,8 @@ public class QueueRestTest extends QpidR
     {
         String queueName = getTestQueueName();
         List<Map<String, Object>> queues = getRestTestHelper().getJsonAsList("/rest/queue/test");
-        assertEquals("Unexpected number of queues", EXPECTED_QUEUES.length + 1, queues.size());
-        String[] expectedQueues = new String[EXPECTED_QUEUES.length + 1];
-        System.arraycopy(EXPECTED_QUEUES, 0, expectedQueues, 0, EXPECTED_QUEUES.length);
-        expectedQueues[EXPECTED_QUEUES.length] = queueName;
+        assertEquals("Unexpected number of queues", 1, queues.size());
+        String[] expectedQueues = new String[]{queueName};
 
         for (String name : expectedQueues)
         {

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java Tue Apr  1 10:35:33 2014
@@ -52,9 +52,10 @@ import javax.servlet.http.HttpServletRes
 import junit.framework.Assert;
 
 import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.log4j.Logger;
 import org.apache.qpid.server.BrokerOptions;
+import org.apache.qpid.server.model.Binding;
+import org.apache.qpid.server.model.Queue;
 import org.apache.qpid.ssl.SSLContextFactory;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
@@ -80,6 +81,7 @@ public class RestTestHelper
 
     private File _passwdFile;
     private boolean _useSslAuth;
+    static final String[] EXPECTED_QUEUES = { "queue", "ping" };
 
     public RestTestHelper(int httpPort)
     {
@@ -226,6 +228,11 @@ public class RestTestHelper
 
     public Map<String, Object> find(String name, Object value, List<Map<String, Object>> data)
     {
+        if (data == null)
+        {
+            return null;
+        }
+
         for (Map<String, Object> map : data)
         {
             Object mapValue = map.get(name);
@@ -437,7 +444,7 @@ public class RestTestHelper
     /**
      * Create password file that follows the convention username=password, which is deleted by {@link #tearDown()}
      */
-    public void configureTemporaryPasswordFile(QpidBrokerTestCase testCase, String... users) throws ConfigurationException, IOException
+    public void configureTemporaryPasswordFile(QpidBrokerTestCase testCase, String... users) throws IOException
     {
         _passwdFile = createTemporaryPasswdFile(users);
 
@@ -509,4 +516,22 @@ public class RestTestHelper
         _useSslAuth = useSslAuth;
         _useSsl = true;
     }
+
+    public void createTestQueues() throws IOException, JsonGenerationException, JsonMappingException
+    {
+        for (int i = 0; i < EXPECTED_QUEUES.length; i++)
+        {
+            String queueName = EXPECTED_QUEUES[i];
+            Map<String, Object> queueData = new HashMap<String, Object>();
+            queueData.put(Queue.NAME, queueName);
+            queueData.put(Queue.DURABLE, Boolean.FALSE);
+            submitRequest("/rest/queue/test/" + queueName, "PUT", queueData);
+
+            Map<String, Object> bindingData = new HashMap<String, Object>();
+            bindingData.put(Binding.NAME, queueName);
+            bindingData.put(Binding.QUEUE, queueName);
+            bindingData.put(Binding.EXCHANGE, "amq.direct");
+            submitRequest("/rest/binding/test/amq.direct/" + queueName + "/" + queueName, "PUT", queueData);
+        }
+    }
 }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/SaslRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/SaslRestTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/SaslRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/SaslRestTest.java Tue Apr  1 10:35:33 2014
@@ -35,7 +35,6 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.model.AuthenticationProvider;
 import org.apache.qpid.server.security.auth.manager.Base64MD5PasswordFileAuthenticationManagerFactory;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
@@ -347,7 +346,7 @@ public class SaslRestTest extends QpidRe
         }
     }
 
-    private void configureBase64MD5FilePrincipalDatabase() throws IOException, ConfigurationException
+    private void configureBase64MD5FilePrincipalDatabase() throws IOException
     {
         // generate user password entry
         String passwordFileEntry;
@@ -357,7 +356,7 @@ public class SaslRestTest extends QpidRe
         }
         catch (NoSuchAlgorithmException e)
         {
-            throw new ConfigurationException(e);
+            throw new RuntimeException(e);
         }
 
         // store the entry in the file

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/StructureRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/StructureRestTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/StructureRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/StructureRestTest.java Tue Apr  1 10:35:33 2014
@@ -30,6 +30,13 @@ import org.apache.qpid.test.utils.TestBr
 public class StructureRestTest extends QpidRestTestCase
 {
 
+    @Override
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        getRestTestHelper().createTestQueues();
+    }
+
     public void testGet() throws Exception
     {
         Map<String, Object> structure = getRestTestHelper().getJsonAsMap("/rest/structure");
@@ -53,50 +60,52 @@ public class StructureRestTest extends Q
             Map<String, Object> host = getRestTestHelper().find("name", hostName, virtualhosts);
             assertNotNull("Host " + hostName + " is not found ", host);
             assertNode(host, hostName);
+        }
+
+        String hostName = "test";
+        Map<String, Object> host = getRestTestHelper().find("name", hostName, virtualhosts);
+
+        @SuppressWarnings("unchecked")
+        List<Map<String, Object>> queues = (List<Map<String, Object>>) host.get("queues");
+        assertNotNull("Host " + hostName + " queues are not found ", queues);
+        for (String queueName : RestTestHelper.EXPECTED_QUEUES)
+        {
+            Map<String, Object> queue = getRestTestHelper().find("name", queueName, queues);
+            assertNotNull(hostName + " queue " + queueName + " is not found ", queue);
+            assertNode(queue, queueName);
 
             @SuppressWarnings("unchecked")
-            List<Map<String, Object>> queues = (List<Map<String, Object>>) host.get("queues");
-            assertNotNull("Host " + hostName + " queues are not found ", queues);
-            for (String queueName : EXPECTED_QUEUES)
+            List<Map<String, Object>> bindings = (List<Map<String, Object>>) queue.get("bindings");
+            assertNotNull(hostName + " queue " + queueName + " bindings are not found ", queues);
+            for (Map<String, Object> binding : bindings)
             {
-                Map<String, Object> queue = getRestTestHelper().find("name", queueName, queues);
-                assertNotNull(hostName + " queue " + queueName + " is not found ", queue);
-                assertNode(queue, queueName);
-
-                @SuppressWarnings("unchecked")
-                List<Map<String, Object>> bindings = (List<Map<String, Object>>) queue.get("bindings");
-                assertNotNull(hostName + " queue " + queueName + " bindings are not found ", queues);
-                for (Map<String, Object> binding : bindings)
-                {
-                    assertNode(binding, queueName);
-                }
+                assertNode(binding, queueName);
             }
+        }
 
-            @SuppressWarnings("unchecked")
-            List<Map<String, Object>> exchanges = (List<Map<String, Object>>) host.get("exchanges");
-            assertNotNull("Host " + hostName + " exchanges are not found ", exchanges);
-            for (String exchangeName : EXPECTED_EXCHANGES)
+        @SuppressWarnings("unchecked")
+        List<Map<String, Object>> exchanges = (List<Map<String, Object>>) host.get("exchanges");
+        assertNotNull("Host " + hostName + " exchanges are not found ", exchanges);
+        for (String exchangeName : EXPECTED_EXCHANGES)
+        {
+            Map<String, Object> exchange = getRestTestHelper().find("name", exchangeName, exchanges);
+            assertNotNull("Exchange " + exchangeName + " is not found ", exchange);
+            assertNode(exchange, exchangeName);
+            if (ExchangeDefaults.DIRECT_EXCHANGE_NAME.equalsIgnoreCase(exchangeName) ||
+                ExchangeDefaults.DEFAULT_EXCHANGE_NAME.equalsIgnoreCase(exchangeName))
             {
-                Map<String, Object> exchange = getRestTestHelper().find("name", exchangeName, exchanges);
-                assertNotNull("Exchange " + exchangeName + " is not found ", exchange);
-                assertNode(exchange, exchangeName);
-                if (ExchangeDefaults.DIRECT_EXCHANGE_NAME.equalsIgnoreCase(exchangeName) ||
-                    ExchangeDefaults.DEFAULT_EXCHANGE_NAME.equalsIgnoreCase(exchangeName))
+                @SuppressWarnings("unchecked")
+                List<Map<String, Object>> bindings = (List<Map<String, Object>>) exchange.get("bindings");
+                assertNotNull(hostName + " exchange " + exchangeName + " bindings are not found ", bindings);
+                for (String queueName : RestTestHelper.EXPECTED_QUEUES)
                 {
-                    @SuppressWarnings("unchecked")
-                    List<Map<String, Object>> bindings = (List<Map<String, Object>>) exchange.get("bindings");
-                    assertNotNull(hostName + " exchange " + exchangeName + " bindings are not found ", bindings);
-                    for (String queueName : EXPECTED_QUEUES)
-                    {
-                        Map<String, Object> binding = getRestTestHelper().find("name", queueName, bindings);
-                        assertNotNull(hostName + " exchange " + exchangeName + " binding  " + queueName + " is not found", binding);
-                        assertNode(binding, queueName);
-                    }
+                    Map<String, Object> binding = getRestTestHelper().find("name", queueName, bindings);
+                    assertNotNull(hostName + " exchange " + exchangeName + " binding  " + queueName + " is not found", binding);
+                    assertNode(binding, queueName);
                 }
             }
         }
 
-
         String httpPortName = TestBrokerConfiguration.ENTRY_NAME_HTTP_PORT;
         Map<String, Object> portData = getRestTestHelper().find(Port.NAME, httpPortName, ports);
         assertNotNull("Http Port " + httpPortName + " is not found", portData);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/UserPreferencesRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/UserPreferencesRestTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/UserPreferencesRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/UserPreferencesRestTest.java Tue Apr  1 10:35:33 2014
@@ -28,7 +28,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.model.PreferencesProvider;
 import org.apache.qpid.server.model.User;
 import org.apache.qpid.server.model.adapter.FileSystemPreferencesProvider;
@@ -63,7 +62,7 @@ public class UserPreferencesRestTest ext
     }
 
     @Override
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         super.customizeConfiguration();
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java Tue Apr  1 10:35:33 2014
@@ -30,15 +30,13 @@ import java.util.Map;
 import javax.jms.Session;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.XMLConfiguration;
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.server.model.Exchange;
 import org.apache.qpid.server.model.Queue;
 import org.apache.qpid.server.model.VirtualHost;
 import org.apache.qpid.server.queue.ConflationQueue;
+import org.apache.qpid.server.store.MessageStore;
 import org.apache.qpid.server.virtualhost.StandardVirtualHostFactory;
-import org.apache.qpid.test.utils.TestFileUtils;
 import org.apache.qpid.util.FileUtils;
 import org.codehaus.jackson.JsonGenerationException;
 import org.codehaus.jackson.map.JsonMappingException;
@@ -67,16 +65,18 @@ public class VirtualHostRestTest extends
     {
         // create AMQP connection to get connection JSON details
         _connection = (AMQConnection) getConnection();
-        _connection.createSession(true, Session.SESSION_TRANSACTED);
+        Session session = _connection.createSession(true, Session.SESSION_TRANSACTED);
+        session.createConsumer(getTestQueue());
 
         Map<String, Object> hostDetails = getRestTestHelper().getJsonAsSingletonList("/rest/virtualhost/test");
         Asserts.assertVirtualHost("test", hostDetails);
 
         @SuppressWarnings("unchecked")
         Map<String, Object> statistics = (Map<String, Object>) hostDetails.get(Asserts.STATISTICS_ATTRIBUTE);
+
         assertEquals("Unexpected number of exchanges in statistics", EXPECTED_EXCHANGES.length, statistics.get(
                 "exchangeCount"));
-        assertEquals("Unexpected number of queues in statistics", EXPECTED_QUEUES.length, statistics.get("queueCount"));
+        assertEquals("Unexpected number of queues in statistics", 1, statistics.get("queueCount"));
         assertEquals("Unexpected number of connections in statistics", 1, statistics.get("connectionCount"));
 
         @SuppressWarnings("unchecked")
@@ -89,13 +89,10 @@ public class VirtualHostRestTest extends
 
         @SuppressWarnings("unchecked")
         List<Map<String, Object>> queues = (List<Map<String, Object>>) hostDetails.get(VIRTUALHOST_QUEUES_ATTRIBUTE);
-        assertEquals("Unexpected number of queues", EXPECTED_QUEUES.length, queues.size());
-        Map<String, Object> queue = getRestTestHelper().find(Queue.NAME,  "queue", queues);
-        Map<String, Object> ping = getRestTestHelper().find(Queue.NAME, "ping", queues);
-        Asserts.assertQueue("queue", "standard", queue);
-        Asserts.assertQueue("ping", "standard", ping);
-        assertEquals("Unexpected value of queue attribute " + Queue.DURABLE, Boolean.FALSE, queue.get(Queue.DURABLE));
-        assertEquals("Unexpected value of queue attribute " + Queue.DURABLE, Boolean.FALSE, ping.get(Queue.DURABLE));
+        assertEquals("Unexpected number of queues", 1, queues.size());
+        Map<String, Object> queue = getRestTestHelper().find(Queue.NAME,  getTestQueueName(), queues);
+        Asserts.assertQueue(getTestQueueName(), "standard", queue);
+        assertEquals("Unexpected value of queue attribute " + Queue.DURABLE, Boolean.TRUE, queue.get(Queue.DURABLE));
 
         @SuppressWarnings("unchecked")
         List<Map<String, Object>> connections = (List<Map<String, Object>>) hostDetails
@@ -115,34 +112,10 @@ public class VirtualHostRestTest extends
             restartBroker();
             Map<String, Object> hostDetails = getRestTestHelper().getJsonAsSingletonList("/rest/virtualhost/" + hostName);
             Asserts.assertVirtualHost(hostName, hostDetails);
-            assertEquals("Unexpected store type", storeType, hostDetails.get(VirtualHost.STORE_TYPE));
 
-            assertNewVirtualHost(hostDetails);
-        }
-        finally
-        {
-            if (storeLocation != null)
-            {
-                FileUtils.delete(new File(storeLocation), true);
-            }
-        }
-    }
-
-    public void testPutCreateVirtualHostUsingConfigPath() throws Exception
-    {
-        String hostName = getName();
-        File configFile = TestFileUtils.createTempFile(this, hostName + "-config.xml");
-        String configPath = configFile.getAbsolutePath();
-        String storeLocation = getStoreLocation(hostName);
-        createAndSaveVirtualHostConfiguration(hostName, configFile, storeLocation);
-        createHost(hostName, null, configPath);
-        try
-        {
-            // make sure that the host is saved in the broker store
-            restartBroker();
-            Map<String, Object> hostDetails = getRestTestHelper().getJsonAsSingletonList("/rest/virtualhost/" + hostName);
-            Asserts.assertVirtualHost(hostName, hostDetails);
-            assertEquals("Unexpected config path", configPath, hostDetails.get(VirtualHost.CONFIG_PATH));
+            @SuppressWarnings("unchecked")
+            Map<String, Object> messageStoreSettings = (Map<String, Object>) hostDetails.get(VirtualHost.MESSAGE_STORE_SETTINGS);
+            assertEquals("Unexpected store type", storeType, messageStoreSettings.get(MessageStore.STORE_TYPE));
 
             assertNewVirtualHost(hostDetails);
         }
@@ -152,7 +125,6 @@ public class VirtualHostRestTest extends
             {
                 FileUtils.delete(new File(storeLocation), true);
             }
-            configFile.delete();
         }
     }
 
@@ -187,24 +159,30 @@ public class VirtualHostRestTest extends
         String hostToUpdate = TEST3_VIRTUALHOST;
         Map<String, Object> hostDetails = getRestTestHelper().getJsonAsSingletonList("/rest/virtualhost/" + hostToUpdate);
         Asserts.assertVirtualHost(hostToUpdate, hostDetails);
-        String configPath = (String)hostDetails.get(VirtualHost.CONFIG_PATH);
-        assertNotNull("Unexpected host configuration", configPath);
+        @SuppressWarnings("unchecked")
+        Map<String, Object> attributes = (Map<String, Object>)hostDetails.get(VirtualHost.MESSAGE_STORE_SETTINGS);
+        String configPath = (String) attributes.get(MessageStore.STORE_PATH);
 
         String storeType = getTestProfileMessageStoreType();
         String storeLocation = getStoreLocation(hostToUpdate);
+        Map<String, Object> newMessageStoreSettings = new HashMap<String, Object>();
+        newMessageStoreSettings.put(MessageStore.STORE_TYPE, storeType);
+        newMessageStoreSettings.put(MessageStore.STORE_PATH, storeLocation);
+
         Map<String, Object> newAttributes = new HashMap<String, Object>();
         newAttributes.put(VirtualHost.NAME, hostToUpdate);
-        newAttributes.put(VirtualHost.STORE_TYPE, storeType);
-        newAttributes.put(VirtualHost.STORE_PATH, storeLocation);
+        newAttributes.put(VirtualHost.MESSAGE_STORE_SETTINGS, newMessageStoreSettings);
 
         int response = getRestTestHelper().submitRequest("/rest/virtualhost/" + hostToUpdate, "PUT", newAttributes);
         assertEquals("Unexpected response code", 409, response);
 
         restartBroker();
 
-        hostDetails = getRestTestHelper().getJsonAsSingletonList("/rest/virtualhost/" + hostToUpdate);
-        Asserts.assertVirtualHost(hostToUpdate, hostDetails);
-        assertEquals("Unexpected config path", configPath, hostDetails.get(VirtualHost.CONFIG_PATH));
+        Map<String, Object> rereadHostDetails = getRestTestHelper().getJsonAsSingletonList("/rest/virtualhost/" + hostToUpdate);
+        Asserts.assertVirtualHost(hostToUpdate, rereadHostDetails);
+        @SuppressWarnings("unchecked")
+        Map<String, Object> rereadMessageStoreSettings = (Map<String,Object>)rereadHostDetails.get(VirtualHost.MESSAGE_STORE_SETTINGS);
+        assertEquals("Unexpected config path", configPath, rereadMessageStoreSettings.get(MessageStore.STORE_PATH));
     }
 
     public void testPutCreateQueue() throws Exception
@@ -557,34 +535,19 @@ public class VirtualHostRestTest extends
     private int tryCreateVirtualHost(String hostName, String storeType, String storePath, String configPath) throws IOException,
             JsonGenerationException, JsonMappingException
     {
+        Map<String, Object> messageStoreSettings = new HashMap<String, Object>();
+        messageStoreSettings.put(MessageStore.STORE_PATH, storePath);
+        messageStoreSettings.put(MessageStore.STORE_TYPE, storeType);
+
 
         Map<String, Object> hostData = new HashMap<String, Object>();
         hostData.put(VirtualHost.NAME, hostName);
-        if (storeType == null)
-        {
-            hostData.put(VirtualHost.CONFIG_PATH, configPath);
-        }
-        else
-        {
-            hostData.put(VirtualHost.TYPE, StandardVirtualHostFactory.TYPE);
-            hostData.put(VirtualHost.STORE_PATH, storePath);
-            hostData.put(VirtualHost.STORE_TYPE, storeType);
-        }
+        hostData.put(VirtualHost.TYPE, StandardVirtualHostFactory.TYPE);
+        hostData.put(VirtualHost.MESSAGE_STORE_SETTINGS, messageStoreSettings);
 
         return getRestTestHelper().submitRequest("/rest/virtualhost/" + hostName, "PUT", hostData);
     }
 
-    private XMLConfiguration createAndSaveVirtualHostConfiguration(String hostName, File configFile, String storeLocation)
-            throws ConfigurationException
-    {
-        XMLConfiguration testConfiguration = new XMLConfiguration();
-        testConfiguration.setProperty("virtualhost." + hostName + ".store.class",
-                getTestProfileMessageStoreClassName());
-        testConfiguration.setProperty("virtualhost." + hostName + ".store.environment-path", storeLocation);
-        testConfiguration.save(configFile);
-        return testConfiguration;
-    }
-
     private void assertNewVirtualHost(Map<String, Object> hostDetails)
     {
         @SuppressWarnings("unchecked")

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java Tue Apr  1 10:35:33 2014
@@ -27,7 +27,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.management.plugin.HttpManagement;
 import org.apache.qpid.server.model.AccessControlProvider;
 import org.apache.qpid.server.model.AuthenticationProvider;
@@ -43,6 +42,7 @@ import org.apache.qpid.server.security.a
 import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManagerFactory;
 import org.apache.qpid.server.security.auth.manager.PlainPasswordFileAuthenticationManagerFactory;
 import org.apache.qpid.server.security.group.FileGroupManagerFactory;
+import org.apache.qpid.server.store.MessageStore;
 import org.apache.qpid.server.virtualhost.StandardVirtualHostFactory;
 import org.apache.qpid.systest.rest.QpidRestTestCase;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
@@ -58,7 +58,7 @@ public class BrokerACLTest extends QpidR
     private String _secondaryAclFileContent = "";
 
     @Override
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         super.customizeConfiguration();
         getRestTestHelper().configureTemporaryPasswordFile(this, ALLOWED_USER, DENIED_USER);
@@ -976,10 +976,13 @@ public class BrokerACLTest extends QpidR
 
     private int createHost(String hostName) throws Exception
     {
+        Map<String, Object> messageStoreSettings = new HashMap<String, Object>();
+        messageStoreSettings.put(MessageStore.STORE_PATH, getStoreLocation(hostName));
+        messageStoreSettings.put(MessageStore.STORE_TYPE, getTestProfileMessageStoreType());
+
         Map<String, Object> hostData = new HashMap<String, Object>();
         hostData.put(VirtualHost.NAME, hostName);
-        hostData.put(VirtualHost.STORE_PATH, getStoreLocation(hostName));
-        hostData.put(VirtualHost.STORE_TYPE, getTestProfileMessageStoreType());
+        hostData.put(VirtualHost.MESSAGE_STORE_SETTINGS, messageStoreSettings);
         hostData.put(VirtualHost.TYPE, StandardVirtualHostFactory.TYPE);
 
         return getRestTestHelper().submitRequest("/rest/virtualhost/" + hostName, "PUT", hostData);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/ExchangeRestACLTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/ExchangeRestACLTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/ExchangeRestACLTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/ExchangeRestACLTest.java Tue Apr  1 10:35:33 2014
@@ -25,10 +25,10 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.management.plugin.HttpManagement;
 import org.apache.qpid.server.model.Binding;
 import org.apache.qpid.server.model.Exchange;
+import org.apache.qpid.server.model.Queue;
 import org.apache.qpid.server.security.acl.AbstractACLTestCase;
 import org.apache.qpid.systest.rest.QpidRestTestCase;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
@@ -39,14 +39,16 @@ public class ExchangeRestACLTest extends
 {
     private static final String ALLOWED_USER = "user1";
     private static final String DENIED_USER = "user2";
+    private String _queueName;
 
     @Override
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         super.customizeConfiguration();
         getRestTestHelper().configureTemporaryPasswordFile(this, ALLOWED_USER, DENIED_USER);
 
         AbstractACLTestCase.writeACLFileUtil(this, "ACL ALLOW-LOG ALL ACCESS MANAGEMENT",
+                "ACL ALLOW-LOG " + ALLOWED_USER + " CREATE QUEUE",
                 "ACL ALLOW-LOG " + ALLOWED_USER + " CREATE EXCHANGE",
                 "ACL DENY-LOG " + DENIED_USER + " CREATE EXCHANGE",
                 "ACL ALLOW-LOG " + ALLOWED_USER + " UPDATE EXCHANGE",
@@ -63,6 +65,20 @@ public class ExchangeRestACLTest extends
                 HttpManagement.HTTP_BASIC_AUTHENTICATION_ENABLED, true);
     }
 
+    @Override
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        _queueName = getTestQueueName();
+        getRestTestHelper().setUsernameAndPassword(ALLOWED_USER, ALLOWED_USER);
+        Map<String, Object> queueData = new HashMap<String, Object>();
+        queueData.put(Queue.NAME, _queueName);
+        queueData.put(Queue.DURABLE, Boolean.TRUE);
+        int status = getRestTestHelper().submitRequest("/rest/queue/test/" + _queueName, "PUT", queueData);
+        assertEquals("Unexpected status", 201, status);
+
+    }
+
     public void testCreateExchangeAllowed() throws Exception
     {
         getRestTestHelper().setUsernameAndPassword(ALLOWED_USER, ALLOWED_USER);
@@ -209,10 +225,10 @@ public class ExchangeRestACLTest extends
     {
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(Binding.NAME, bindingName);
-        attributes.put(Binding.QUEUE, "queue");
+        attributes.put(Binding.QUEUE, _queueName);
         attributes.put(Binding.EXCHANGE, "amq.direct");
 
-        int responseCode = getRestTestHelper().submitRequest("/rest/binding/test/amq.direct/queue/" + bindingName, "PUT", attributes);
+        int responseCode = getRestTestHelper().submitRequest("/rest/binding/test/amq.direct/" + _queueName + "/" + bindingName, "PUT", attributes);
         return responseCode;
     }
 
@@ -228,7 +244,7 @@ public class ExchangeRestACLTest extends
 
     private void assertBindingExistence(String bindingName, boolean exists) throws Exception
     {
-        List<Map<String, Object>> bindings = getRestTestHelper().getJsonAsList("/rest/binding/test/amq.direct/queue/" + bindingName);
+        List<Map<String, Object>> bindings = getRestTestHelper().getJsonAsList("/rest/binding/test/amq.direct/" + _queueName + "/" + bindingName);
         assertEquals("Unexpected result", exists, !bindings.isEmpty());
     }
 }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/GroupRestACLTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/GroupRestACLTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/GroupRestACLTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/GroupRestACLTest.java Tue Apr  1 10:35:33 2014
@@ -28,7 +28,6 @@ import java.util.Properties;
 
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.management.plugin.HttpManagement;
 import org.apache.qpid.server.security.acl.AbstractACLTestCase;
 import org.apache.qpid.systest.rest.QpidRestTestCase;
@@ -58,7 +57,7 @@ public class GroupRestACLTest extends Qp
     }
 
     @Override
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         super.customizeConfiguration();
         getBrokerConfiguration().setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_HTTP_MANAGEMENT, HttpManagement.HTTP_BASIC_AUTHENTICATION_ENABLED, true);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/LogViewerACLTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/LogViewerACLTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/LogViewerACLTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/LogViewerACLTest.java Tue Apr  1 10:35:33 2014
@@ -22,7 +22,6 @@ package org.apache.qpid.systest.rest.acl
 
 import java.io.IOException;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.management.plugin.HttpManagement;
 import org.apache.qpid.server.security.acl.AbstractACLTestCase;
 import org.apache.qpid.systest.rest.QpidRestTestCase;
@@ -34,7 +33,7 @@ public class LogViewerACLTest extends Qp
     private static final String DENIED_USER = "user2";
 
     @Override
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         super.customizeConfiguration();
         getRestTestHelper().configureTemporaryPasswordFile(this, ALLOWED_USER, DENIED_USER);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/QueueRestACLTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/QueueRestACLTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/QueueRestACLTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/QueueRestACLTest.java Tue Apr  1 10:35:33 2014
@@ -25,7 +25,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.management.plugin.HttpManagement;
 import org.apache.qpid.server.model.Queue;
 import org.apache.qpid.server.security.acl.AbstractACLTestCase;
@@ -38,7 +37,7 @@ public class QueueRestACLTest extends Qp
     private static final String DENIED_USER = "user2";
 
     @Override
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         super.customizeConfiguration();
         getRestTestHelper().configureTemporaryPasswordFile(this, ALLOWED_USER, DENIED_USER);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserPreferencesRestACLTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserPreferencesRestACLTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserPreferencesRestACLTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserPreferencesRestACLTest.java Tue Apr  1 10:35:33 2014
@@ -28,7 +28,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.management.plugin.HttpManagement;
 import org.apache.qpid.server.model.PreferencesProvider;
 import org.apache.qpid.server.model.adapter.FileSystemPreferencesProvider;
@@ -72,7 +71,7 @@ public class UserPreferencesRestACLTest 
     }
 
     @Override
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         super.customizeConfiguration();
         getRestTestHelper().configureTemporaryPasswordFile(this, ALLOWED_USER, DENIED_USER);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserRestACLTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserRestACLTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserRestACLTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserRestACLTest.java Tue Apr  1 10:35:33 2014
@@ -28,7 +28,6 @@ import java.util.Properties;
 
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.management.plugin.HttpManagement;
 import org.apache.qpid.server.security.acl.AbstractACLTestCase;
 import org.apache.qpid.systest.rest.QpidRestTestCase;
@@ -60,7 +59,7 @@ public class UserRestACLTest extends Qpi
     }
 
     @Override
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         super.customizeConfiguration();
         getBrokerConfiguration().setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_HTTP_MANAGEMENT, HttpManagement.HTTP_BASIC_AUTHENTICATION_ENABLED, true);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java Tue Apr  1 10:35:33 2014
@@ -22,7 +22,6 @@ package org.apache.qpid.test.client.dest
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import org.apache.qpid.client.AMQAnyDestination;
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQDestination;
@@ -31,13 +30,15 @@ import org.apache.qpid.client.AMQSession
 import org.apache.qpid.client.message.QpidMessageProperties;
 import org.apache.qpid.jndi.PropertiesFileInitialContextFactory;
 import org.apache.qpid.messaging.Address;
+import org.apache.qpid.server.model.VirtualHost;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import org.apache.qpid.test.utils.TestBrokerConfiguration;
 import org.apache.qpid.transport.ExecutionErrorCode;
 
 import javax.jms.*;
 import javax.naming.Context;
 import javax.naming.InitialContext;
-import java.util.Collections;
+
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Hashtable;
@@ -53,6 +54,9 @@ public class AddressBasedDestinationTest
     @Override
     public void setUp() throws Exception
     {
+        TestBrokerConfiguration config = getBrokerConfiguration();
+        config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, VirtualHost.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, 0);
+
         super.setUp();
         _connection = getConnection() ;
         _connection.start();

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java Tue Apr  1 10:35:33 2014
@@ -20,11 +20,8 @@
  */
 package org.apache.qpid.test.client.timeouts;
 
-import org.apache.qpid.server.virtualhost.StandardVirtualHostFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import java.util.HashMap;
+import java.util.Map;
 
 import javax.jms.Connection;
 import javax.jms.JMSException;
@@ -34,6 +31,14 @@ import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
 
+import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.server.store.MessageStore;
+import org.apache.qpid.server.store.SlowMessageStore;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import org.apache.qpid.test.utils.TestBrokerConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * This tests that when the commit takes a long time(due to POST_COMMIT_DELAY) that the commit does not timeout
  * This test must be run in conjunction with SyncWaiteTimeoutDelay or be run with POST_COMMIT_DELAY > 30s to ensure
@@ -43,7 +48,6 @@ public class SyncWaitDelayTest extends Q
 {
     protected static final Logger _logger = LoggerFactory.getLogger(SyncWaitDelayTest.class);
 
-    private String VIRTUALHOST = "test";
     protected long POST_COMMIT_DELAY = 1000L;
     protected long SYNC_WRITE_TIMEOUT = POST_COMMIT_DELAY + 1000;
 
@@ -54,11 +58,15 @@ public class SyncWaitDelayTest extends Q
 
     public void setUp() throws Exception
     {
+        Map<String, Object> slowMessageStoreDelays = new HashMap<String,Object>();
+        slowMessageStoreDelays.put("postcommitTran", POST_COMMIT_DELAY);
+
+        Map<String, Object> messageStoreSettings = new HashMap<String, Object>();
+        messageStoreSettings.put(MessageStore.STORE_TYPE, SlowMessageStore.TYPE);
+        messageStoreSettings.put(SlowMessageStore.DELAYS, slowMessageStoreDelays);
 
-        final String prefix = "virtualhosts.virtualhost." + VIRTUALHOST;
-        setVirtualHostConfigurationProperty(prefix + ".type", StandardVirtualHostFactory.TYPE);
-        setVirtualHostConfigurationProperty(prefix + ".store.class", org.apache.qpid.server.store.SlowMessageStore.class.getName());
-        setVirtualHostConfigurationProperty(prefix + ".store.delays.commitTran.post", String.valueOf(POST_COMMIT_DELAY));
+        TestBrokerConfiguration config = getBrokerConfiguration();
+        config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, VirtualHost.MESSAGE_STORE_SETTINGS, messageStoreSettings);
 
         super.setUp();
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/MaxDeliveryCountTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/MaxDeliveryCountTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/MaxDeliveryCountTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/MaxDeliveryCountTest.java Tue Apr  1 10:35:33 2014
@@ -21,15 +21,16 @@
 package org.apache.qpid.test.unit.client;
 
 import org.apache.log4j.Logger;
-
 import org.apache.qpid.AMQException;
 import org.apache.qpid.client.AMQDestination;
 import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQSession;
 import org.apache.qpid.client.RejectBehaviour;
 import org.apache.qpid.configuration.ClientProperties;
+import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.queue.AMQQueueFactory;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
 import javax.jms.Connection;
 import javax.jms.Destination;
@@ -41,6 +42,7 @@ import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -75,13 +77,13 @@ public class MaxDeliveryCountTest extend
     public void setUp() throws Exception
     {
         //enable DLQ/maximumDeliveryCount support for all queues at the vhost level
-        setVirtualHostConfigurationProperty("virtualhosts.virtualhost.test.queues.maximumDeliveryCount",
-                String.valueOf(MAX_DELIVERY_COUNT));
-        setVirtualHostConfigurationProperty("virtualhosts.virtualhost.test.queues.deadLetterQueues",
-                                String.valueOf(true));
+
+        TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
+        brokerConfiguration.setBrokerAttribute(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED, true);
+        brokerConfiguration.setBrokerAttribute(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, MAX_DELIVERY_COUNT);
 
         //Ensure management is on
-        getBrokerConfiguration().addJmxManagementConfiguration();
+        brokerConfiguration.addJmxManagementConfiguration();
 
         // Set client-side flag to allow the server to determine if messages
         // dead-lettered or requeued.

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutDisabledTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutDisabledTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutDisabledTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutDisabledTest.java Tue Apr  1 10:35:33 2014
@@ -20,6 +20,9 @@
  */
 package org.apache.qpid.test.unit.transacted;
 
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.test.utils.TestBrokerConfiguration;
+
 /**
  * This verifies that the default behaviour is not to time out transactions.
  */
@@ -29,7 +32,8 @@ public class TransactionTimeoutDisabledT
     protected void configure() throws Exception
     {
         // Setup housekeeping every second
-        setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".housekeeping.checkPeriod", "100");
+        TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
+        brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, 100);
 
         // No transaction timeout configuration.
     }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTest.java Tue Apr  1 10:35:33 2014
@@ -27,6 +27,7 @@ import javax.jms.MessageProducer;
 import javax.jms.Queue;
 
 import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
 /**
  * This tests the behaviour of transactional sessions when the {@code transactionTimeout} configuration
@@ -45,28 +46,29 @@ public class TransactionTimeoutTest exte
         getBrokerConfiguration().setBrokerAttribute(Broker.CONNECTION_CLOSE_WHEN_NO_ROUTE, false);
 
         // Setup housekeeping every 100ms
-        setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".housekeeping.checkPeriod", "100");
+        TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
+        brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, 100);
 
         if (getName().contains("ProducerIdle"))
         {
-            setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".transactionTimeout.openWarn", "0");
-            setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".transactionTimeout.openClose", "0");
-            setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".transactionTimeout.idleWarn", "500");
-            setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".transactionTimeout.idleClose", "1500");
+            brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, 0);
+            brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, 0);
+            brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, 500);
+            brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, 1500);
         }
         else if (getName().contains("ProducerOpen"))
         {
-            setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".transactionTimeout.openWarn", "1000");
-            setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".transactionTimeout.openClose", "2000");
-            setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".transactionTimeout.idleWarn", "0");
-            setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".transactionTimeout.idleClose", "0");
+            brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, 1000);
+            brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, 2000);
+            brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, 0);
+            brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, 0);
         }
         else
         {
-            setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".transactionTimeout.openWarn", "1000");
-            setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".transactionTimeout.openClose", "2000");
-            setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".transactionTimeout.idleWarn", "500");
-            setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".transactionTimeout.idleClose", "1000");
+            brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, 1000);
+            brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, 2000);
+            brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, 500);
+            brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, 1500);
         }
     }
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java Tue Apr  1 10:35:33 2014
@@ -22,7 +22,6 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -48,8 +47,6 @@ import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.XMLConfiguration;
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.apache.qpid.AMQException;
@@ -66,10 +63,10 @@ import org.apache.qpid.server.BrokerOpti
 import org.apache.qpid.server.configuration.BrokerProperties;
 import org.apache.qpid.server.model.Port;
 import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.plugin.MessageStoreFactory;
 import org.apache.qpid.server.protocol.AmqpProtocolVersion;
-import org.apache.qpid.server.store.MessageStoreConstants;
-import org.apache.qpid.server.store.MessageStoreCreator;
+import org.apache.qpid.server.store.MemoryMessageStore;
+import org.apache.qpid.server.store.MessageStore;
+import org.apache.qpid.server.virtualhost.StandardVirtualHostFactory;
 import org.apache.qpid.url.URLSyntaxException;
 import org.apache.qpid.util.FileUtils;
 import org.apache.qpid.util.SystemUtils;
@@ -101,15 +98,12 @@ public class QpidBrokerTestCase extends 
     private Map<String, String> _propertiesSetForBroker = new HashMap<String, String>();
 
     private Map<Integer, TestBrokerConfiguration> _brokerConfigurations;
-    private XMLConfiguration _testVirtualhosts = new XMLConfiguration();
 
     protected static final String INDEX = "index";
     protected static final String CONTENT = "content";
 
     private static final String DEFAULT_INITIAL_CONTEXT = "org.apache.qpid.jndi.PropertiesFileInitialContextFactory";
 
-    private static Map<String, String> supportedStoresClassToTypeMapping = new HashMap<String, String>();
-
     static
     {
         String initialContext = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
@@ -118,17 +112,9 @@ public class QpidBrokerTestCase extends 
         {
             System.setProperty(Context.INITIAL_CONTEXT_FACTORY, DEFAULT_INITIAL_CONTEXT);
         }
-
-        MessageStoreCreator messageStoreCreator = new MessageStoreCreator();
-        Collection<MessageStoreFactory> factories = messageStoreCreator.getFactories();
-        for (MessageStoreFactory messageStoreFactory : factories)
-        {
-            supportedStoresClassToTypeMapping.put(messageStoreFactory.createMessageStore().getClass().getName(), messageStoreFactory.getType());
-        }
     }
 
     // system properties
-    private static final String TEST_VIRTUALHOSTS = "test.virtualhosts";
     private static final String BROKER_LANGUAGE = "broker.language";
     protected static final String BROKER_TYPE = "broker.type";
     private static final String BROKER_COMMAND = "broker.command";
@@ -249,7 +235,16 @@ public class QpidBrokerTestCase extends 
             configuration.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_AMQP_PORT, Port.PORT, actualPort);
             configuration.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_RMI_PORT, Port.PORT, getManagementPort(actualPort));
             configuration.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_JMX_PORT, Port.PORT, getManagementPort(actualPort) + JMXPORT_CONNECTORSERVER_OFFSET);
+
+            String workDir = System.getProperty("QPID_WORK") + File.separator + TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST + File.separator + actualPort;
+            Map<String, Object> virtualHostSettings = configuration.getObjectAttributes(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST);
+
+            @SuppressWarnings("unchecked")
+            Map<String, Object> storeSettings = (Map<String, Object>)virtualHostSettings.get(VirtualHost.MESSAGE_STORE_SETTINGS);
+            storeSettings.put(MessageStore.STORE_PATH, workDir);
+            configuration.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, VirtualHost.MESSAGE_STORE_SETTINGS, storeSettings);
         }
+
         return configuration;
     }
 
@@ -420,7 +415,7 @@ public class QpidBrokerTestCase extends 
     {
         int actualPort = getPort(port);
         TestBrokerConfiguration configuration = getBrokerConfiguration(actualPort);
-        startBroker(actualPort, configuration, _testVirtualhosts, managementMode);
+        startBroker(actualPort, configuration, managementMode);
     }
 
     protected File getBrokerCommandLog4JFile()
@@ -434,16 +429,14 @@ public class QpidBrokerTestCase extends 
         _logger.info("Modified log config file to: " + file);
     }
 
-    public void startBroker(int port, TestBrokerConfiguration testConfiguration, XMLConfiguration virtualHosts) throws Exception
+    public void startBroker(int port, TestBrokerConfiguration testConfiguration) throws Exception
     {
-        startBroker(port, testConfiguration, virtualHosts, false);
+        startBroker(port, testConfiguration, false);
     }
 
-    public void startBroker(int port, TestBrokerConfiguration testConfiguration, XMLConfiguration virtualHosts, boolean managementMode) throws Exception
+    public void startBroker(int port, TestBrokerConfiguration testConfiguration, boolean managementMode) throws Exception
     {
         port = getPort(port);
-        String testConfig = saveTestConfiguration(port, testConfiguration);
-        String virtualHostsConfig = saveTestVirtualhosts(port, virtualHosts);
 
         if(_brokers.get(port) != null)
         {
@@ -451,11 +444,10 @@ public class QpidBrokerTestCase extends 
         }
 
         Set<Integer> portsUsedByBroker = guessAllPortsUsedByBroker(port);
+        String testConfig = saveTestConfiguration(port, testConfiguration);
 
         if (_brokerType.equals(BrokerType.INTERNAL) && !existingInternalBroker())
         {
-            _logger.info("Set test.virtualhosts property to: " + virtualHostsConfig);
-            setSystemProperty(TEST_VIRTUALHOSTS, virtualHostsConfig);
             setSystemProperty(BrokerProperties.PROPERTY_USE_CUSTOM_RMI_SOCKET_FACTORY, "false");
             BrokerOptions options = new BrokerOptions();
 
@@ -549,7 +541,6 @@ public class QpidBrokerTestCase extends 
                 setSystemProperty("root.logging.level");
                 setSystemProperty(BrokerProperties.PROPERTY_BROKER_DEFAULT_AMQP_PROTOCOL_EXCLUDES);
                 setSystemProperty(BrokerProperties.PROPERTY_BROKER_DEFAULT_AMQP_PROTOCOL_INCLUDES);
-                setSystemProperty(TEST_VIRTUALHOSTS, virtualHostsConfig);
 
                 // Add all the specified system properties to QPID_OPTS
                 if (!_propertiesSetForBroker.isEmpty())
@@ -651,25 +642,6 @@ public class QpidBrokerTestCase extends 
         return _output + File.separator + getTestQueueName() + "-" + port + "-config";
     }
 
-    public String getTestVirtualhostsFile(int port)
-    {
-        return _output + File.separator + getTestQueueName() + "-" + port + "-virtualhosts.xml";
-    }
-
-    private String relativeToQpidHome(String file)
-    {
-        _logger.debug("Converting path to be relative to QPID_HOME: " + file);
-
-        final String qpidHome = System.getProperty(QPID_HOME,"QPID_HOME");
-        _logger.debug("QPID_HOME is: " + qpidHome);
-
-        if(!file.startsWith(qpidHome)) {
-            throw new RuntimeException("Provided path is not a child of the QPID_HOME directory: " + qpidHome);
-        }
-
-        return file.replace(qpidHome + File.separator,"");
-    }
-
     protected String getPathRelativeToWorkingDirectory(String file)
     {
         File configLocation = new File(file);
@@ -715,23 +687,6 @@ public class QpidBrokerTestCase extends 
         return relative;
     }
 
-    protected String saveTestVirtualhosts(int port, XMLConfiguration virtualHostConfiguration) throws ConfigurationException
-    {
-        // Specify the test virtualhosts file
-        String testVirtualhosts = getTestVirtualhostsFile(port);
-        String relative = relativeToQpidHome(testVirtualhosts);
-
-        _logger.info("Path to virtualhosts configuration: " + testVirtualhosts);
-
-        // Create the file if configuration does not exist
-        if (virtualHostConfiguration.isEmpty())
-        {
-            virtualHostConfiguration.addProperty("__ignore", "true");
-        }
-        virtualHostConfiguration.save(testVirtualhosts);
-        return relative;
-    }
-
     protected void cleanBrokerWork(final String qpidWork)
     {
         if (qpidWork != null)
@@ -872,68 +827,34 @@ public class QpidBrokerTestCase extends 
      * Creates a new virtual host within the test virtualhost file.
      * @param brokerPort broker port
      * @param virtualHostName virtual host name
-     *
-     * @throws ConfigurationException
      */
-    protected void createTestVirtualHost(int brokerPort, String virtualHostName) throws ConfigurationException
+    protected void createTestVirtualHost(int brokerPort, String virtualHostName)
     {
-        String storeClassName = getTestProfileMessageStoreClassName();
-
-        _testVirtualhosts.setProperty("virtualhost.name(-1)", virtualHostName);
-        _testVirtualhosts.setProperty("virtualhost." + virtualHostName + ".store.class", storeClassName);
-
+        String storeType = getTestProfileMessageStoreType();
         String storeDir = null;
 
         if (System.getProperty("profile", "").startsWith("java-dby-mem"))
         {
             storeDir = ":memory:";
         }
-        else if (!MEMORY_STORE_CLASS_NAME.equals(storeClassName))
-        {
-            storeDir = "${QPID_WORK}" + File.separator + virtualHostName + "-store";
-        }
-
-        if (storeDir != null)
+        else if (!MemoryMessageStore.TYPE.equals(storeType))
         {
-            _testVirtualhosts.setProperty("virtualhost." + virtualHostName + ".store." + MessageStoreConstants.ENVIRONMENT_PATH_PROPERTY, storeDir);
+            storeDir = "${QPID_WORK}" + File.separator + virtualHostName + File.separator + brokerPort;
         }
 
         // add new virtual host configuration to the broker store
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(VirtualHost.NAME, virtualHostName);
-        attributes.put(VirtualHost.CONFIG_PATH,  System.getProperty("broker.virtualhosts-config"));
+        attributes.put(VirtualHost.TYPE, StandardVirtualHostFactory.TYPE);
+        Map<String, Object> messageStoreSettings = new HashMap<String, Object>();
+        messageStoreSettings.put(MessageStore.STORE_TYPE, storeType);
+        messageStoreSettings.put(MessageStore.STORE_PATH, storeDir);
+        attributes.put(VirtualHost.MESSAGE_STORE_SETTINGS, messageStoreSettings );
         int port = getPort(brokerPort);
         getBrokerConfiguration(port).addVirtualHostConfiguration(attributes);
     }
 
     /**
-     * Set a configuration Property for this test run.
-     *
-     * This creates a new configuration based on the current configuration
-     * with the specified property change.
-     *
-     * Multiple calls to this method will result in multiple temporary
-     * configuration files being created.
-     *
-     * @param property the configuration property to set
-     * @param value    the new value
-     *
-     * @throws ConfigurationException when loading the current config file
-     */
-    public void setVirtualHostConfigurationProperty(String property, String value) throws ConfigurationException
-    {
-        // Choose which file to write the property to based on prefix.
-        if (property.startsWith("virtualhosts"))
-        {
-            _testVirtualhosts.setProperty(StringUtils.substringAfter(property, "virtualhosts."), value);
-        }
-        else
-        {
-            throw new ConfigurationException("Cannot set broker configuration as property");
-        }
-    }
-
-    /**
      * Set a System property that is to be applied only to the external test
      * broker.
      *
@@ -1468,24 +1389,4 @@ public class QpidBrokerTestCase extends 
         return FAILING_PORT;
     }
 
-    public XMLConfiguration getTestVirtualhosts()
-    {
-        return _testVirtualhosts;
-    }
-
-    public void setTestVirtualhosts(XMLConfiguration testVirtualhosts)
-    {
-        _testVirtualhosts = testVirtualhosts;
-    }
-
-    public String getTestProfileMessageStoreType()
-    {
-        final String storeClass = getTestProfileMessageStoreClassName();
-       /* if (storeClass == null)
-        {
-            return "Memory";
-        }*/
-        return supportedStoresClassToTypeMapping.get(storeClass);
-    }
-
 }

Propchange: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
------------------------------------------------------------------------------
  Merged /qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java:r1576683-1583556

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java Tue Apr  1 10:35:33 2014
@@ -20,6 +20,7 @@
  */
 package org.apache.qpid.test.utils;
 
+import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.util.Collection;
 import java.util.Collections;
@@ -45,6 +46,7 @@ import org.apache.qpid.server.model.Virt
 import org.apache.qpid.server.plugin.PluginFactory;
 import org.apache.qpid.server.security.access.FileAccessControlProviderConstants;
 import org.apache.qpid.server.security.group.FileGroupManagerFactory;
+import org.apache.qpid.util.FileUtils;
 
 public class TestBrokerConfiguration
 {
@@ -308,4 +310,8 @@ public class TestBrokerConfiguration
         _store.save(newAp, pp);
     }
 
+    public Map<String, Object> getObjectAttributes(String name)
+    {
+        return findObjectByName(name).getAttributes();
+    }
 }

Modified: qpid/trunk/qpid/java/systests/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory (original)
+++ qpid/trunk/qpid/java/systests/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory Tue Apr  1 10:35:33 2014
@@ -17,3 +17,4 @@
 # under the License.
 #
 org.apache.qpid.server.store.SlowMessageStoreFactory
+org.apache.qpid.server.store.QuotaMessageStoreFactory

Modified: qpid/trunk/qpid/java/test-profiles/CPPExcludes
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/CPPExcludes?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/CPPExcludes (original)
+++ qpid/trunk/qpid/java/test-profiles/CPPExcludes Tue Apr  1 10:35:33 2014
@@ -82,6 +82,7 @@ org.apache.qpid.server.AlertingTest#*
 
 // The C++ server has a totally different persistence mechanism
 org.apache.qpid.server.store.PersistentStoreTest#*
+org.apache.qpid.server.store.SplitStoreTest#*
 
 // These tests are for the Java broker persistent store modules
 org.apache.qpid.server.store.MessageStoreTest#testMessagePersistence

Propchange: qpid/trunk/qpid/java/test-profiles/CPPExcludes
------------------------------------------------------------------------------
  Merged /qpid/branches/java-broker-bdb-ha2/qpid/java/test-profiles/CPPExcludes:r1576683-1583556

Modified: qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes (original)
+++ qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes Tue Apr  1 10:35:33 2014
@@ -20,6 +20,7 @@
 //These tests require a persistent store
 org.apache.qpid.server.persistent.NoLocalAfterRecoveryTest#*
 org.apache.qpid.server.store.PersistentStoreTest#*
+org.apache.qpid.server.store.SplitStoreTest#*
 org.apache.qpid.server.logging.AlertingTest#testAlertingReallyWorksWithRestart
 org.apache.qpid.server.logging.AlertingTest#testAlertingReallyWorksWithChanges
 org.apache.qpid.test.unit.ack.ClientAcknowledgeTest#testClientAckWithLargeFlusherPeriod

Propchange: qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes
------------------------------------------------------------------------------
  Merged /qpid/branches/java-broker-bdb-ha2/qpid/java/test-profiles/JavaTransientExcludes:r1576683-1583556

Modified: qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-10.testprofile
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-10.testprofile?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-10.testprofile (original)
+++ qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-10.testprofile Tue Apr  1 10:35:33 2014
@@ -24,8 +24,7 @@ broker.command.windows=build${file.separ
 broker.ready=BRK-1004
 broker.stopped=Exception
 qpid.broker_default_amqp_protocol_excludes=AMQP_1_0
-broker.virtualhosts-config=${QPID_HOME}/etc/virtualhosts-systests-bdb.xml
-messagestore.class.name=org.apache.qpid.server.store.berkeleydb.BDBMessageStore
+messagestore.type=BDB
 profile.excludes=JavaExcludes JavaPersistentExcludes Java010Excludes JavaBDBExcludes
 broker.clean.between.tests=true
 broker.persistent=true

Modified: qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-8.testprofile
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-8.testprofile?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-8.testprofile (original)
+++ qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-8.testprofile Tue Apr  1 10:35:33 2014
@@ -24,8 +24,7 @@ broker.command.windows=build${file.separ
 broker.ready=BRK-1004
 broker.stopped=Exception
 qpid.broker_default_amqp_protocol_excludes=AMQP_1_0,AMQP_0_10,AMQP_0_9_1,AMQP_0_9
-broker.virtualhosts-config=${QPID_HOME}/etc/virtualhosts-systests-bdb.xml
-messagestore.class.name=org.apache.qpid.server.store.berkeleydb.BDBMessageStore
+messagestore.type=BDB
 profile.excludes=JavaExcludes JavaPersistentExcludes XAExcludes JavaPre010Excludes JavaBDBExcludes
 broker.clean.between.tests=true
 broker.persistent=true
@@ -34,4 +33,3 @@ broker.version=v0_8
 # Do not enable. Allow client to attempt 0-10 and negotiate downwards
 #
 #qpid.amqp.version=0-8
-

Modified: qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-9-1.testprofile
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-9-1.testprofile?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-9-1.testprofile (original)
+++ qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-9-1.testprofile Tue Apr  1 10:35:33 2014
@@ -24,8 +24,7 @@ broker.command.windows=build${file.separ
 broker.ready=BRK-1004
 broker.stopped=Exception
 qpid.broker_default_amqp_protocol_excludes=AMQP_1_0,AMQP_0_10
-broker.virtualhosts-config=${QPID_HOME}/etc/virtualhosts-systests-bdb.xml
-messagestore.class.name=org.apache.qpid.server.store.berkeleydb.BDBMessageStore
+messagestore.type=BDB
 profile.excludes=JavaExcludes JavaPersistentExcludes XAExcludes JavaPre010Excludes JavaBDBExcludes
 broker.clean.between.tests=true
 broker.persistent=true
@@ -34,4 +33,3 @@ broker.version=v0_9_1
 # Do not enable. Allow client to attempt 0-10 and negotiate downwards
 #
 #qpid.amqp.version=0-91
-

Propchange: qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-9-1.testprofile
------------------------------------------------------------------------------
  Merged /qpid/branches/java-broker-bdb-ha2/qpid/java/test-profiles/java-bdb-spawn.0-9-1.testprofile:r1576683-1583556

Modified: qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-9.testprofile
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-9.testprofile?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-9.testprofile (original)
+++ qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-9.testprofile Tue Apr  1 10:35:33 2014
@@ -24,8 +24,7 @@ broker.command.windows=build${file.separ
 broker.ready=BRK-1004
 broker.stopped=Exception
 qpid.broker_default_amqp_protocol_excludes=AMQP_1_0,AMQP_0_10,AMQP_0_9_1
-broker.virtualhosts-config=${QPID_HOME}/etc/virtualhosts-systests-bdb.xml
-messagestore.class.name=org.apache.qpid.server.store.berkeleydb.BDBMessageStore
+messagestore.type=BDB
 profile.excludes=JavaExcludes JavaPersistentExcludes XAExcludes JavaPre010Excludes JavaBDBExcludes
 broker.clean.between.tests=true
 broker.persistent=true
@@ -34,4 +33,3 @@ broker.version=v0_9
 # Do not enable. Allow client to attempt 0-10 and negotiate downwards
 #
 #qpid.amqp.version=0-9
-



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


Mime
View raw message