QPID-8083 [System Tests] [REST/HTTP] Remove many superfluous tests

Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/81d81723
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/81d81723
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/81d81723

Branch: refs/heads/master
Commit: 81d81723b65895b234ad639ef922baaf8de150df
Parents: 5ea1c70
Author: Keith Wall <kw...@apache.org>
Authored: Thu Feb 8 18:58:06 2018 +0000
Committer: Keith Wall <kw...@apache.org>
Committed: Fri Feb 9 11:30:52 2018 +0000

----------------------------------------------------------------------
 .../apache/qpid/tests/http/HttpTestBase.java    |   5 +
 .../endtoend/state/VirtualHostRecoveryTest.java | 139 +++++
 .../http/endtoend/store/SpiltStoreTest.java     | 146 +++++
 .../qpid/tests/http/rest/model/CreateTest.java  |  27 +
 .../qpid/server/store/SplitStoreTest.java       | 112 ----
 .../qpid/systest/rest/VirtualHostRestTest.java  | 619 -------------------
 test-profiles/CPPExcludes                       |   3 -
 test-profiles/JavaJsonExcludes                  |   1 -
 test-profiles/JavaTransientExcludes             |   1 -
 9 files changed, 317 insertions(+), 736 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/81d81723/systests/qpid-systests-http-management/src/main/java/org/apache/qpid/tests/http/HttpTestBase.java
----------------------------------------------------------------------
diff --git 
a/systests/qpid-systests-http-management/src/main/java/org/apache/qpid/tests/http/HttpTestBase.java
 
b/systests/qpid-systests-http-management/src/main/java/org/apache/qpid/tests/http/HttpTestBase.java
index 7230400..4bc2526 100644
--- 
a/systests/qpid-systests-http-management/src/main/java/org/apache/qpid/tests/http/HttpTestBase.java
+++ 
b/systests/qpid-systests-http-management/src/main/java/org/apache/qpid/tests/http/HttpTestBase.java
@@ -83,6 +83,11 @@ public abstract class HttpTestBase extends 
BrokerAdminUsingTestBase
         return getClass().getSimpleName() + "_" + _testName.getMethodName();
     }
 
