qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1617325 - in /qpid/trunk/qpid/java: bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/ bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/ bdbstore/src/main/java/resources/virtualhostnode/bdb/ bdbst...
Date Mon, 11 Aug 2014 16:55:16 GMT
Author: kwall
Date: Mon Aug 11 16:55:15 2014
New Revision: 1617325

URL: http://svn.apache.org/r1617325
Log:
QPID-5988: [Java Broker] Default VHN/VH store paths to path location based on QPID_WORK

Modified:
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBVirtualHost.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBVirtualHostNode.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb/add.html
    qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/existinggroup/add.html
    qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/newgroup/add.html
    qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/edit.html
    qpid/trunk/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHostNodeRestTest.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/JsonVirtualHostNode.java
    qpid/trunk/qpid/java/broker-core/src/main/resources/initial-config.json
    qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhost/derby/DerbyVirtualHost.java
    qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNode.java
    qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/add.html
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/add.html
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/edit.html
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhostnode/filebased/edit.html
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhostnode/json/add.html
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostNodeRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
    qpid/trunk/qpid/java/test-profiles/JavaJsonExcludes
    qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBVirtualHost.java?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBVirtualHost.java
(original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBVirtualHost.java
Mon Aug 11 16:55:15 2014
@@ -38,7 +38,7 @@ public interface BDBVirtualHost<X extend
                                           Math.min(200l*1024l*1024l,
                                                    Runtime.getRuntime().maxMemory()/20l));
 
