qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r1467940 - in /qpid/trunk/qpid/java: broker/src/main/java/org/apache/qpid/server/configuration/store/ systests/src/main/java/org/apache/qpid/server/queue/ systests/src/main/java/org/apache/qpid/server/security/acl/ systests/src/main/java/or...
Date Mon, 15 Apr 2013 11:29:06 GMT
Author: robbie
Date: Mon Apr 15 11:29:05 2013
New Revision: 1467940

URL: http://svn.apache.org/r1467940
Log:
QPID-4390, QPID-4743: generate ID's randomly at startup, for the broker and direct children
in the configuration file

makes ID generation behaviour consistent with that for objects added via the management interface

Modified:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ModelTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/BrokerManagementTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/ConnectionManagementTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/LoggingManagementTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/ManagementActorLoggingTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/ManagementLoggingTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/QueueManagementTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/StatisticsTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/UserManagementTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QpidRestTestCase.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/message/JMSDestinationTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/DynamicQueueExchangeCreateTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/JMXTestUtils.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java
Mon Apr 15 11:29:05 2013
@@ -557,14 +557,7 @@ public class MemoryConfigurationEntrySto
         UUID id = null;
         if (idAsString == null)
         {
-            if (expectedConfiguredObjectClass == Broker.class)
-            {
-                id = UUIDGenerator.generateRandomUUID();
-            }
-            else
-            {
-                id = UUIDGenerator.generateBrokerChildUUID(type, name);
-            }
+            id = UUIDGenerator.generateRandomUUID();
 
             _generatedObjectIdDuringLoad = true;
         }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ModelTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ModelTest.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ModelTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ModelTest.java