+    protected String getVirtualHostNode()
+    {
+        return getClass().getSimpleName() + "_" + _testName.getMethodName();
+    }
+
     public HttpTestHelper getHelper()
     {
         return _helper;

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/81d81723/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/state/VirtualHostRecoveryTest.java
----------------------------------------------------------------------
diff --git 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/state/VirtualHostRecoveryTest.java
 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/state/VirtualHostRecoveryTest.java
new file mode 100644
index 0000000..1443297
--- /dev/null
+++ 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/state/VirtualHostRecoveryTest.java
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.tests.http.endtoend.state;
+
+import static javax.servlet.http.HttpServletResponse.SC_OK;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assume.assumeThat;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import javax.jms.Connection;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.systests.Utils;
+import org.apache.qpid.tests.http.HttpRequestConfig;
+import org.apache.qpid.tests.http.HttpTestBase;
+
+public class VirtualHostRecoveryTest extends HttpTestBase
+{
+    private static final String TEST_QUEUE = "testQueue";
+
+    @Before
+    public void setUp() throws Exception
+    {
+        getBrokerAdmin().createQueue(TEST_QUEUE);
+        assumeThat(getBrokerAdmin().supportsRestart(), is(true));
+    }
+
+    @Test
+    @HttpRequestConfig(useVirtualHostAsHost = true)
+    public void virtualHostRestart() throws Exception
+    {
+        final TextMessage sentMessage = putMessageOnQueue();
+
+        final String url = "virtualhost";
+        changeState(url, "STOPPED");
+        assertState(url, "STOPPED");
+
+        changeState(url, "ACTIVE");
+        assertState(url, "ACTIVE");
+
+        verifyMessagesOnQueue(sentMessage);
+    }
+
+    @Test
+    @HttpRequestConfig(useVirtualHostAsHost = false)
+    public void virtualHostNodeRestart() throws Exception
+    {
+        final TextMessage sentMessage = putMessageOnQueue();
+
+        final String url = String.format("virtualhostnode/%s", 
getVirtualHostNode());
+        changeState(url, "STOPPED");
+        assertState(url, "STOPPED");
+
+        changeState(url, "ACTIVE");
+        assertState(url, "ACTIVE");
+
+        verifyMessagesOnQueue(sentMessage);
+    }
+
+    private TextMessage putMessageOnQueue() throws Exception
+    {
+        Connection connection = getConnection();
+        try
+        {
+            Session session = connection.createSession(true, 
Session.SESSION_TRANSACTED);
+            List<Message> _expectedMessages = Utils.sendMessages(session, 
session.createQueue(TEST_QUEUE), 1);
+            return (TextMessage) _expectedMessages.get(0);
+        }
+        finally
+        {
+            connection.close();
+        }
+    }
+
+    private void verifyMessagesOnQueue(final TextMessage expectedMessage) 
throws Exception
+    {
+        Connection connection = getConnection();
+        try
+        {
+            connection.start();
+            Session session = connection.createSession(true, 
Session.SESSION_TRANSACTED);
+            MessageConsumer consumer = 
session.createConsumer(session.createQueue(TEST_QUEUE));
+
+            final TextMessage receivedMessage = (TextMessage) 
consumer.receive(getReceiveTimeout());
+            assertThat(receivedMessage, is(notNullValue()));
+            assertThat(receivedMessage.getJMSMessageID(), 
is(equalTo(expectedMessage.getJMSMessageID())));
+            assertThat(receivedMessage.getText(), 
is(equalTo(expectedMessage.getText())));
+        }
+        finally
+        {
+            connection.close();
+        }
+    }
+
+    private void changeState(final String url, final String desiredState) 
throws Exception
+    {
+        Map<String, Object> attributes = 
Collections.singletonMap(ConfiguredObject.DESIRED_STATE, desiredState);
+        getHelper().submitRequest(url, "POST", attributes, SC_OK);
+    }
+
+    private void assertState(final String url, final String 
expectedActualState) throws Exception
+    {
+        Map<String, Object> object = getHelper().getJson(url, new 
TypeReference<Map<String, Object>>() {}, SC_OK);
+        final String actualState = (String) object.get(ConfiguredObject.STATE);
+        assertThat(actualState, is(equalTo(expectedActualState)));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/81d81723/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/store/SpiltStoreTest.java
----------------------------------------------------------------------
diff --git 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/store/SpiltStoreTest.java
 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/store/SpiltStoreTest.java
new file mode 100644
index 0000000..9b3a353
--- /dev/null
+++ 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/endtoend/store/SpiltStoreTest.java
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.tests.http.endtoend.store;
+
+import static javax.servlet.http.HttpServletResponse.SC_CREATED;
+import static javax.servlet.http.HttpServletResponse.SC_OK;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assume.assumeThat;
+
+import java.io.File;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.jms.Connection;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.server.virtualhost.ProvidedStoreVirtualHost;
+import org.apache.qpid.server.virtualhost.ProvidedStoreVirtualHostImpl;
+import org.apache.qpid.systests.Utils;
+import org.apache.qpid.tests.http.HttpRequestConfig;
+import org.apache.qpid.tests.http.HttpTestBase;
+
+@HttpRequestConfig(useVirtualHostAsHost = false)
+public class SpiltStoreTest extends HttpTestBase
+{
+    private static final String TEST_QUEUE = "testQueue";
+
+    @Before
+    public void setUp() throws Exception
+    {
+        assumeThat(getBrokerAdmin().supportsRestart(), is(true));
+    }
+
+    @Test
+    public void splitStore() throws Exception
+    {
+        final String url = String.format("virtualhost/%s/%s", 
getVirtualHostNode(), getVirtualHost());
+        getHelper().submitRequest(url, "DELETE", SC_OK);
+
+        final Map<String, Object> attributes = new HashMap<>();
+        attributes.put(VirtualHost.TYPE, 
System.getProperty("virtualhostnode.type"));
+        getHelper().submitRequest(url, "PUT", attributes, SC_CREATED);
+
+        final Map<String, Object> virtualHost = getHelper().getJson(url,
+                                                                    new 
TypeReference<Map<String, Object>>() {},
+                                                                    SC_OK);
+        final String storePath = (String) virtualHost.get("storePath");
+        assertThat(new File(storePath).exists(), is(equalTo(true)));
+
+        getBrokerAdmin().createQueue(TEST_QUEUE);
+        final TextMessage sentMessage = putMessageOnQueue();
+
+        getBrokerAdmin().restart();
+
+        verifyMessagesOnQueue(sentMessage);
+
+        getHelper().submitRequest(url, "DELETE", SC_OK);
+        assertThat(new File(storePath).exists(), is(equalTo(false)));
+
+        attributes.put(VirtualHost.TYPE, 
ProvidedStoreVirtualHostImpl.VIRTUAL_HOST_TYPE);
+        getHelper().submitRequest(url, "PUT", attributes, SC_CREATED);
+
+        getBrokerAdmin().createQueue(TEST_QUEUE);
+        verifyMessagesOnQueue( putMessageOnQueue());
+    }
+
+    private TextMessage putMessageOnQueue() throws Exception
+    {
+        Connection connection = getConnection();
+        try
+        {
+            Session session = connection.createSession(true, 
Session.SESSION_TRANSACTED);
+            List<Message> _expectedMessages = Utils.sendMessages(session, 
session.createQueue(TEST_QUEUE), 1);
+            return (TextMessage) _expectedMessages.get(0);
+        }
+        finally
+        {
+            connection.close();
+        }
+    }
+
+    private void verifyMessagesOnQueue(final TextMessage expectedMessage) 
throws Exception
+    {
+        Connection connection = getConnection();
+        try
+        {
+            connection.start();
+            Session session = connection.createSession(true, 
Session.SESSION_TRANSACTED);
+            MessageConsumer consumer = 
session.createConsumer(session.createQueue(TEST_QUEUE));
+
+            final TextMessage receivedMessage = (TextMessage) 
consumer.receive(getReceiveTimeout());
+            assertThat(receivedMessage, is(notNullValue()));
+            assertThat(receivedMessage.getJMSMessageID(), 
is(equalTo(expectedMessage.getJMSMessageID())));
+            assertThat(receivedMessage.getText(), 
is(equalTo(expectedMessage.getText())));
+        }
+        finally
+        {
+            connection.close();
+        }
+    }
+
+    private void changeState(final String url, final String desiredState) 
throws Exception
+    {
+        Map<String, Object> attributes = 
Collections.singletonMap(ConfiguredObject.DESIRED_STATE, desiredState);
+        getHelper().submitRequest(url, "POST", attributes, SC_OK);
+    }
+
+    private void assertState(final String url, final String 
expectedActualState) throws Exception
+    {
+        Map<String, Object> object = getHelper().getJson(url, new 
TypeReference<Map<String, Object>>() {}, SC_OK);
+        final String actualState = (String) object.get(ConfiguredObject.STATE);
+        assertThat(actualState, is(equalTo(expectedActualState)));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/81d81723/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/rest/model/CreateTest.java
----------------------------------------------------------------------
diff --git 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/rest/model/CreateTest.java
 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/rest/model/CreateTest.java
index a09d9ad..d3e5683 100644
--- 
a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/rest/model/CreateTest.java
+++ 
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/rest/model/CreateTest.java
@@ -22,17 +22,21 @@ package org.apache.qpid.tests.http.rest.model;
 import static javax.servlet.http.HttpServletResponse.SC_CREATED;
 import static javax.servlet.http.HttpServletResponse.SC_METHOD_NOT_ALLOWED;
 import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND;
+import static javax.servlet.http.HttpServletResponse.SC_OK;
 import static 
org.apache.qpid.server.management.plugin.servlet.rest.AbstractServlet.SC_UNPROCESSABLE_ENTITY;
 import static org.hamcrest.CoreMatchers.endsWith;
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;
 
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import com.fasterxml.jackson.core.type.TypeReference;
 import org.junit.Test;
 
 import org.apache.qpid.server.logging.logback.VirtualHostFileLogger;
@@ -44,6 +48,8 @@ import org.apache.qpid.tests.http.HttpRequestConfig;
 @HttpRequestConfig
 public class CreateTest extends HttpTestBase
 {
+    private static final String UTF_8 = StandardCharsets.UTF_8.toString();
+
     @Test
     public void create() throws Exception
     {
@@ -129,6 +135,27 @@ public class CreateTest extends HttpTestBase
         getHelper().submitRequest(childUrl, "PUT", childAttrs, 
SC_UNPROCESSABLE_ENTITY);
     }
 
+    @Test
+    public void objectsWithSlashes() throws Exception
+    {
+        String queueName = "testQueue/with/slashes";
+        String queueNameEncoded = URLEncoder.encode(queueName, UTF_8);
+        String queueNameDoubleEncoded = URLEncoder.encode(queueNameEncoded, 
UTF_8);
+        String queueUrl = "queue/" + queueNameDoubleEncoded;
+
+        Map<String, List<String>> headers = new HashMap<>();
+        int responseCode = getHelper().submitRequest(queueUrl, "PUT", 
Collections.emptyMap(), headers);
+        assertThat(responseCode, is(equalTo(SC_CREATED)));
+        List<String> location = headers.get("Location");
+        assertThat(location.size(), is(equalTo(1)));
+        assertThat(location.get(0), endsWith(queueUrl));
+
+        final Map<String, Object> queue = getHelper().getJson(queueUrl,
+                                                              new 
TypeReference<Map<String, Object>>() {}, SC_OK);
+
+        assertThat(queue.get(ConfiguredObject.NAME), is(equalTo(queueName)));
+    }
+
     private void createToParent(final String method) throws Exception
     {
         final String parentUrl = "queue";

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/81d81723/systests/src/test/java/org/apache/qpid/server/store/SplitStoreTest.java
----------------------------------------------------------------------
diff --git 
a/systests/src/test/java/org/apache/qpid/server/store/SplitStoreTest.java 
b/systests/src/test/java/org/apache/qpid/server/store/SplitStoreTest.java
deleted file mode 100644
index 9217ccd..0000000
--- a/systests/src/test/java/org/apache/qpid/server/store/SplitStoreTest.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.store;
-
-import java.util.Collections;
-import java.util.Map;
-
-import javax.jms.Connection;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.Queue;
-import javax.jms.Session;
-
-import org.apache.qpid.configuration.ClientProperties;
-import org.apache.qpid.server.model.VirtualHostNode;
-import org.apache.qpid.server.virtualhostnode.AbstractVirtualHostNode;
-import org.apache.qpid.server.virtualhostnode.JsonVirtualHostNode;
-import org.apache.qpid.server.virtualhostnode.JsonVirtualHostNodeImpl;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-import org.apache.qpid.test.utils.TestBrokerConfiguration;
-
-public class SplitStoreTest extends QpidBrokerTestCase
-{
-    private String _messageStorePath;
-    private String _configStorePath;
-
-    @Override
-    protected void setUp() throws Exception
-    {
-        super.setUp();
-
-        String virtualHostWorkDir = 
"${json:qpid.work_dir}${json:file.separator}${this:name}${json:file.separator}";
-        _messageStorePath =  virtualHostWorkDir  + "messageStore";
-        _configStorePath =  virtualHostWorkDir  + "configStore";
-    }
-
-    @Override
-    public void startDefaultBroker() throws Exception
-    {
-        // Overridden to prevent QBTC starting the Broker.
-    }
-
-    public void testJsonConfigurationStoreWithPersistentMessageStore() throws 
Exception
-    {
-        doTest(JsonVirtualHostNodeImpl.VIRTUAL_HOST_NODE_TYPE, 
getTestProfileVirtualHostNodeType());
-    }
-
-    public void testSeparateConfigurationAndMessageStoresOfTheSameType() 
throws Exception
-    {
-        doTest(getTestProfileVirtualHostNodeType(), 
getTestProfileVirtualHostNodeType());
-    }
-
-    private void configureAndStartBroker(String virtualHostNodeType, String 
virtualHostType) throws Exception
-    {
-        final String blueprint = String.format(
-           "{ \"type\" : \"%s\",  \"storePath\" : \"%s\" }", virtualHostType, 
_messageStorePath);
-        final Map<String, String> contextMap = 
Collections.singletonMap(AbstractVirtualHostNode.VIRTUALHOST_BLUEPRINT_CONTEXT_VAR,
-                                                                        
blueprint);
-
-        TestBrokerConfiguration config = getDefaultBrokerConfiguration();
-        config.setObjectAttribute(VirtualHostNode.class, 
TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, VirtualHostNode.TYPE, 
virtualHostNodeType);
-        config.setObjectAttribute(VirtualHostNode.class, 
TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, VirtualHostNode.CONTEXT, 
contextMap);
-        config.setObjectAttribute(VirtualHostNode.class, 
TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, 
JsonVirtualHostNode.STORE_PATH, _configStorePath);
-
-        super.startDefaultBroker();
-    }
-
-    private void doTest(String nodeType, String path) throws Exception
-    {
-        configureAndStartBroker(nodeType, path);
-
-        Connection connection = getConnection();
-        Session session = connection.createSession(true, 
Session.SESSION_TRANSACTED);
-        Queue queue = createTestQueue(session);
-        sendMessage(session, queue, 1);
-        connection.close();
-
-        restartDefaultBroker();
-
-        setTestSystemProperty(ClientProperties.QPID_DECLARE_QUEUES_PROP_NAME, 
"false");
-        connection = getConnection();
-        connection.start();
-        session = connection.createSession(true, Session.SESSION_TRANSACTED);
-        MessageConsumer consumer = session.createConsumer(queue);
-        Message message = consumer.receive(1000);
-        session.commit();
-
-        assertNotNull("Message was not received after first restart", message);
-        assertEquals("Unexpected message received after first restart", 0, 
message.getIntProperty(INDEX));
-
-        stopDefaultBroker();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/81d81723/systests/src/test/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java
----------------------------------------------------------------------
diff --git 
a/systests/src/test/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java 
b/systests/src/test/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java
index e4b9559..fc15e1c 100644
--- 
a/systests/src/test/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java
+++ 
b/systests/src/test/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java
@@ -20,41 +20,22 @@
  */
 package org.apache.qpid.systest.rest;
 
-import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND;
 import static javax.servlet.http.HttpServletResponse.SC_OK;
-import static 
org.apache.qpid.server.management.plugin.servlet.rest.AbstractServlet.SC_UNPROCESSABLE_ENTITY;
 
 import java.io.IOException;
-import java.net.URLEncoder;
 import java.util.Arrays;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import javax.jms.Connection;
-import javax.jms.Destination;
-import javax.jms.Session;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Assert;
 
 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.LastValueQueue;
-import org.apache.qpid.server.queue.PriorityQueue;
-import org.apache.qpid.server.queue.SortedQueue;
 import org.apache.qpid.server.virtualhost.NodeAutoCreationPolicy;
 import org.apache.qpid.server.virtualhost.QueueManagingVirtualHost;
-import org.apache.qpid.server.virtualhost.derby.DerbyVirtualHostImpl;
-import org.apache.qpid.server.virtualhostnode.JsonVirtualHostNodeImpl;
 
 public class VirtualHostRestTest extends QpidRestTestCase
 {
-    private static final String VIRTUALHOST_EXCHANGES_ATTRIBUTE = "exchanges";
-    public static final String VIRTUALHOST_QUEUES_ATTRIBUTE = "queues";
-
     public static final String EMPTY_VIRTUALHOSTNODE_NAME = "emptyVHN";
 
     private Connection _connection;
@@ -66,159 +47,6 @@ public class VirtualHostRestTest extends QpidRestTestCase
         createTestVirtualHostNode(getDefaultBroker(), 
EMPTY_VIRTUALHOSTNODE_NAME, false);
     }
 
-    public void testGet() throws Exception
-    {
-        List<Map<String, Object>> hosts = 
getRestTestHelper().getJsonAsList("virtualhost");
-        assertNotNull("Hosts data cannot be null", hosts);
-        assertEquals("Unexpected number of hosts", 
EXPECTED_VIRTUALHOSTS.length, hosts.size());
-        for (String hostName : EXPECTED_VIRTUALHOSTS)
-        {
-            Map<String, Object> host = getRestTestHelper().find("name", 
hostName, hosts);
-            Asserts.assertVirtualHost(hostName, host);
-        }
-    }
-
-    public void testGetHost() throws Exception
-    {
-        // create AMQP connection to get connection JSON details
-        _connection = getConnection();
-        Session session = _connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
-        createTestQueue(session);
-
-        Map<String, Object> hostDetails = 
getRestTestHelper().getJsonAsMap("virtualhost/test/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", 1, 
statistics.get("queueCount"));
-        assertEquals("Unexpected number of connections in statistics", 1, 
statistics.get("connectionCount"));
-
-
-        List<Map<String, Object>> exchanges = 
getRestTestHelper().getJsonAsList("exchange/test");
-        Asserts.assertVirtualHost("test", hostDetails);
-
-        assertEquals("Unexpected number of exchanges", 
EXPECTED_EXCHANGES.length, exchanges.size());
-        Asserts.assertDurableExchange("amq.fanout", "fanout", 
getRestTestHelper().find(Exchange.NAME, "amq.fanout", exchanges));
-        Asserts.assertDurableExchange("amq.topic", "topic", 
getRestTestHelper().find(Exchange.NAME, "amq.topic", exchanges));
-        Asserts.assertDurableExchange("amq.direct", "direct", 
getRestTestHelper().find(Exchange.NAME, "amq.direct", exchanges));
-        Asserts.assertDurableExchange("amq.match", "headers", 
getRestTestHelper().find(Exchange.NAME, "amq.match", exchanges));
-
-        @SuppressWarnings("unchecked")
-        List<Map<String, Object>> queues = 
getRestTestHelper().getJsonAsList("queue/test");
-        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 = 
getRestTestHelper().getJsonAsList("virtualhost/test/test/getConnections");
-        assertEquals("Unexpected number of connections", 1, 
connections.size());
-        Asserts.assertConnection(connections.get(0), isBroker10() ? 2 : 1);
-    }
-
-    public void testCreateProvidedVirtualHost() throws Exception
-    {
-        Map<String, Object> requestData = submitVirtualHost(true, "PUT", 
HttpServletResponse.SC_CREATED);
-        String hostName = (String)requestData.get(VirtualHost.NAME);
-
-        Map<String, Object> hostDetails = 
getRestTestHelper().getJsonAsMap("virtualhost/"
-                                                                           + 
EMPTY_VIRTUALHOSTNODE_NAME
-                                                                           + 
"/"
-                                                                           + 
hostName
-                                                                           + 
"?depth=1");
-        Asserts.assertVirtualHost(hostName, hostDetails);
-
-        assertNewVirtualHost(hostDetails);
-    }
-
-    public void testCreateVirtualHostByPutUsingParentURI() throws Exception
-    {
-        Map<String, Object> data = submitVirtualHost(true, "PUT", 
HttpServletResponse.SC_CREATED);
-        String hostName = (String)data.get(VirtualHost.NAME);
-
-        String url = "virtualhost/" + EMPTY_VIRTUALHOSTNODE_NAME + "/" + 
hostName + "?depth=1";
-        Map<String, Object> hostDetails = 
getRestTestHelper().getJsonAsMap(url);
-        Asserts.assertVirtualHost(hostName, hostDetails);
-        assertNewVirtualHost(hostDetails);
-    }
-
-    public void testCreateVirtualHostByPostUsingParentURI() throws Exception
-    {
-        Map<String, Object> data = submitVirtualHost(true, "POST", 
HttpServletResponse.SC_CREATED);
-        String hostName = (String)data.get(VirtualHost.NAME);
-
-        Map<String, Object> hostDetails = 
getRestTestHelper().getJsonAsMap("virtualhost/"
-                                                                           + 
EMPTY_VIRTUALHOSTNODE_NAME
-                                                                           + 
"/"
-                                                                           + 
hostName
-                                                                           + 
"?depth=1");
-        Asserts.assertVirtualHost(hostName, hostDetails);
-        assertNewVirtualHost(hostDetails);
-    }
-
-    public void testCreateVirtualHostByPutUsingVirtualHostURI() throws 
Exception
-    {
-        Map<String, Object> data = submitVirtualHost(false, "PUT", 
HttpServletResponse.SC_CREATED);
-        String hostName = (String)data.get(VirtualHost.NAME);
-        Map<String, Object> hostDetails = 
getRestTestHelper().getJsonAsMap("virtualhost/"
-                                                                           + 
EMPTY_VIRTUALHOSTNODE_NAME
-                                                                           + 
"/"
-                                                                           + 
hostName
-                                                                           + 
"?depth=1");
-        Asserts.assertVirtualHost(hostName, hostDetails);
-
-        assertNewVirtualHost(hostDetails);
-
-    }
-
-    public void testCreateVirtualHostByPostUsingVirtualHostURI() throws 
Exception
-    {
-        Map<String, Object> data = submitVirtualHost(false, "POST", 
SC_NOT_FOUND);
-
-        String hostName = (String)data.get(VirtualHost.NAME);
-        getRestTestHelper().submitRequest("virtualhost/" + 
EMPTY_VIRTUALHOSTNODE_NAME + "/" + hostName,
-                "GET", SC_NOT_FOUND);
-    }
-
-    public void testDeleteHost() throws Exception
-    {
-        getRestTestHelper().submitRequest("virtualhost/" + TEST3_VIRTUALHOST + 
"/" + TEST3_VIRTUALHOST,
-                                          "DELETE",
-                                          SC_OK);
-
-        List<Map<String, Object>> hosts = 
getRestTestHelper().getJsonAsList("virtualhost/" + TEST3_VIRTUALHOST);
-        assertEquals("Host should be deleted", 0, hosts.size());
-    }
-
-    public void testUpdateByPut() throws Exception
-    {
-        assertVirtualHostUpdate("PUT");
-    }
-
-    public void testUpdateByPost() throws Exception
-    {
-        assertVirtualHostUpdate("POST");
-    }
-
-    private void assertVirtualHostUpdate(String method) throws IOException
-    {
-        String hostToUpdate = TEST3_VIRTUALHOST;
-        String restHostUrl = "virtualhost/" + hostToUpdate + "/" + 
hostToUpdate;
-
-        Map<String, Object> hostDetails = 
getRestTestHelper().getJsonAsMap(restHostUrl);
-        Asserts.assertVirtualHost(hostToUpdate, hostDetails);
-
-        Map<String, Object> newAttributes = Collections.<String, 
Object>singletonMap(VirtualHost.DESCRIPTION, "This is a virtual host");
-        getRestTestHelper().submitRequest(restHostUrl, method, newAttributes, 
SC_OK);
-
-        Map<String, Object> rereadHostDetails = 
getRestTestHelper().getJsonAsMap(restHostUrl);
-        Asserts.assertVirtualHost(hostToUpdate, rereadHostDetails);
-        assertEquals("This is a virtual host", 
rereadHostDetails.get(VirtualHost.DESCRIPTION));
-    }
-
     public void testAddValidAutoCreationPolicies() throws IOException
     {
         String hostToUpdate = TEST3_VIRTUALHOST;
@@ -371,452 +199,5 @@ public class VirtualHostRestTest extends QpidRestTestCase
         assertTrue("Retrieved node policies is not empty", 
((List)retrievedPolicies).isEmpty());
     }
 
-    public void testMutateState() throws Exception
-    {
-        String restHostUrl = "virtualhost/" + TEST1_VIRTUALHOST + "/" + 
TEST1_VIRTUALHOST;
-
-        _restTestHelper.waitForAttributeChanged(restHostUrl, 
VirtualHost.STATE, "ACTIVE");
-        assertActualAndDesireStates(restHostUrl, "ACTIVE", "ACTIVE");
-
-        Map<String, Object> newAttributes = Collections.<String, 
Object>singletonMap(VirtualHost.DESIRED_STATE, "STOPPED");
-        getRestTestHelper().submitRequest(restHostUrl, "PUT", newAttributes, 
SC_OK);
-
-        _restTestHelper.waitForAttributeChanged(restHostUrl, 
VirtualHost.STATE, "STOPPED");
-        assertActualAndDesireStates(restHostUrl, "STOPPED", "STOPPED");
-
-        newAttributes = Collections.<String, 
Object>singletonMap(VirtualHost.DESIRED_STATE, "ACTIVE");
-        getRestTestHelper().submitRequest(restHostUrl, "PUT", newAttributes, 
SC_OK);
-
-        _restTestHelper.waitForAttributeChanged(restHostUrl, 
VirtualHost.STATE, "ACTIVE");
-
-        assertActualAndDesireStates(restHostUrl, "ACTIVE", "ACTIVE");
-    }
-
-    public void testMutateStateOfVirtualHostWithQueuesAndMessages() throws 
Exception
-    {
-        String testQueueName = getTestQueueName();
-        String restHostUrl = "virtualhost/" + TEST1_VIRTUALHOST + "/" + 
TEST1_VIRTUALHOST;
-        String restQueueUrl = "queue/" + TEST1_VIRTUALHOST + "/" + 
TEST1_VIRTUALHOST + "/" + testQueueName;
-
-        _restTestHelper.waitForAttributeChanged(restHostUrl, 
VirtualHost.STATE, "ACTIVE");
-        assertActualAndDesireStates(restHostUrl, "ACTIVE", "ACTIVE");
-
-        Connection connection = getConnection();
-        Session session = connection.createSession(true, 
Session.SESSION_TRANSACTED);
-        Destination dest = createTestQueue(session, testQueueName);
-        session.createProducer(dest).send(session.createTextMessage("My test 
message"));
-        session.commit();
-        connection.close();
-
-        assertQueueDepth(restQueueUrl, "Unexpected number of messages before 
stopped", 1);
-
-        Map<String, Object> newAttributes = Collections.<String, 
Object>singletonMap(VirtualHost.DESIRED_STATE, "STOPPED");
-        getRestTestHelper().submitRequest(restHostUrl, "PUT", newAttributes, 
SC_OK);
-
-        _restTestHelper.waitForAttributeChanged(restHostUrl, 
VirtualHost.STATE, "STOPPED");
-        assertActualAndDesireStates(restHostUrl, "STOPPED", "STOPPED");
-
-        newAttributes = Collections.<String, 
Object>singletonMap(VirtualHost.DESIRED_STATE, "ACTIVE");
-        getRestTestHelper().submitRequest(restHostUrl, "PUT", newAttributes, 
SC_OK);
-
-        _restTestHelper.waitForAttributeChanged(restHostUrl, 
VirtualHost.STATE, "ACTIVE");
-
-        assertActualAndDesireStates(restHostUrl, "ACTIVE", "ACTIVE");
-
-        assertQueueDepth(restQueueUrl, "Unexpected number of messages after 
restart", 1);
-    }
-
-    public void testRecoverVirtualHostInDesiredStateStoppedWithDescription() 
throws Exception
-    {
-        String hostToUpdate = TEST3_VIRTUALHOST;
-        String restUrl = "virtualhost/" + hostToUpdate + "/" + hostToUpdate;
-
-        assertActualAndDesireStates(restUrl, "ACTIVE", "ACTIVE");
-
-        Map<String, Object> newAttributes = new HashMap<>();
-        newAttributes.put(VirtualHost.DESIRED_STATE, "STOPPED");
-        newAttributes.put(VirtualHost.DESCRIPTION, "My description");
-
-        getRestTestHelper().submitRequest(restUrl, "PUT", newAttributes, 
SC_OK);
-
-        assertActualAndDesireStates(restUrl, "STOPPED", "STOPPED");
-
-        restartDefaultBroker();
-
-        Map<String, Object> rereadVirtualhost = 
getRestTestHelper().getJsonAsMap(restUrl);
-        Asserts.assertActualAndDesiredState("STOPPED", "STOPPED", 
rereadVirtualhost);
-
-        assertEquals("Unexpected description after restart", "My description", 
rereadVirtualhost.get(VirtualHost.DESCRIPTION));
-    }
-
-    public void testPutCreateQueue() throws Exception
-    {
-        String queueName = getTestQueueName();
-
-        createQueue(queueName + "-standard", "standard", null);
-
-        Map<String, Object> sortedQueueAttributes = new HashMap<String, 
Object>();
-        sortedQueueAttributes.put(SortedQueue.SORT_KEY, "sortme");
-        createQueue(queueName + "-sorted", "sorted", sortedQueueAttributes);
-
-        Map<String, Object> priorityQueueAttributes = new HashMap<String, 
Object>();
-        priorityQueueAttributes.put(PriorityQueue.PRIORITIES, 10);
-        createQueue(queueName + "-priority", "priority", 
priorityQueueAttributes);
-
-        Map<String, Object> lvqQueueAttributes = new HashMap<String, Object>();
-        lvqQueueAttributes.put(LastValueQueue.LVQ_KEY, "LVQ");
-        createQueue(queueName + "-lvq", "lvq", lvqQueueAttributes);
-
-        Map<String, Object> hostDetails = 
getRestTestHelper().getJsonAsMap("virtualhost/test/test?depth=1");
-
-        @SuppressWarnings("unchecked")
-        List<Map<String, Object>> queues = (List<Map<String, Object>>) 
hostDetails.get(VirtualHostRestTest.VIRTUALHOST_QUEUES_ATTRIBUTE);
-        Map<String, Object> standardQueue = 
getRestTestHelper().find(Queue.NAME, queueName + "-standard" , queues);
-        Map<String, Object> sortedQueue = getRestTestHelper().find(Queue.NAME, 
queueName + "-sorted" , queues);
-        Map<String, Object> priorityQueue = 
getRestTestHelper().find(Queue.NAME, queueName + "-priority" , queues);
-        Map<String, Object> lvqQueue = getRestTestHelper().find(Queue.NAME, 
queueName + "-lvq" , queues);
-
-        Asserts.assertQueue(queueName + "-standard", "standard", 
standardQueue);
-        Asserts.assertQueue(queueName + "-sorted", "sorted", sortedQueue);
-        Asserts.assertQueue(queueName + "-priority", "priority", 
priorityQueue);
-        Asserts.assertQueue(queueName + "-lvq", "lvq", lvqQueue);
-
-        assertEquals("Unexpected value of queue attribute " + Queue.DURABLE, 
Boolean.TRUE, standardQueue.get(Queue.DURABLE));
-        assertEquals("Unexpected value of queue attribute " + Queue.DURABLE, 
Boolean.TRUE, sortedQueue.get(Queue.DURABLE));
-        assertEquals("Unexpected value of queue attribute " + Queue.DURABLE, 
Boolean.TRUE, priorityQueue.get(Queue.DURABLE));
-        assertEquals("Unexpected value of queue attribute " + Queue.DURABLE, 
Boolean.TRUE, lvqQueue.get(Queue.DURABLE));
-
-        assertEquals("Unexpected sorted key attribute", "sortme", 
sortedQueue.get(SortedQueue.SORT_KEY));
-        assertEquals("Unexpected lvq key attribute", "LVQ", 
lvqQueue.get(LastValueQueue.LVQ_KEY));
-        assertEquals("Unexpected priorities key attribute", 10, 
priorityQueue.get(PriorityQueue.PRIORITIES));
-    }
-
-    public void testPutCreateExchange() throws Exception
-    {
-        String exchangeName = getTestName();
-
-        createExchange(exchangeName + "-direct", "direct");
-        createExchange(exchangeName + "-topic", "topic");
-        createExchange(exchangeName + "-headers", "headers");
-        createExchange(exchangeName + "-fanout", "fanout");
-
-        Map<String, Object> hostDetails = 
getRestTestHelper().getJsonAsMap("virtualhost/test/test?depth=1");
-
-        @SuppressWarnings("unchecked")
-        List<Map<String, Object>> exchanges = (List<Map<String, Object>>) 
hostDetails.get(VirtualHostRestTest.VIRTUALHOST_EXCHANGES_ATTRIBUTE);
-        Map<String, Object> directExchange = 
getRestTestHelper().find(Queue.NAME, exchangeName + "-direct" , exchanges);
-        Map<String, Object> topicExchange = 
getRestTestHelper().find(Queue.NAME, exchangeName + "-topic" , exchanges);
-        Map<String, Object> headersExchange = 
getRestTestHelper().find(Queue.NAME, exchangeName + "-headers" , exchanges);
-        Map<String, Object> fanoutExchange = 
getRestTestHelper().find(Queue.NAME, exchangeName + "-fanout" , exchanges);
-
-        Asserts.assertDurableExchange(exchangeName + "-direct", "direct", 
directExchange);
-        Asserts.assertDurableExchange(exchangeName + "-topic", "topic", 
topicExchange);
-        Asserts.assertDurableExchange(exchangeName + "-headers", "headers", 
headersExchange);
-        Asserts.assertDurableExchange(exchangeName + "-fanout", "fanout", 
fanoutExchange);
-
-        assertEquals("Unexpected value of queue attribute " + 
Exchange.DURABLE, Boolean.TRUE, directExchange.get(Exchange.DURABLE));
-        assertEquals("Unexpected value of queue attribute " + 
Exchange.DURABLE, Boolean.TRUE, topicExchange.get(Exchange.DURABLE));
-        assertEquals("Unexpected value of queue attribute " + 
Exchange.DURABLE, Boolean.TRUE, headersExchange.get(Exchange.DURABLE));
-        assertEquals("Unexpected value of queue attribute " + 
Exchange.DURABLE, Boolean.TRUE, fanoutExchange.get(Exchange.DURABLE));
-    }
-
-    public void testPutCreateLVQWithoutKey() throws Exception
-    {
-        String queueName = getTestQueueName()+ "-lvq";
-        createQueue(queueName, "lvq", null);
-
-        Map<String, Object> hostDetails = 
getRestTestHelper().getJsonAsMap("virtualhost/test/test?depth=1");
-
-        @SuppressWarnings("unchecked")
-        List<Map<String, Object>> queues = (List<Map<String, Object>>) 
hostDetails.get(VirtualHostRestTest.VIRTUALHOST_QUEUES_ATTRIBUTE);
-        Map<String, Object> lvqQueue = getRestTestHelper().find(Queue.NAME, 
queueName  , queues);
-
-        Asserts.assertQueue(queueName , "lvq", lvqQueue);
-        assertEquals("Unexpected value of queue attribute " + Queue.DURABLE, 
Boolean.TRUE, lvqQueue.get(Queue.DURABLE));
-        assertEquals("Unexpected lvq key attribute", 
LastValueQueue.DEFAULT_LVQ_KEY, lvqQueue.get(LastValueQueue.LVQ_KEY));
-    }
-
-    public void testPutCreateSortedQueueWithoutKey() throws Exception
-    {
-        String queueName = getTestQueueName() + "-sorted";
-        int responseCode = tryCreateQueue(queueName, "sorted", null);
-        assertEquals("Unexpected response code", SC_UNPROCESSABLE_ENTITY, 
responseCode);
-
-        Map<String, Object> hostDetails = 
getRestTestHelper().getJsonAsMap("virtualhost/test/test?depth=1");
-
-        @SuppressWarnings("unchecked")
-        List<Map<String, Object>> queues = (List<Map<String, Object>>) 
hostDetails.get(VirtualHostRestTest.VIRTUALHOST_QUEUES_ATTRIBUTE);
-        Map<String, Object> testQueue = getRestTestHelper().find(Queue.NAME, 
queueName  , queues);
-
-        assertNull("Sorted queue without a key was created ", testQueue);
-    }
-
-    public void testPutCreatePriorityQueueWithoutKey() throws Exception
-    {
-        String queueName = getTestQueueName()+ "-priority";
-        createQueue(queueName, "priority", null);
-
-        Map<String, Object> hostDetails = 
getRestTestHelper().getJsonAsMap("virtualhost/test/test?depth=1");
-
-        @SuppressWarnings("unchecked")
-        List<Map<String, Object>> queues = (List<Map<String, Object>>) 
hostDetails.get(VirtualHostRestTest.VIRTUALHOST_QUEUES_ATTRIBUTE);
-        Map<String, Object> priorityQueue = 
getRestTestHelper().find(Queue.NAME, queueName  , queues);
-
-        Asserts.assertQueue(queueName , "priority", priorityQueue);
-        assertEquals("Unexpected value of queue attribute " + Queue.DURABLE, 
Boolean.TRUE, priorityQueue.get(Queue.DURABLE));
-        assertEquals("Unexpected number of priorities", 10, 
priorityQueue.get(PriorityQueue.PRIORITIES));
-    }
-
-    public void testPutCreateStandardQueueWithoutType() throws Exception
-    {
-        String queueName = getTestQueueName();
-        createQueue(queueName, null, null);
-
-        Map<String, Object> hostDetails = 
getRestTestHelper().getJsonAsMap("virtualhost/test/test?depth=1");
-
-        @SuppressWarnings("unchecked")
-        List<Map<String, Object>> queues = (List<Map<String, Object>>) 
hostDetails.get(VirtualHostRestTest.VIRTUALHOST_QUEUES_ATTRIBUTE);
-        Map<String, Object> queue = getRestTestHelper().find(Queue.NAME, 
queueName  , queues);
-
-        Asserts.assertQueue(queueName , "standard", queue);
-    }
-
-    public void testPutCreateQueueOfUnsupportedType() throws Exception
-    {
-        String queueName = getTestQueueName();
-        int responseCode = tryCreateQueue(queueName, "unsupported", null);
-        assertEquals("Unexpected response code", SC_UNPROCESSABLE_ENTITY, 
responseCode);
-
-        Map<String, Object> hostDetails = 
getRestTestHelper().getJsonAsMap("virtualhost/test/test?depth=1");
-
-        @SuppressWarnings("unchecked")
-        List<Map<String, Object>> queues = (List<Map<String, Object>>) 
hostDetails.get(VirtualHostRestTest.VIRTUALHOST_QUEUES_ATTRIBUTE);
-        Map<String, Object> queue = getRestTestHelper().find(Queue.NAME, 
queueName  , queues);
-
-        assertNull("Queue of unsupported type was created", queue);
-    }
-
-    public void testDeleteQueue() throws Exception
-    {
-        String queueName = getTestQueueName();
-        createQueue(queueName, null, null);
-
-        String queueUrl = "queue/test/test/" + queueName;
-        Map<String, Object> queueData = 
getRestTestHelper().getJsonAsMap(queueUrl);
-        assertEquals("Unexpected name", queueName, queueData.get(Queue.NAME));
-
-        getRestTestHelper().submitRequest(queueUrl, "DELETE", SC_OK);
-
-        getRestTestHelper().submitRequest(queueUrl, "GET", SC_NOT_FOUND);
-    }
-
-    public void testDeleteQueueById() throws Exception
-    {
-        String queueName = getTestQueueName();
-        createQueue(queueName, null, null);
-        Map<String, Object> queueDetails = 
getRestTestHelper().getJsonAsMap("queue/test/test/" + queueName);
-        getRestTestHelper().submitRequest("queue/test/test?id=" + 
queueDetails.get(Queue.ID), "DELETE", SC_OK);
-        getRestTestHelper().submitRequest("queue/test/test/" + queueName, 
"GET", SC_NOT_FOUND);
-    }
-
-    public void testDeleteExchange() throws Exception
-    {
-        String exchangeName = getTestName();
-        createExchange(exchangeName, "direct");
-
-        int statusCode = 
getRestTestHelper().submitRequest("exchange/test/test/" + exchangeName, 
"DELETE");
-
-        assertEquals("Unexpected response code", 200, statusCode);
-        getRestTestHelper().submitRequest("exchange/test/test/" + 
exchangeName, "GET", SC_NOT_FOUND);
-    }
-
-    public void testDeleteExchangeById() throws Exception
-    {
-        String exchangeName = getTestName();
-        createExchange(exchangeName, "direct");
-        Map<String, Object> echangeDetails = 
getRestTestHelper().getJsonAsMap("exchange/test/test/" + exchangeName);
-
-        int statusCode = 
getRestTestHelper().submitRequest("exchange/test/test?id=" + 
echangeDetails.get(Exchange.ID), "DELETE");
-
-        assertEquals("Unexpected response code", 200, statusCode);
-        getRestTestHelper().submitRequest("exchange/test/test/" + 
exchangeName, "GET", SC_NOT_FOUND);
-    }
-
-    public void testPutCreateQueueWithAttributes() throws Exception
-    {
-        String queueName = getTestQueueName();
-
-        Map<String, Object> attributes = new HashMap<String, Object>();
-        attributes.put(Queue.ALERT_REPEAT_GAP, 1000);
-        attributes.put(Queue.ALERT_THRESHOLD_MESSAGE_AGE, 3600000);
-        attributes.put(Queue.ALERT_THRESHOLD_MESSAGE_SIZE, 1000000000);
-        attributes.put(Queue.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 800);
-        attributes.put(Queue.MAXIMUM_DELIVERY_ATTEMPTS, 15);
-        attributes.put(Queue.MAXIMUM_QUEUE_DEPTH_MESSAGES, 2000000000);
-
-        createQueue(queueName + "-standard", "standard", attributes);
-
-        Map<String, Object> sortedQueueAttributes = new HashMap<String, 
Object>();
-        sortedQueueAttributes.putAll(attributes);
-        sortedQueueAttributes.put(SortedQueue.SORT_KEY, "sortme");
-        createQueue(queueName + "-sorted", "sorted", sortedQueueAttributes);
-
-        Map<String, Object> priorityQueueAttributes = new HashMap<String, 
Object>();
-        priorityQueueAttributes.putAll(attributes);
-        priorityQueueAttributes.put(PriorityQueue.PRIORITIES, 10);
-        createQueue(queueName + "-priority", "priority", 
priorityQueueAttributes);
-
-        Map<String, Object> lvqQueueAttributes = new HashMap<String, Object>();
-        lvqQueueAttributes.putAll(attributes);
-        lvqQueueAttributes.put(LastValueQueue.LVQ_KEY, "LVQ");
-        createQueue(queueName + "-lvq", "lvq", lvqQueueAttributes);
-
-        Map<String, Object> hostDetails = 
getRestTestHelper().getJsonAsMap("virtualhost/test/test?depth=1");
-
-        @SuppressWarnings("unchecked")
-        List<Map<String, Object>> queues = (List<Map<String, Object>>) 
hostDetails.get(VirtualHostRestTest.VIRTUALHOST_QUEUES_ATTRIBUTE);
-        Map<String, Object> standardQueue = 
getRestTestHelper().find(Queue.NAME, queueName + "-standard" , queues);
-        Map<String, Object> sortedQueue = getRestTestHelper().find(Queue.NAME, 
queueName + "-sorted" , queues);
-        Map<String, Object> priorityQueue = 
getRestTestHelper().find(Queue.NAME, queueName + "-priority" , queues);
-        Map<String, Object> lvqQueue = getRestTestHelper().find(Queue.NAME, 
queueName + "-lvq" , queues);
-
-        attributes.put(Queue.DURABLE, Boolean.TRUE);
-        Asserts.assertQueue(queueName + "-standard", "standard", 
standardQueue, attributes);
-        Asserts.assertQueue(queueName + "-sorted", "sorted", sortedQueue, 
attributes);
-        Asserts.assertQueue(queueName + "-priority", "priority", 
priorityQueue, attributes);
-        Asserts.assertQueue(queueName + "-lvq", "lvq", lvqQueue, attributes);
-
-        assertEquals("Unexpected sorted key attribute", "sortme", 
sortedQueue.get(SortedQueue.SORT_KEY));
-        assertEquals("Unexpected lvq key attribute", "LVQ", 
lvqQueue.get(LastValueQueue.LVQ_KEY));
-        assertEquals("Unexpected priorities key attribute", 10, 
priorityQueue.get(PriorityQueue.PRIORITIES));
-    }
-
-    public void testObjectsWithSlashes() throws Exception
-    {
-        String queueName = "testQueue/with/slashes";
-        String queueNameEncoded = URLEncoder.encode(queueName, "UTF-8");
-        String queueNameDoubleEncoded = URLEncoder.encode(queueNameEncoded, 
"UTF-8");
-        String queueUrl = "queue/test/test/" + queueNameDoubleEncoded;
-
-        // Test creation
-        createQueue(queueNameDoubleEncoded, "standard", null);
-        Map<String, Object> hostDetails = 
getRestTestHelper().getJsonAsMap("virtualhost/test/test?depth=1");
-        List<Map<String, Object>> queues = (List<Map<String, Object>>) 
hostDetails.get(VirtualHostRestTest.VIRTUALHOST_QUEUES_ATTRIBUTE);
-        Map<String, Object> queue = getRestTestHelper().find(Queue.NAME, 
queueName , queues);
-        Asserts.assertQueue(queueName, "standard", queue);
-
-        // Test deletion
-        int statusCode = getRestTestHelper().submitRequest(queueUrl, "DELETE");
-        assertEquals("Unexpected response code", 200, statusCode);
-        getRestTestHelper().submitRequest(queueUrl, "GET", SC_NOT_FOUND);
-    }
-
-    private void createExchange(String exchangeName, String exchangeType) 
throws IOException
-    {
-        Map<String, Object> queueData = new HashMap<String, Object>();
-        queueData.put(Exchange.NAME, exchangeName);
-        queueData.put(Exchange.DURABLE, Boolean.TRUE);
-        queueData.put(Exchange.TYPE, exchangeType);
-
-        int statusCode = 
getRestTestHelper().submitRequest("exchange/test/test/" + exchangeName, "PUT", 
queueData);
-        assertEquals("Unexpected response code", 201, statusCode);
-    }
-
-    private void createQueue(String queueName, String queueType, Map<String, 
Object> attributes) throws Exception
-    {
-        int responseCode = tryCreateQueue(queueName, queueType, attributes);
-        assertEquals("Unexpected response code", 201, responseCode);
-    }
-
-    private int tryCreateQueue(String queueName, String queueType, Map<String, 
Object> attributes) throws Exception
-    {
-        Map<String, Object> queueData = new HashMap<String, Object>();
-        queueData.put(Queue.NAME, queueName);
-        queueData.put(Queue.DURABLE, Boolean.TRUE);
-        if (queueType != null)
-        {
-            queueData.put(Queue.TYPE, queueType);
-        }
-        if (attributes != null)
-        {
-            queueData.putAll(attributes);
-        }
-
-        return getRestTestHelper().submitRequest("queue/test/test/" + 
queueName, "PUT", queueData);
-    }
-
-    private Map<String, Object> submitVirtualHost(boolean useParentURI, String 
method, int statusCode) throws IOException
-    {
-        String hostName = getTestName();
-        String type = getTestProfileVirtualHostNodeType();
-        if (JsonVirtualHostNodeImpl.VIRTUAL_HOST_NODE_TYPE.equals(type))
-        {
-            type = DerbyVirtualHostImpl.VIRTUAL_HOST_TYPE;
-        }
-        Map<String, Object> virtualhostData = new HashMap<>();
-        virtualhostData.put(VirtualHost.NAME, hostName);
-        virtualhostData.put(VirtualHost.TYPE, type);
-
-        String url = "virtualhost/" + EMPTY_VIRTUALHOSTNODE_NAME;
-        if (!useParentURI)
-        {
-            url += "/" + hostName;
-        }
-
-        Map<String,List<String>> headers = new HashMap<>();
-        int responseCode = getRestTestHelper().submitRequest(url, method, 
virtualhostData, headers );
-        Assert.assertEquals("Unexpected response code from " + method + " " + 
url, statusCode, responseCode);
-        if (statusCode == 201)
-        {
-            List<String> location = headers.get("Location");
-            assertTrue("Location is not returned by REST create request", 
location != null && location.size() == 1);
-            String expectedLocation = getRestTestHelper().getManagementURL() + 
RestTestHelper.API_BASE + url;
-            if (useParentURI)
-            {
-                expectedLocation += "/" + hostName;
-            }
-            assertEquals("Unexpected location", expectedLocation, 
location.get(0));
-        }
-        return virtualhostData;
-    }
-
-    private void assertNewVirtualHost(Map<String, Object> 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", 0, 
statistics.get("queueCount"));
-        assertEquals("Unexpected number of connections in statistics", 0, 
statistics.get("connectionCount"));
-
-        @SuppressWarnings("unchecked")
-        List<Map<String, Object>> exchanges = (List<Map<String, Object>>) 
hostDetails.get(VIRTUALHOST_EXCHANGES_ATTRIBUTE);
-        assertEquals("Unexpected number of exchanges", 
EXPECTED_EXCHANGES.length, exchanges.size());
-        RestTestHelper restTestHelper = getRestTestHelper();
-        Asserts.assertDurableExchange("amq.fanout", "fanout", 
restTestHelper.find(Exchange.NAME, "amq.fanout", exchanges));
-        Asserts.assertDurableExchange("amq.topic", "topic", 
restTestHelper.find(Exchange.NAME, "amq.topic", exchanges));
-        Asserts.assertDurableExchange("amq.direct", "direct", 
restTestHelper.find(Exchange.NAME, "amq.direct", exchanges));
-        Asserts.assertDurableExchange("amq.match", "headers", 
restTestHelper.find(Exchange.NAME, "amq.match", exchanges));
-
-        assertNull("Unexpected queues", 
hostDetails.get(VIRTUALHOST_QUEUES_ATTRIBUTE));
-    }
-
-    private void assertActualAndDesireStates(final String restUrl,
-                                             final String expectedDesiredState,
-                                             final String expectedActualState) 
throws IOException
-    {
-        Map<String, Object> virtualhost = 
getRestTestHelper().getJsonAsMap(restUrl);
-        Asserts.assertActualAndDesiredState(expectedDesiredState, 
expectedActualState, virtualhost);
-    }
-
-    private void assertQueueDepth(String restQueueUrl, String message, int 
expectedDepth) throws IOException
-    {
-        Map<String, Object> queueDetails = 
getRestTestHelper().getJsonAsMap(restQueueUrl);
-        assertNotNull(queueDetails);
-        Map<String, Object> statistics = (Map<String, Object>) 
queueDetails.get(Asserts.STATISTICS_ATTRIBUTE);
-        assertNotNull(statistics);
-
-        assertEquals(message, expectedDepth, 
statistics.get("queueDepthMessages"));
-    }
 
 }

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/81d81723/test-profiles/CPPExcludes
----------------------------------------------------------------------
diff --git a/test-profiles/CPPExcludes b/test-profiles/CPPExcludes
index 2ce365d..f63c003 100755
--- a/test-profiles/CPPExcludes
+++ b/test-profiles/CPPExcludes
@@ -35,9 +35,6 @@ 
org.apache.qpid.test.unit.close.FlowToDiskBackingQueueDeleteTest#*
 // QPID-1730: the C++ server has a totally different logging mechanism. We 
should split this file differently
 org.apache.qpid.server.AlertingTest#*
 
-// The C++ server has a totally different persistence mechanism
-org.apache.qpid.server.store.SplitStoreTest#*
-
 // CPP Broker does not follow the same Logging convention as the Qpid Broker-J
 org.apache.qpid.server.BrokerStartupTest#*
 org.apache.qpid.server.logging.*

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/81d81723/test-profiles/JavaJsonExcludes
----------------------------------------------------------------------
diff --git a/test-profiles/JavaJsonExcludes b/test-profiles/JavaJsonExcludes
index 77b4e3d..61f4703 100644
--- a/test-profiles/JavaJsonExcludes
+++ b/test-profiles/JavaJsonExcludes
@@ -19,7 +19,6 @@
 
 org.apache.qpid.server.store.berkeleydb.*
 org.apache.qpid.server.store.berkeleydb.replication.*
-org.apache.qpid.server.store.SplitStoreTest#*
 org.apache.qpid.systest.rest.acl.VirtualHostACLTest#*
 
org.apache.qpid.systest.rest.VirtualHostNodeRestTest#testCreateAndDeleteVirtualHostNode
 
org.apache.qpid.systest.rest.VirtualHostRestTest#testPutCreateProvidedVirtualHost

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/81d81723/test-profiles/JavaTransientExcludes
----------------------------------------------------------------------
diff --git a/test-profiles/JavaTransientExcludes 
b/test-profiles/JavaTransientExcludes
index e565ae9..6938e3b 100644
--- a/test-profiles/JavaTransientExcludes
+++ b/test-profiles/JavaTransientExcludes
@@ -18,7 +18,6 @@
 //
 
 //These tests require a persistent store
-org.apache.qpid.server.store.SplitStoreTest#*
 org.apache.qpid.server.logging.AlertingTest#testAlertingReallyWorksWithRestart
 org.apache.qpid.server.logging.AlertingTest#testAlertingReallyWorksWithChanges
 


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

Reply via email to