-    @ManagedAttribute(mandatory = true)
+    @ManagedAttribute(mandatory = true, defaultValue = "${qpid.work_dir}${file.separator}${this:name}${file.separator}messages")
     String getStorePath();
 
     @ManagedAttribute(mandatory = true, defaultValue = "0")

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBVirtualHostNode.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBVirtualHostNode.java?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBVirtualHostNode.java
(original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBVirtualHostNode.java
Mon Aug 11 16:55:15 2014
@@ -26,6 +26,6 @@ public interface BDBVirtualHostNode<X ex
 {
     String STORE_PATH = "storePath";
 
-    @ManagedAttribute(mandatory = true)
+    @ManagedAttribute(mandatory = true, defaultValue = "${qpid.work_dir}${file.separator}${this:name}${file.separator}config")
     String getStorePath();
 }

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb/add.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb/add.html?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb/add.html (original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb/add.html Mon
Aug 11 16:55:15 2014
@@ -20,15 +20,13 @@
  -->
 <div>
     <div class="clear">
-      <div class="formLabel-labelCell tableContainer-labelCell">Store path*:</div>
+      <div class="formLabel-labelCell tableContainer-labelCell">Store path:</div>
       <div class="formLabel-controlCell tableContainer-valueCell">
           <input type="text" id="addVirtualHostNode.storePath"
                           data-dojo-type="dijit/form/ValidationTextBox"
                           data-dojo-props="
                               name: 'storePath',
                               placeHolder: 'path/to/store',
-                              required: true,
-                              missingMessage: 'Store path must be supplied',
                               title: 'Enter store path'" />
       </div>
     </div>

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/existinggroup/add.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/existinggroup/add.html?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/existinggroup/add.html
(original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/existinggroup/add.html
Mon Aug 11 16:55:15 2014
@@ -81,15 +81,13 @@
                 </div>
             </div>
             <div class="clear">
-                <div class="formLabel-labelCell tableContainer-labelCell">Store path*:</div>
+                <div class="formLabel-labelCell tableContainer-labelCell">Store path:</div>
                 <div class="formLabel-controlCell tableContainer-valueCell">
                     <input type="text" id="addVirtualHostNode.storePath"
                            data-dojo-type="dijit/form/ValidationTextBox"
                            data-dojo-props="
                               name: 'storePath',
                               placeHolder: 'path/to/store',
-                              required: true,
-                              missingMessage: 'Store path must be supplied',
                               title: 'Enter store path'" />
                 </div>
             </div>

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/newgroup/add.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/newgroup/add.html?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/newgroup/add.html
(original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/add/newgroup/add.html
Mon Aug 11 16:55:15 2014
@@ -45,15 +45,13 @@
       </div>
     </div>
     <div class="clear">
-      <div class="formLabel-labelCell tableContainer-labelCell">Store path*:</div>
+      <div class="formLabel-labelCell tableContainer-labelCell">Store path:</div>
       <div class="formLabel-controlCell tableContainer-valueCell">
           <input type="text" id="addVirtualHostNode.storePath"
                           data-dojo-type="dijit/form/ValidationTextBox"
                           data-dojo-props="
                               name: 'storePath',
                               placeHolder: 'path/to/store',
-                              required: true,
-                              missingMessage: 'Store path must be supplied',
                               title: 'Enter store path'" />
       </div>
     </div>

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/edit.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/edit.html?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/edit.html
(original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/edit.html
Mon Aug 11 16:55:15 2014
@@ -45,15 +45,13 @@
         </div>
     </div>
     <div class="clear">
-        <div class="formLabel-labelCell tableContainer-labelCell">Configuration store
path*:</div>
+        <div class="formLabel-labelCell tableContainer-labelCell">Configuration store
path:</div>
         <div class="formLabel-controlCell tableContainer-valueCell">
             <input type="text" id="editVirtualHostNode.storePath"
                    data-dojo-type="dijit/form/ValidationTextBox"
                    data-dojo-props="
                                   name: 'storePath',
                                   placeHolder: 'path/to/store',
-                                  required: true,
-                                  missingMessage: 'Store path must be supplied',
                                   title: 'Enter configuration store path'" />
         </div>
     </div>

Modified: qpid/trunk/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHostNodeRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHostNodeRestTest.java?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHostNodeRestTest.java
(original)
+++ qpid/trunk/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHostNodeRestTest.java
Mon Aug 11 16:55:15 2014
@@ -47,7 +47,6 @@ import org.apache.qpid.server.virtualhos
 import org.apache.qpid.systest.rest.Asserts;
 import org.apache.qpid.systest.rest.QpidRestTestCase;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
-import org.apache.qpid.util.FileUtils;
 
 public class BDBHAVirtualHostNodeRestTest extends QpidRestTestCase
 {
@@ -60,7 +59,6 @@ public class BDBHAVirtualHostNodeRestTes
     private int _node3HaPort;
 
     private String _hostName;
-    private File _storeBaseDir;
     private String _baseNodeRestUrl;
 
     @Override
@@ -72,8 +70,6 @@ public class BDBHAVirtualHostNodeRestTes
         _hostName = getTestName();
         _baseNodeRestUrl = "virtualhostnode/";
 
-        _storeBaseDir = new File(TMP_FOLDER, "store-" + _hostName + "-" + System.currentTimeMillis());
-
         _node1HaPort = findFreePort();
         _node2HaPort = getNextAvailable(_node1HaPort + 1);
         _node3HaPort = getNextAvailable(_node2HaPort + 1);
@@ -82,22 +78,6 @@ public class BDBHAVirtualHostNodeRestTes
     }
 
     @Override
-    public void tearDown() throws Exception
-    {
-        try
-        {
-            super.tearDown();
-        }
-        finally
-        {
-            if (_storeBaseDir != null)
-            {
-                FileUtils.delete(_storeBaseDir, true);
-            }
-        }
-    }
-
-    @Override
     protected void customizeConfiguration() throws IOException
     {
         super.customizeConfiguration();
@@ -311,7 +291,6 @@ public class BDBHAVirtualHostNodeRestTes
         Map<String, Object> nodeData = new HashMap<String, Object>();
         nodeData.put(BDBHAVirtualHostNode.NAME, nodeName);
         nodeData.put(BDBHAVirtualHostNode.TYPE, "BDB_HA");
-        nodeData.put(BDBHAVirtualHostNode.STORE_PATH, _storeBaseDir.getPath() + File.separator
+ nodeName);
         nodeData.put(BDBHAVirtualHostNode.GROUP_NAME, _hostName);
         nodeData.put(BDBHAVirtualHostNode.ADDRESS, "localhost:" + nodePort);
         nodeData.put(BDBHAVirtualHostNode.HELPER_ADDRESS, "localhost:" + helperPort);
@@ -332,7 +311,6 @@ public class BDBHAVirtualHostNodeRestTes
         Map<String, Object> nodeData = getRestTestHelper().getJsonAsSingletonList(_baseNodeRestUrl
+ nodeName + "?depth=0");
         assertEquals("Unexpected name", nodeName, nodeData.get(BDBHAVirtualHostNode.NAME));
         assertEquals("Unexpected type", "BDB_HA", nodeData.get(BDBHAVirtualHostNode.TYPE));
-        assertEquals("Unexpected path", new File(_storeBaseDir, nodeName).getPath(), nodeData.get(BDBHAVirtualHostNode.STORE_PATH));
         assertEquals("Unexpected address", "localhost:" + nodePort, nodeData.get(BDBHAVirtualHostNode.ADDRESS));
         assertEquals("Unexpected helper address", "localhost:" + nodeHelperPort, nodeData.get(BDBHAVirtualHostNode.HELPER_ADDRESS));
         assertEquals("Unexpected group name", _hostName, nodeData.get(BDBHAVirtualHostNode.GROUP_NAME));

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/JsonVirtualHostNode.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/JsonVirtualHostNode.java?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/JsonVirtualHostNode.java
(original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/JsonVirtualHostNode.java
Mon Aug 11 16:55:15 2014
@@ -26,6 +26,6 @@ public interface JsonVirtualHostNode<X e
 
     String STORE_PATH = "storePath";
 
-    @ManagedAttribute(mandatory = true)
+    @ManagedAttribute(mandatory = true, defaultValue = "${qpid.work_dir}${file.separator}${this:name}${file.separator}config")
     String getStorePath();
 }

Modified: qpid/trunk/qpid/java/broker-core/src/main/resources/initial-config.json
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/resources/initial-config.json?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/resources/initial-config.json (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/resources/initial-config.json Mon Aug 11 16:55:15
2014
@@ -55,9 +55,8 @@
   "virtualhostnodes" : [ {
     "name" : "default",
     "type" : "JSON",
-    "storePath" : "${qpid.work_dir}${file.separator}default${file.separator}config",
     "context" : {
-        "virtualhostBlueprint" : "{ \"type\" : \"DERBY\", \"storePath\" : \"${json:qpid.work_dir}${json:file.separator}default${json:file.separator}messages\"
}"
+        "virtualhostBlueprint" : "{ \"type\" : \"DERBY\" }"
     }
   } ],
   "plugins" : [ {

Modified: qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhost/derby/DerbyVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhost/derby/DerbyVirtualHost.java?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhost/derby/DerbyVirtualHost.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhost/derby/DerbyVirtualHost.java
Mon Aug 11 16:55:15 2014
@@ -29,7 +29,7 @@ public interface DerbyVirtualHost<X exte
 {
     String STORE_PATH = "storePath";
 
-    @ManagedAttribute(mandatory = true)
+    @ManagedAttribute(mandatory = true, defaultValue = "${qpid.work_dir}${file.separator}${this:name}${file.separator}messages")
     String getStorePath();
 
     @ManagedAttribute(mandatory = true, defaultValue = "0")

Modified: qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNode.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNode.java?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNode.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNode.java
Mon Aug 11 16:55:15 2014
@@ -26,6 +26,6 @@ public interface DerbyVirtualHostNode<X 
 {
     String STORE_PATH = "storePath";
 
-    @ManagedAttribute(mandatory = true)
+    @ManagedAttribute(mandatory = true, defaultValue = "${qpid.work_dir}${file.separator}${this:name}${file.separator}config")
     String getStorePath();
 }

Modified: qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/add.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/add.html?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/add.html
(original)
+++ qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/add.html
Mon Aug 11 16:55:15 2014
@@ -20,15 +20,13 @@
  -->
 <div>
     <div class="clear">
-      <div class="formLabel-labelCell tableContainer-labelCell">Store path*:</div>
+      <div class="formLabel-labelCell tableContainer-labelCell">Store path:</div>
       <div class="formLabel-controlCell tableContainer-valueCell">
           <input type="text" id="addVirtualHostNode.storePath"
                           data-dojo-type="dijit/form/ValidationTextBox"
                           data-dojo-props="
                               name: 'storePath',
                               placeHolder: 'path/to/store',
-                              required: true,
-                              missingMessage: 'Store path must be supplied',
                               title: 'Enter store path'" />
       </div>
     </div>

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/add.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/add.html?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/add.html
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/add.html
Mon Aug 11 16:55:15 2014
@@ -19,15 +19,13 @@
 
 <div>
     <div class="clear">
-        <div class="formLabel-labelCell tableContainer-labelCell">Message store path*:</div>
+        <div class="formLabel-labelCell tableContainer-labelCell">Message store path:</div>
         <div class="formLabel-controlCell tableContainer-valueCell">
             <input type="text" id="addVirtualHost.storePath"
                    data-dojo-type="dijit/form/ValidationTextBox"
                    data-dojo-props="
                               name: 'storePath',
                               placeHolder: 'path/to/store',
-                              required: true,
-                              missingMessage: 'Store path must be supplied',
                               title: 'Enter message store path'" />
         </div>
     </div>

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/edit.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/edit.html?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/edit.html
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/edit.html
Mon Aug 11 16:55:15 2014
@@ -20,15 +20,13 @@
 <div>
 
     <div class="clear">
-        <div class="formLabel-labelCell tableContainer-labelCell">Message store path*:</div>
+        <div class="formLabel-labelCell tableContainer-labelCell">Message store path:</div>
         <div class="formLabel-controlCell tableContainer-valueCell">
             <input type="text" id="editVirtualHost.storePath"
                    data-dojo-type="dijit/form/ValidationTextBox"
                    data-dojo-props="
                               name: 'storePath',
                               placeHolder: 'path/to/store',
-                              required: true,
-                              missingMessage: 'Store path must be supplied',
                               disabled: true,
                               title: 'Enter message store path'" />
         </div>

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhostnode/filebased/edit.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhostnode/filebased/edit.html?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhostnode/filebased/edit.html
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhostnode/filebased/edit.html
Mon Aug 11 16:55:15 2014
@@ -20,15 +20,13 @@
 <div>
 
     <div class="clear">
-        <div class="formLabel-labelCell tableContainer-labelCell">Configuration store
path*:</div>
+        <div class="formLabel-labelCell tableContainer-labelCell">Configuration store
path:</div>
         <div class="formLabel-controlCell tableContainer-valueCell">
             <input type="text" id="editVirtualHostNode.storePath"
                    data-dojo-type="dijit/form/ValidationTextBox"
                    data-dojo-props="
                               name: 'storePath',
                               placeHolder: 'path/to/store',
-                              required: true,
-                              missingMessage: 'Store path must be supplied',
                               title: 'Enter configuration store path'" />
         </div>
     </div>

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhostnode/json/add.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhostnode/json/add.html?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhostnode/json/add.html
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhostnode/json/add.html
Mon Aug 11 16:55:15 2014
@@ -20,15 +20,13 @@
  -->
 <div>
     <div class="clear">
-      <div class="formLabel-labelCell tableContainer-labelCell">Store path*:</div>
+      <div class="formLabel-labelCell tableContainer-labelCell">Store path:</div>
       <div class="formLabel-controlCell tableContainer-valueCell">
           <input type="text" id="addVirtualHostNode.jsonStorePath"
                           data-dojo-type="dijit/form/ValidationTextBox"
                           data-dojo-props="
                               name: 'storePath',
                               placeHolder: 'path/to/store',
-                              required: true,
-                              missingMessage: 'Store path must be supplied',
                               title: 'Enter store path'" />
       </div>
     </div>

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostNodeRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostNodeRestTest.java?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostNodeRestTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostNodeRestTest.java
Mon Aug 11 16:55:15 2014
@@ -55,14 +55,33 @@ public class VirtualHostNodeRestTest  ex
 
     public void testCreateAndDeleteVirtualHostNode() throws Exception
     {
-        String storeType = getTestProfileVirtualHostNodeType();
+        String virtualhostNodeType = getTestProfileVirtualHostNodeType();
         String nodeName = "virtualhostnode-" + getTestName();
         File storePathAsFile = new File(getStoreLocation(nodeName));
 
-        createAndDeleteVirtualHostNode(storeType, nodeName, storePathAsFile);
+        createAndDeleteVirtualHostNode(virtualhostNodeType, nodeName, storePathAsFile);
         assertFalse("Store should not exist after deletion", storePathAsFile.exists());
     }
 
+    public void testCreateVirtualHostNodeWithDefaultStorePath() throws Exception
+    {
+        String virtualhostNodeType = getTestProfileVirtualHostNodeType();
+        String nodeName = "virtualhostnode-" + getTestName();
+
+        createVirtualHostNode(nodeName, virtualhostNodeType);
+
+        String restUrl = "virtualhostnode/" + nodeName;
+        Map<String, Object> virtualhostNode = getRestTestHelper().getJsonAsSingletonList(restUrl);
+        Asserts.assertVirtualHostNode(nodeName, virtualhostNode);
+        assertNull("Virtualhostnode should not automatically get a virtualhost child",
+                   virtualhostNode.get("virtualhosts"));
+
+        getRestTestHelper().submitRequest(restUrl, "DELETE", HttpServletResponse.SC_OK);
+
+        List<Map<String, Object>> virtualHostNodes = getRestTestHelper().getJsonAsList(restUrl);
+        assertEquals("Host should be deleted", 0, virtualHostNodes.size());
+    }
+
     public void testRecoverVirtualHostNodeWithDesiredStateStopped() throws Exception
     {
         stopBroker();
@@ -149,7 +168,10 @@ public class VirtualHostNodeRestTest  ex
         Map<String, Object> nodeData = new HashMap<String, Object>();
         nodeData.put(VirtualHostNode.NAME, nodeName);
         nodeData.put(VirtualHostNode.TYPE, storeType);
-        nodeData.put(JsonVirtualHostNode.STORE_PATH, configStorePath);
+        if (configStorePath != null)
+        {
+            nodeData.put(JsonVirtualHostNode.STORE_PATH, configStorePath);
+        }
 
         getRestTestHelper().submitRequest("virtualhostnode/" + nodeName,
                                           "PUT",
@@ -157,6 +179,11 @@ public class VirtualHostNodeRestTest  ex
                                           HttpServletResponse.SC_CREATED);
     }
 
+    private void createVirtualHostNode(String nodeName, final String storeType) throws Exception
+    {
+        createVirtualHostNode(nodeName, null, storeType);
+    }
+
     private String getStoreLocation(String hostName)
     {
         return new File(TMP_FOLDER, "store-" + hostName + "-" + System.currentTimeMillis()).getAbsolutePath();

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=1617325&r1=1617324&r2=1617325&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
Mon Aug 11 16:55:15 2014
@@ -20,7 +20,6 @@
  */
 package org.apache.qpid.systest.rest;
 
-import java.io.File;
 import java.io.IOException;
 import java.util.Collections;
 import java.util.HashMap;
@@ -33,18 +32,18 @@ import javax.jms.Session;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.qpid.server.virtualhost.ProvidedStoreVirtualHostImpl;
-import org.apache.qpid.server.virtualhostnode.JsonVirtualHostNode;
 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.model.VirtualHostNode;
 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.AbstractVirtualHost;
 
-import org.apache.qpid.util.FileUtils;
+import org.apache.qpid.server.virtualhost.derby.DerbyVirtualHostImpl;
+import org.apache.qpid.server.virtualhostnode.JsonVirtualHostNodeImpl;
+import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
 public class VirtualHostRestTest extends QpidRestTestCase
 {
@@ -52,8 +51,19 @@ public class VirtualHostRestTest extends
     public static final String VIRTUALHOST_QUEUES_ATTRIBUTE = "queues";
     public static final String VIRTUALHOST_CONNECTIONS_ATTRIBUTE = "connections";
 
+    public static final String EMPTY_VIRTUALHOSTNODE_NAME = "emptyVHN";
+
     private AMQConnection _connection;
 
+    @Override
+    protected void customizeConfiguration() throws IOException
+    {
+        super.customizeConfiguration();
+
+        TestBrokerConfiguration config = getBrokerConfiguration();
+        createTestVirtualHostNode(0, EMPTY_VIRTUALHOSTNODE_NAME, false);
+    }
+
     public void testGet() throws Exception
     {
         List<Map<String, Object>> hosts = getRestTestHelper().getJsonAsList("virtualhost");
@@ -106,27 +116,30 @@ public class VirtualHostRestTest extends
         Asserts.assertConnection(connections.get(0), _connection);
     }
 
-    public void testPutCreateVirtualHostUsingProfileNodeType() throws Exception
+    public void testPutCreateProvidedVirtualHost() throws Exception
     {
         String hostName = getTestName();
-        String virtualhostNodeType = getTestProfileVirtualHostNodeType();
-        String storeLocation = createVirtualHostNodeAndVirtualHost(hostName, virtualhostNodeType);
-        try
-        {
-            // make sure that the host is saved in the broker store
-            restartBroker();
-            Map<String, Object> hostDetails = getRestTestHelper().getJsonAsSingletonList("virtualhost/"
+ hostName);
-            Asserts.assertVirtualHost(hostName, hostDetails);
+        createVirtualHost(hostName, ProvidedStoreVirtualHostImpl.VIRTUAL_HOST_TYPE);
 
-            assertNewVirtualHost(hostDetails);
-        }
-        finally
+        Map<String, Object> hostDetails = getRestTestHelper().getJsonAsSingletonList("virtualhost/"
+ EMPTY_VIRTUALHOSTNODE_NAME + "/" + hostName);
+        Asserts.assertVirtualHost(hostName, hostDetails);
+
+        assertNewVirtualHost(hostDetails);
+    }
+
+    public void testPutCreateVirtualHost() throws Exception
+    {
+        String hostName = getTestName();
+        String vhnType = getTestProfileVirtualHostNodeType();
+        if (JsonVirtualHostNodeImpl.VIRTUAL_HOST_NODE_TYPE.equals(vhnType))
         {
-            if (storeLocation != null)
-            {
-                FileUtils.delete(new File(storeLocation), true);
-            }
+            vhnType = DerbyVirtualHostImpl.VIRTUAL_HOST_TYPE;
         }
+        createVirtualHost(hostName, vhnType);
+        Map<String, Object> hostDetails = getRestTestHelper().getJsonAsSingletonList("virtualhost/"
+ EMPTY_VIRTUALHOSTNODE_NAME + "/" + hostName);
+        Asserts.assertVirtualHost(hostName, hostDetails);
+
+        assertNewVirtualHost(hostDetails);
     }
 
     public void testDeleteHost() throws Exception
@@ -562,34 +575,17 @@ public class VirtualHostRestTest extends
         return getRestTestHelper().submitRequest("queue/test/test/" + queueName, "PUT", queueData);
     }
 
-    private String createVirtualHostNodeAndVirtualHost(String virtualHostName,
-                                                       String virtualHostNodeType) throws
Exception
+    private void createVirtualHost(final String virtualHostName,
+                                   final String virtualHostType) throws IOException
     {
-        String storePath = getStoreLocation(virtualHostName);
-
-        Map<String, Object> nodeData = new HashMap<>();
-        nodeData.put(VirtualHostNode.NAME, virtualHostName);
-        nodeData.put(VirtualHostNode.TYPE, virtualHostNodeType);
-        nodeData.put(JsonVirtualHostNode.STORE_PATH, storePath);
-
-        getRestTestHelper().submitRequest("virtualhostnode/" + virtualHostName, "PUT", nodeData,
HttpServletResponse.SC_CREATED);
-
         Map<String, Object> virtualhostData = new HashMap<>();
         virtualhostData.put(VirtualHost.NAME, virtualHostName);
-        virtualhostData.put(VirtualHost.TYPE, ProvidedStoreVirtualHostImpl.VIRTUAL_HOST_TYPE);
+        virtualhostData.put(VirtualHost.TYPE, virtualHostType);
 
-        getRestTestHelper().submitRequest("virtualhost/" + virtualHostName + "/" + virtualHostName,
+        getRestTestHelper().submitRequest("virtualhost/" + EMPTY_VIRTUALHOSTNODE_NAME + "/"
+ virtualHostName,
                                           "PUT",
                                           virtualhostData,
                                           HttpServletResponse.SC_CREATED);
-
-
-        return storePath;
-    }
-
-    private String getStoreLocation(String hostName)
-    {
-        return new File(TMP_FOLDER, "store-" + hostName + "-" + System.currentTimeMillis()).getAbsolutePath();
     }
 
     private void assertNewVirtualHost(Map<String, Object> hostDetails)

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=1617325&r1=1617324&r2=1617325&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
Mon Aug 11 16:55:15 2014
@@ -848,7 +848,7 @@ public class QpidBrokerTestCase extends 
      * @param brokerPort broker port
      * @param virtualHostNodeName virtual host node name
      */
-    protected void createTestVirtualHostNode(int brokerPort, String virtualHostNodeName)
+    protected void createTestVirtualHostNode(int brokerPort, String virtualHostNodeName,
boolean withBlueprint)
     {
         String storeType = getTestProfileVirtualHostNodeType();
         String storeDir = null;
@@ -871,15 +871,24 @@ public class QpidBrokerTestCase extends 
             attributes.put(JsonVirtualHostNode.STORE_PATH, storeDir);
         }
 
-        final String blueprint = getTestProfileVirtualHostNodeBlueprint();
+        if (withBlueprint)
+        {
+            final String blueprint = getTestProfileVirtualHostNodeBlueprint();
 
-        attributes.put(ConfiguredObject.CONTEXT, Collections.singletonMap(AbstractVirtualHostNode.VIRTUALHOST_BLUEPRINT_CONTEXT_VAR,
-                                                                          blueprint));
+            attributes.put(ConfiguredObject.CONTEXT,
+                           Collections.singletonMap(AbstractVirtualHostNode.VIRTUALHOST_BLUEPRINT_CONTEXT_VAR,
+                                                    blueprint));
+        }
 
         int port = getPort(brokerPort);
         getBrokerConfiguration(port).addObjectConfiguration(VirtualHostNode.class, attributes);
     }
 
+    protected void createTestVirtualHostNode(int brokerPort, String virtualHostNodeName)
+    {
+        createTestVirtualHostNode(brokerPort, virtualHostNodeName, true);
+    }
+
     /**
      * Set a System property that is to be applied only to the external test
      * broker.

Modified: qpid/trunk/qpid/java/test-profiles/JavaJsonExcludes
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/JavaJsonExcludes?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/JavaJsonExcludes (original)
+++ qpid/trunk/qpid/java/test-profiles/JavaJsonExcludes Mon Aug 11 16:55:15 2014
@@ -22,5 +22,5 @@ org.apache.qpid.server.store.berkeleydb.
 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#testPutCreateVirtualHostUsingProfileNodeType
+org.apache.qpid.systest.rest.VirtualHostRestTest#testPutCreateProvidedVirtualHost
 org.apache.qpid.server.BrokerStartupTest#testStartupWithNoConfig

Modified: qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes?rev=1617325&r1=1617324&r2=1617325&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes (original)
+++ qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes Mon Aug 11 16:55:15 2014
@@ -55,7 +55,6 @@ org.apache.qpid.systest.management.jmx.Q
 
 org.apache.qpid.test.unit.client.MaxDeliveryCountTest#testWhenBrokerIsRestartedAfterEnqeuingMessages
 
-org.apache.qpid.systest.rest.VirtualHostRestTest#testPutCreateVirtualHostUsingProfileNodeType
 org.apache.qpid.systest.rest.VirtualHostRestTest#testRecoverVirtualHostInDesiredStateStoppedWithDescription
 org.apache.qpid.systest.rest.VirtualHostRestTest#testMutateStateOfVirtualHostWithQueuesAndMessages
 



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


Mime
View raw message