Mon Apr 15 11:29:05 2013
@@ -65,9 +65,10 @@ public class ModelTest extends QpidBroke
     @Override
     public void setUp() throws Exception
     {
+        getBrokerConfiguration().addJmxManagementConfiguration();
+
         // Create a JMX Helper
         _jmxUtils = new JMXTestUtils(this);
-        _jmxUtils.setUp();
         super.setUp();
 
         // Open the JMX Connection

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java
Mon Apr 15 11:29:05 2013
@@ -64,8 +64,9 @@ public class ProducerFlowControlTest ext
 
     public void setUp() throws Exception
     {
+        getBrokerConfiguration().addJmxManagementConfiguration();
+
         _jmxUtils = new JMXTestUtils(this);
-        _jmxUtils.setUp();
         _jmxUtilConnected=false;
         super.setUp();
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java
Mon Apr 15 11:29:05 2013
@@ -21,6 +21,7 @@ package org.apache.qpid.server.security.
 import org.apache.qpid.management.common.mbeans.ServerInformation;
 import org.apache.qpid.server.security.access.ObjectType;
 import org.apache.qpid.test.utils.JMXTestUtils;
+import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
 import java.lang.management.ManagementFactory;
 import java.lang.management.RuntimeMXBean;
@@ -43,11 +44,15 @@ public class ExternalACLJMXTest extends 
     @Override
     public void setUp() throws Exception
     {
+        //remove the normal 'test' vhost, we will configure the vhosts below
+        getBrokerConfiguration(0).removeObjectConfiguration(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST);
+
         createTestVirtualHost(0, TEST_VHOST);
         createTestVirtualHost(0, TEST2_VHOST);
 
+        getBrokerConfiguration().addJmxManagementConfiguration();
+
         _jmx = new JMXTestUtils(this);
-        _jmx.setUp();
         super.setUp();
         _jmx.open();
     }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java
Mon Apr 15 11:29:05 2013
@@ -265,10 +265,10 @@ public class ExternalAuthenticationTest 
     public void testExternalAuthenticationManagerUsernameAsCN() throws Exception
     {
         JMXTestUtils jmxUtils = new JMXTestUtils(this);
-        jmxUtils.setUp();
 
         setCommonBrokerSSLProperties(true);
         getBrokerConfiguration().setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_SSL_PORT,
Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER);
+        getBrokerConfiguration().addJmxManagementConfiguration();
 
         super.setUp();
 
@@ -299,11 +299,11 @@ public class ExternalAuthenticationTest 
     public void testExternalAuthenticationManagerUsernameAsDN() throws Exception
     {
         JMXTestUtils jmxUtils = new JMXTestUtils(this);
-        jmxUtils.setUp();
 
         setCommonBrokerSSLProperties(true);
         getBrokerConfiguration().setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_SSL_PORT,
Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER);
         getBrokerConfiguration().setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER,
ExternalAuthenticationManagerFactory.ATTRIBUTE_USE_FULL_DN, "true");
+        getBrokerConfiguration().addJmxManagementConfiguration();
 
         super.setUp();
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/BrokerManagementTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/BrokerManagementTest.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/BrokerManagementTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/BrokerManagementTest.java
Mon Apr 15 11:29:05 2013
@@ -40,8 +40,10 @@ public class BrokerManagementTest extend
 
     public void setUp() throws Exception
     {
+        getBrokerConfiguration().addJmxManagementConfiguration();
+
         _jmxUtils = new JMXTestUtils(this);
-        _jmxUtils.setUp();
+
         super.setUp();
         _jmxUtils.open();
         _managedBroker = _jmxUtils.getManagedBroker(VIRTUAL_HOST);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/ConnectionManagementTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/ConnectionManagementTest.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/ConnectionManagementTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/ConnectionManagementTest.java
Mon Apr 15 11:29:05 2013
@@ -51,8 +51,10 @@ public class ConnectionManagementTest ex
 
     public void setUp() throws Exception
     {
+        getBrokerConfiguration().addJmxManagementConfiguration();
+
         _jmxUtils = new JMXTestUtils(this);
-        _jmxUtils.setUp(); // modifies broker config therefore must be done before super.setUp()
+
         super.setUp();
         _jmxUtils.open();
     }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/LoggingManagementTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/LoggingManagementTest.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/LoggingManagementTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/LoggingManagementTest.java
Mon Apr 15 11:29:05 2013
@@ -47,8 +47,9 @@ public class LoggingManagementTest exten
 
     public void setUp() throws Exception
     {
+        getBrokerConfiguration().addJmxManagementConfiguration();
+
         _jmxUtils = new JMXTestUtils(this);
-        _jmxUtils.setUp();
 
         // System test normally run with log for4j test config from beneath test-profiles.
  We need to
         // copy it as some of our tests write to this file.

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/ManagementActorLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/ManagementActorLoggingTest.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/ManagementActorLoggingTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/ManagementActorLoggingTest.java
Mon Apr 15 11:29:05 2013
@@ -49,8 +49,10 @@ public class ManagementActorLoggingTest 
     @Override
     public void setUp() throws Exception
     {
+        getBrokerConfiguration().addJmxManagementConfiguration();
+
         _jmxUtils = new JMXTestUtils(this);
-        _jmxUtils.setUp();
+
         super.setUp();
         _jmxUtils.open();
     }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/ManagementLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/ManagementLoggingTest.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/ManagementLoggingTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/ManagementLoggingTest.java
Mon Apr 15 11:29:05 2013
@@ -277,7 +277,6 @@ public class ManagementLoggingTest exten
             List<String> closeResults = null;
             try
             {
-                jmxUtils.setUp();
                 jmxUtils.open();
                 openResults = waitAndFindMatches("MNG-1007");
             }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/QueueManagementTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/QueueManagementTest.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/QueueManagementTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/QueueManagementTest.java
Mon Apr 15 11:29:05 2013
@@ -87,8 +87,9 @@ public class QueueManagementTest extends
 
     public void setUp() throws Exception
     {
+        getBrokerConfiguration().addJmxManagementConfiguration();
+
         _jmxUtils = new JMXTestUtils(this);
-        _jmxUtils.setUp();
 
         super.setUp();
         _sourceQueueName = getTestQueueName() + "_src";

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/StatisticsTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/StatisticsTest.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/StatisticsTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/StatisticsTest.java
Mon Apr 15 11:29:05 2013
@@ -56,8 +56,9 @@ public class StatisticsTest extends Qpid
         createTestVirtualHost(0, TEST_VIRTUALHOST1);
         createTestVirtualHost(0, TEST_VIRTUALHOST2);
 
+        getBrokerConfiguration().addJmxManagementConfiguration();
+
         _jmxUtils = new JMXTestUtils(this, TEST_USER, TEST_PASSWORD);
-        _jmxUtils.setUp();
 
         super.setUp();
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/UserManagementTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/UserManagementTest.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/UserManagementTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/UserManagementTest.java
Mon Apr 15 11:29:05 2013
@@ -65,9 +65,9 @@ public class UserManagementTest extends 
         newAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE, getAuthenticationManagerType());
         newAttributes.put(AbstractPrincipalDatabaseAuthManagerFactory.ATTRIBUTE_PATH, _passwordFile.getAbsolutePath());
         getBrokerConfiguration().setObjectAttributes(TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER,
newAttributes);
+        getBrokerConfiguration().addJmxManagementConfiguration();
 
         _jmxUtils = new JMXTestUtils(this);
-        _jmxUtils.setUp();
 
         super.setUp();
         _jmxUtils.open();

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
Mon Apr 15 11:29:05 2013
@@ -36,7 +36,6 @@ import org.apache.qpid.server.model.Stat
 import org.apache.qpid.server.model.VirtualHost;
 import org.apache.qpid.test.utils.QpidTestCase;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
-import org.apache.qpid.test.utils.TestSSLConstants;
 
 public class BrokerRestTest extends QpidRestTestCase
 {

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QpidRestTestCase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QpidRestTestCase.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QpidRestTestCase.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QpidRestTestCase.java
Mon Apr 15 11:29:05 2013
@@ -50,10 +50,14 @@ public class QpidRestTestCase extends Qp
         // use webadmin account to perform tests
         getRestTestHelper().setUsernameAndPassword("webadmin", "webadmin");
 
+        //remove the normal 'test' vhost, we will configure the vhosts below
+        getBrokerConfiguration(0).removeObjectConfiguration(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST);
+
         // Set up virtualhost config with queues and bindings to the amq.direct
         for (String virtualhost : EXPECTED_VIRTUALHOSTS)
         {
             createTestVirtualHost(0, virtualhost);
+
             for (String queue : EXPECTED_QUEUES)
             {
                 setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + virtualhost
+ ".queues.exchange", "amq.direct");

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/message/JMSDestinationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/message/JMSDestinationTest.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/message/JMSDestinationTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/message/JMSDestinationTest.java
Mon Apr 15 11:29:05 2013
@@ -142,7 +142,7 @@ public class JMSDestinationTest extends 
     {
         // Setup JMXUtils
         JMXTestUtils jmxUtils = new JMXTestUtils(this);
-        jmxUtils.setUp();
+
         // Open the JMX Connection
         jmxUtils.open();
         try

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/DynamicQueueExchangeCreateTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/DynamicQueueExchangeCreateTest.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/DynamicQueueExchangeCreateTest.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/DynamicQueueExchangeCreateTest.java
Mon Apr 15 11:29:05 2013
@@ -42,8 +42,9 @@ public class DynamicQueueExchangeCreateT
     @Override
     public void setUp() throws Exception
     {
+        getBrokerConfiguration().addJmxManagementConfiguration();
+
         _jmxUtils = new JMXTestUtils(this);
-        _jmxUtils.setUp();
 
         super.setUp();
         _jmxUtils.open();

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/JMXTestUtils.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/JMXTestUtils.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/JMXTestUtils.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/JMXTestUtils.java
Mon Apr 15 11:29:05 2013
@@ -21,7 +21,6 @@
 package org.apache.qpid.test.utils;
 
 import junit.framework.TestCase;
-import org.apache.commons.configuration.ConfigurationException;
 
 import org.apache.qpid.management.common.JMXConnnectionFactory;
 import org.apache.qpid.management.common.mbeans.LoggingManagement;
@@ -75,11 +74,6 @@ public class JMXTestUtils
         this(test, DEFAULT_USERID, DEFAULT_PASSWORD);
     }
 
-    public void setUp() throws IOException, ConfigurationException, Exception
-    {
-        _test.getBrokerConfiguration().addJmxManagementConfiguration();
-    }
-
     public void open() throws Exception
     {
         open(0);  // Zero signifies default broker to QBTC.

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=1467940&r1=1467939&r2=1467940&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 Apr 15 11:29:05 2013
@@ -849,7 +849,7 @@ public class QpidBrokerTestCase extends 
         attributes.put(VirtualHost.NAME, virtualHostName);
         attributes.put(VirtualHost.CONFIG_PATH,  System.getProperty("broker.virtualhosts-config"));
         int port = getPort(brokerPort);
-        getBrokerConfiguration(port).addHostConfiguration(attributes);
+        getBrokerConfiguration(port).addVirtualHostConfiguration(attributes);
     }
 
     /**

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java?rev=1467940&r1=1467939&r2=1467940&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java
Mon Apr 15 11:29:05 2013
@@ -21,6 +21,7 @@
 package org.apache.qpid.test.utils;
 
 import java.io.File;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -29,6 +30,7 @@ import java.util.Set;
 import java.util.UUID;
 
 import org.apache.qpid.server.configuration.ConfigurationEntry;
+import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.configuration.store.MemoryConfigurationEntryStore;
 import org.apache.qpid.server.model.AuthenticationProvider;
 import org.apache.qpid.server.model.KeyStore;
@@ -109,7 +111,7 @@ public class TestBrokerConfiguration
 
     public UUID addObjectConfiguration(String name, String type, Map<String, Object>
attributes)
     {
-        UUID id = UUIDGenerator.generateBrokerChildUUID(type, name);
+        UUID id = UUIDGenerator.generateRandomUUID();
         addObjectConfiguration(id, type, attributes);
         return id;
     }
@@ -136,7 +138,7 @@ public class TestBrokerConfiguration
         return addObjectConfiguration(name, Port.class.getSimpleName(), attributes);
     }
 
-    public UUID addHostConfiguration(Map<String, Object> attributes)
+    public UUID addVirtualHostConfiguration(Map<String, Object> attributes)
     {
         String name = (String) attributes.get(VirtualHost.NAME);
         return addObjectConfiguration(name, VirtualHost.class.getSimpleName(), attributes);
@@ -204,6 +206,11 @@ public class TestBrokerConfiguration
     {
         ConfigurationEntry entry = new ConfigurationEntry(id, type, attributes, Collections.<UUID>
emptySet(), _store);
         ConfigurationEntry root = _store.getRootEntry();
+
+        Map<String, Collection<ConfigurationEntry>> children = root.getChildren();
+
+        verifyChildWithNameDoesNotExist(id, type, attributes, children);
+
         Set<UUID> childrenIds = new HashSet<UUID>(root.getChildrenIds());
         childrenIds.add(id);
         ConfigurationEntry newRoot = new ConfigurationEntry(root.getId(), root.getType(),
root.getAttributes(), childrenIds,
@@ -211,6 +218,26 @@ public class TestBrokerConfiguration
         _store.save(newRoot, entry);
     }
 
+    private void verifyChildWithNameDoesNotExist(UUID id, String type,
+            Map<String, Object> attributes,
+            Map<String, Collection<ConfigurationEntry>> children)
+    {
+        Collection<ConfigurationEntry> childrenOfType = children.get(type);
+
+        if(childrenOfType != null)
+        {
+            String name = (String) attributes.get("name");
+            for(ConfigurationEntry ce : childrenOfType)
+            {
+                Object ceName = ce.getAttributes().get("name");
+                if(name.equals(ceName) && !id.equals(ce.getId()))
+                {
+                    throw new IllegalConfigurationException("A " + type + " with name " +
name + " already exists with a different ID");
+                }
+            }
+        }
+    }
+
     private boolean setObjectAttribute(ConfigurationEntry entry, String attributeName, Object
value)
     {
         Map<String, Object> attributes = new HashMap<String, Object>(entry.getAttributes());



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


Mime
View raw message