qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r1143869 - in /qpid/trunk/qpid/java: broker-plugins/experimental/info/src/main/java/org/apache/qpid/info/ broker-plugins/firewall/src/test/java/org/apache/qpid/server/security/access/ broker/src/main/java/org/apache/qpid/server/ broker/src/...
Date Thu, 07 Jul 2011 15:11:41 GMT
Author: robbie
Date: Thu Jul  7 15:11:41 2011
New Revision: 1143869

URL: http://svn.apache.org/viewvc?rev=1143869&view=rev
Log:
QPID-3026: remove incomplete support for multiple ApplicationRegistry instances to be active at one time

Applied patch by Keith Wall and myself

Modified:
    qpid/trunk/qpid/java/broker-plugins/experimental/info/src/main/java/org/apache/qpid/info/Activator.java
    qpid/trunk/qpid/java/broker-plugins/firewall/src/test/java/org/apache/qpid/server/security/access/FirewallConfigurationTest.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/plugins/ConfigurationPlugin.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolEngineFactory.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactory.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/MessageStoreTool.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureInVM.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/InVMBrokerDecorator.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/Acknowledge2ConsumersTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
    qpid/trunk/qpid/java/test-profiles/JavaInVMExcludes

Modified: qpid/trunk/qpid/java/broker-plugins/experimental/info/src/main/java/org/apache/qpid/info/Activator.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/experimental/info/src/main/java/org/apache/qpid/info/Activator.java?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/experimental/info/src/main/java/org/apache/qpid/info/Activator.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/experimental/info/src/main/java/org/apache/qpid/info/Activator.java Thu Jul  7 15:11:41 2011
@@ -59,7 +59,14 @@ public class Activator implements Bundle
             _ctx = ctx;
             _service = new InfoServiceImpl();
             ctx.registerService(InfoService.class.getName(), _service, null);
-            sendInfo("STARTUP");
+
+            new Thread(new Runnable()
+            {
+                public void run()
+                {
+                    sendInfo("STARTUP");
+                }
+            }).start();
         }
     }
 

Modified: qpid/trunk/qpid/java/broker-plugins/firewall/src/test/java/org/apache/qpid/server/security/access/FirewallConfigurationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/firewall/src/test/java/org/apache/qpid/server/security/access/FirewallConfigurationTest.java?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/firewall/src/test/java/org/apache/qpid/server/security/access/FirewallConfigurationTest.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/firewall/src/test/java/org/apache/qpid/server/security/access/FirewallConfigurationTest.java Thu Jul  7 15:11:41 2011
@@ -28,11 +28,11 @@ import java.net.InetSocketAddress;
 
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
-import org.apache.qpid.server.util.InternalBrokerBaseCase;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
+import org.apache.qpid.test.utils.QpidTestCase;
 
-public class FirewallConfigurationTest extends InternalBrokerBaseCase
+public class FirewallConfigurationTest extends QpidTestCase
 {
     public void testFirewallConfiguration() throws Exception
     {
@@ -45,7 +45,7 @@ public class FirewallConfigurationTest e
         ApplicationRegistry reg = new ConfigurationFileApplicationRegistry(mainFile);
         try
         {
-            ApplicationRegistry.initialise(reg, 1);
+            ApplicationRegistry.initialise(reg);
 
             // Test config
             assertFalse(reg.getSecurityManager().accessVirtualhost("test", new InetSocketAddress("127.0.0.1", 65535)));
@@ -53,7 +53,7 @@ public class FirewallConfigurationTest e
         }
         finally
         {
-            ApplicationRegistry.remove(1);
+            ApplicationRegistry.remove();
         }
     }
 
@@ -114,14 +114,14 @@ public class FirewallConfigurationTest e
         ApplicationRegistry reg = new ConfigurationFileApplicationRegistry(mainFile);
         try
         {
-            ApplicationRegistry.initialise(reg, 1);
+            ApplicationRegistry.initialise(reg);
 
             // Test config
             assertFalse(reg.getSecurityManager().accessVirtualhost("test", new InetSocketAddress("127.0.0.1", 65535)));
         }
         finally
         {
-            ApplicationRegistry.remove(1);
+            ApplicationRegistry.remove();
         }
     }
 
@@ -137,7 +137,7 @@ public class FirewallConfigurationTest e
         ApplicationRegistry reg = new ConfigurationFileApplicationRegistry(mainFile);
         try
         {
-            ApplicationRegistry.initialise(reg, 1);
+            ApplicationRegistry.initialise(reg);
 
             // Test config
             assertFalse(reg.getSecurityManager().accessVirtualhost("test", new InetSocketAddress("127.0.0.1", 65535)));
@@ -151,7 +151,7 @@ public class FirewallConfigurationTest e
         }
         finally
         {
-            ApplicationRegistry.remove(1);
+            ApplicationRegistry.remove();
         }
     }
 
@@ -211,7 +211,7 @@ public class FirewallConfigurationTest e
         ApplicationRegistry reg = new ConfigurationFileApplicationRegistry(mainFile);
         try
         {
-            ApplicationRegistry.initialise(reg, 1);
+            ApplicationRegistry.initialise(reg);
 
             // Test config
             assertFalse(reg.getSecurityManager().accessVirtualhost("test", new InetSocketAddress("127.0.0.1", 65535)));
@@ -248,7 +248,7 @@ public class FirewallConfigurationTest e
         }
         finally
         {
-            ApplicationRegistry.remove(1);
+            ApplicationRegistry.remove();
         }
     }
 
@@ -334,7 +334,7 @@ public class FirewallConfigurationTest e
 
         // Load config
         ApplicationRegistry reg = new ConfigurationFileApplicationRegistry(mainFile);
-        ApplicationRegistry.initialise(reg, 1);
+        ApplicationRegistry.initialise(reg);
 
         // Test config
         VirtualHostRegistry virtualHostRegistry = reg.getVirtualHostRegistry();

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java Thu Jul  7 15:11:41 2011
@@ -255,7 +255,7 @@ public class Main
 
     protected void shutdown(int status)
     {
-        ApplicationRegistry.removeAll();
+        ApplicationRegistry.remove();
         System.exit(status);
     }
 

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/plugins/ConfigurationPlugin.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/plugins/ConfigurationPlugin.java?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/plugins/ConfigurationPlugin.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/plugins/ConfigurationPlugin.java Thu Jul  7 15:11:41 2011
@@ -24,6 +24,7 @@ import org.apache.commons.configuration.
 import org.apache.log4j.Logger;
 import org.apache.qpid.server.configuration.ConfigurationManager;
 import org.apache.qpid.server.registry.ApplicationRegistry;
+import org.apache.qpid.server.registry.IApplicationRegistry;
 
 import java.util.Collections;
 import java.util.HashMap;
@@ -138,10 +139,28 @@ public abstract class ConfigurationPlugi
             }
         }
 
+        offerRemainingConfigurationToOtherPlugins(path, configuration, elements);
+
+        validateConfiguration();
+    }
+
+    private void offerRemainingConfigurationToOtherPlugins(String path,
+            Configuration configuration, Set<String> elements) throws ConfigurationException
+    {
+        final IApplicationRegistry appRegistry = safeGetApplicationRegistryInstance();
+
+        if (appRegistry == null)
+        {
+            // We see this happen during shutdown due to asynchronous reconfig using IO threads.
+            // Need to remove the responsibility for offering configuration to other class.
+            _logger.info("Cannot offer remaining config to other plugins, can't find app registry");
+            return;
+        }
+
+        final ConfigurationManager configurationManager = appRegistry.getConfigurationManager();
         // Process the elements in the configuration
         for (String element : elements)
         {
-            ConfigurationManager configurationManager = ApplicationRegistry.getInstance().getConfigurationManager();
             Configuration handled = element.length() == 0 ? configuration : configuration.subset(element);
 
             String configurationElement = element;
@@ -162,8 +181,18 @@ public abstract class ConfigurationPlugi
                 _pluginConfiguration.put(plugin.getClass().getName(), plugin);
             }
         }
+    }
 
-        validateConfiguration();
+    private IApplicationRegistry safeGetApplicationRegistryInstance()
+    {
+        try
+        {
+            return ApplicationRegistry.getInstance();
+        }
+        catch (IllegalStateException ise)
+        {
+            return null;
+        }
     }
 
     /** Helper method to print out list of keys in a {@link Configuration}. */

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java Thu Jul  7 15:11:41 2011
@@ -26,8 +26,9 @@ import javax.management.NotCompliantMBea
 import javax.management.ObjectName;
 import javax.management.StandardMBean;
 
-import org.apache.qpid.AMQException;
+import org.apache.log4j.Logger;
 import org.apache.qpid.server.registry.ApplicationRegistry;
+import org.apache.qpid.server.registry.IApplicationRegistry;
 
 /**
  * Provides implementation of the boilerplate ManagedObject interface. Most managed objects should find it useful
@@ -36,10 +37,14 @@ import org.apache.qpid.server.registry.A
  */
 public abstract class DefaultManagedObject extends StandardMBean implements ManagedObject
 {
+    private static final Logger LOGGER = Logger.getLogger(ApplicationRegistry.class);
+    
     private Class<?> _managementInterface;
 
     private String _typeName;
 
+    private ManagedObjectRegistry _registry;
+
     protected DefaultManagedObject(Class<?> managementInterface, String typeName)
         throws NotCompliantMBeanException
     {
@@ -65,23 +70,26 @@ public abstract class DefaultManagedObje
 
     public void register() throws JMException
     {
-        getManagedObjectRegistry().registerObject(this);
-    }
-
-    protected ManagedObjectRegistry getManagedObjectRegistry()
-    {
-        return ApplicationRegistry.getInstance().getManagedObjectRegistry();
+        _registry = ApplicationRegistry.getInstance().getManagedObjectRegistry();
+        _registry.registerObject(this);
     }
 
-    public void unregister() throws AMQException
+    public void unregister()
     {
         try
         {
-            getManagedObjectRegistry().unregisterObject(this);
+            if(_registry != null)
+            {
+                _registry.unregisterObject(this);
+            }
         }
         catch (JMException e)
         {
-            throw new AMQException("Error unregistering managed object: " + this + ": " + e, e);
+            LOGGER.error("Error unregistering managed object: " + this + ": " + e, e);
+        }
+        finally
+        {
+            _registry = null;
         }
     }
 

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolEngineFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolEngineFactory.java?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolEngineFactory.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolEngineFactory.java Thu Jul  7 15:11:41 2011
@@ -38,7 +38,7 @@ public class AMQProtocolEngineFactory im
     
     public AMQProtocolEngineFactory(Integer port)
     {
-        _vhosts = ApplicationRegistry.getInstance(port).getVirtualHostRegistry();
+        _vhosts = ApplicationRegistry.getInstance().getVirtualHostRegistry();
     }
    
     

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactory.java?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactory.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactory.java Thu Jul  7 15:11:41 2011
@@ -59,7 +59,7 @@ public class MultiVersionProtocolEngineF
 
     public MultiVersionProtocolEngineFactory(int instance, String fqdn, Set<VERSION> supportedVersions)
     {
-        _appRegistry = ApplicationRegistry.getInstance(instance);
+        _appRegistry = ApplicationRegistry.getInstance();
         _fqdn = fqdn;
         _supported = supportedVersions;
     }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java Thu Jul  7 15:11:41 2011
@@ -26,6 +26,7 @@ import java.util.Map;
 import java.util.Timer;
 import java.util.TimerTask;
 import java.util.UUID;
+import java.util.concurrent.atomic.AtomicReference;
 
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.log4j.Logger;
@@ -63,6 +64,7 @@ import org.apache.qpid.server.virtualhos
 import org.apache.qpid.server.virtualhost.VirtualHostImpl;
 import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
 
+
 /**
  * An abstract application registry that provides access to configuration information and handles the
  * construction and caching of configurable objects.
@@ -73,12 +75,10 @@ public abstract class ApplicationRegistr
 {
     protected static final Logger _logger = Logger.getLogger(ApplicationRegistry.class);
 
-    private static Map<Integer, IApplicationRegistry> _instanceMap = new HashMap<Integer, IApplicationRegistry>();
+    private static AtomicReference<IApplicationRegistry> _instance = new AtomicReference<IApplicationRegistry>(null);
 
     protected final ServerConfiguration _configuration;
 
-    public static final int DEFAULT_INSTANCE = 1;
-
     protected final Map<InetSocketAddress, QpidAcceptor> _acceptors = new HashMap<InetSocketAddress, QpidAcceptor>();
 
     protected ManagedObjectRegistry _managedObjectRegistry;
@@ -106,8 +106,6 @@ public abstract class ApplicationRegistr
     private BrokerConfig _broker;
 
     private ConfigStore _configStore;
-
-    protected String _registryName;
     
     private Timer _reportingTimer;
     private boolean _statisticsEnabled = false;
@@ -122,53 +120,54 @@ public abstract class ApplicationRegistr
     {
         public void run()
         {
-            removeAll();
+            remove();
         }
     }
 
     public static void initialise(IApplicationRegistry instance) throws Exception
     {
-        initialise(instance, DEFAULT_INSTANCE);
-    }
+        if(instance == null)
+        {
+            throw new IllegalArgumentException("ApplicationRegistry instance must not be null");
+        }
 
-    @SuppressWarnings("finally")
-    public static void initialise(IApplicationRegistry instance, int instanceID) throws Exception
-    {
-        if (instance != null)
+        if(!_instance.compareAndSet(null, instance))
         {
-            _logger.info("Initialising Application Registry(" + instance + "):" + instanceID);
-            _instanceMap.put(instanceID, instance);
+            throw new IllegalStateException("An ApplicationRegistry is already initialised");
+        }
+
+        _logger.info("Initialising Application Registry(" + instance + ")");
 
-            final ConfigStore store = ConfigStore.newInstance();
-            store.setRoot(new SystemConfigImpl(store));
-            instance.setConfigStore(store);
 
-            BrokerConfig broker = new BrokerConfigAdapter(instance);
+        final ConfigStore store = ConfigStore.newInstance();
+        store.setRoot(new SystemConfigImpl(store));
+        instance.setConfigStore(store);
 
-            SystemConfig system = (SystemConfig) store.getRoot();
-            system.addBroker(broker);
-            instance.setBroker(broker);
+        BrokerConfig broker = new BrokerConfigAdapter(instance);
 
+        SystemConfig system = (SystemConfig) store.getRoot();
+        system.addBroker(broker);
+        instance.setBroker(broker);
+
+        try
+        {
+            instance.initialise();
+        }
+        catch (Exception e)
+        {
+            _instance.set(null);
+
+            //remove the Broker instance, then re-throw
             try
             {
-                instance.initialise(instanceID);
+                system.removeBroker(broker);
             }
-            catch (Exception e)
+            catch(Throwable t)
             {
-                _instanceMap.remove(instanceID);
-                try
-                {
-                    system.removeBroker(broker);
-                }
-                finally
-                {
-                    throw e;
-                }
+                //ignore
             }
-        }
-        else
-        {
-            remove(instanceID);
+
+            throw e;
         }
     }
 
@@ -184,35 +183,19 @@ public abstract class ApplicationRegistr
 
     public static boolean isConfigured()
     {
-        return isConfigured(DEFAULT_INSTANCE);
-    }
-
-    public static boolean isConfigured(int instanceID)
-    {
-        return _instanceMap.containsKey(instanceID);
+        return _instance.get() != null;
     }
 
-    /** Method to cleanly shutdown the default registry running in this JVM */
     public static void remove()
     {
-        remove(DEFAULT_INSTANCE);
-    }
-
-    /**
-     * Method to cleanly shutdown specified registry running in this JVM
-     *
-     * @param instanceID the instance to shutdown
-     */
-    public static void remove(int instanceID)
-    {
+        IApplicationRegistry instance = _instance.getAndSet(null);
         try
         {
-            IApplicationRegistry instance = _instanceMap.get(instanceID);
             if (instance != null)
             {
                 if (_logger.isInfoEnabled())
                 {
-                    _logger.info("Shutting down ApplicationRegistry(" + instanceID + "):" + instance);
+                    _logger.info("Shutting down ApplicationRegistry(" + instance + ")");
                 }
                 instance.close();
                 instance.getBroker().getSystem().removeBroker(instance.getBroker());
@@ -220,21 +203,7 @@ public abstract class ApplicationRegistr
         }
         catch (Exception e)
         {
-            _logger.error("Error shutting down Application Registry(" + instanceID + "): " + e, e);
-        }
-        finally
-        {
-            _instanceMap.remove(instanceID);
-        }
-    }
-
-    /** Method to cleanly shutdown all registries currently running in this JVM */
-    public static void removeAll()
-    {
-        Object[] keys = _instanceMap.keySet().toArray();
-        for (Object k : keys)
-        {
-            remove((Integer) k);
+            _logger.error("Error shutting down Application Registry(" + instance + "): " + e, e);
         }
     }
 
@@ -259,11 +228,10 @@ public abstract class ApplicationRegistr
         _configuration.initialise();
     }
 
-    public void initialise(int instanceID) throws Exception
+    public void initialise() throws Exception
     {
         //Create the RootLogger to be used during broker operation
         _rootMessageLogger = new Log4jMessageLogger(_configuration);
-        _registryName = String.valueOf(instanceID);
 
         //Create the composite (log4j+SystemOut MessageLogger to be used during startup
         RootMessageLogger[] messageLoggers = {new SystemOutMessageLogger(), _rootMessageLogger};
@@ -397,25 +365,21 @@ public abstract class ApplicationRegistr
         }
     }
 
-    public static IApplicationRegistry getInstance()
-    {
-        return getInstance(DEFAULT_INSTANCE);
-    }
-
-    public static IApplicationRegistry getInstance(int instanceID)
+    /**
+     * Get the ApplicationRegistry
+     * @return the IApplicationRegistry instance
+     * @throws IllegalStateException if no registry instance has been initialised.
+     */
+    public static IApplicationRegistry getInstance() throws IllegalStateException
     {
-        synchronized (IApplicationRegistry.class)
+        IApplicationRegistry iApplicationRegistry = _instance.get();
+        if (iApplicationRegistry == null)
         {
-            IApplicationRegistry instance = _instanceMap.get(instanceID);
-
-            if (instance == null)
-            {
-                throw new IllegalStateException("Application Registry (" + instanceID + ") not created");
-            }
-            else
-            {
-                return instance;
-            }
+            throw new IllegalStateException("No ApplicationRegistry has been initialised");
+        }
+        else
+        {
+            return iApplicationRegistry;
         }
     }
 

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java Thu Jul  7 15:11:41 2011
@@ -46,9 +46,8 @@ public interface IApplicationRegistry ex
      * Initialise the application registry. All initialisation must be done in this method so that any components
      * that need access to the application registry itself for initialisation are able to use it. Attempting to
      * initialise in the constructor will lead to failures since the registry reference will not have been set.
-     * @param instanceID the instanceID that we can use to identify this AR.
      */
-    void initialise(int instanceID) throws Exception;
+    void initialise() throws Exception;
 
     /**
      * Shutdown this Registry

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/MessageStoreTool.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/MessageStoreTool.java?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/MessageStoreTool.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/MessageStoreTool.java Thu Jul  7 15:11:41 2011
@@ -192,7 +192,7 @@ public class MessageStoreTool
 
         if (_initialised)
         {
-            ApplicationRegistry.remove(1);
+            ApplicationRegistry.remove();
         }
 
         _console.println("...exiting");
@@ -274,7 +274,7 @@ public class MessageStoreTool
         {
             ConfigurationFileApplicationRegistry registry = new ConfigurationFileApplicationRegistry(configFile);
 
-            ApplicationRegistry.remove(1);
+            ApplicationRegistry.remove();
 
             ApplicationRegistry.initialise(registry);
 

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java Thu Jul  7 15:11:41 2011
@@ -34,86 +34,97 @@ import org.apache.qpid.framing.AMQShortS
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
-import org.apache.qpid.server.util.InternalBrokerBaseCase;
+import org.apache.qpid.server.util.TestApplicationRegistry;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
+import org.apache.qpid.test.utils.QpidTestCase;
 
-public class ServerConfigurationTest extends InternalBrokerBaseCase
+public class ServerConfigurationTest extends QpidTestCase
 {
     private XMLConfiguration _config = new XMLConfiguration();
+    private ServerConfiguration _serverConfig = null;
+
+    @Override
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+        _serverConfig = new ServerConfiguration(_config);
+        ApplicationRegistry.initialise(new TestApplicationRegistry(_serverConfig));
+    }
+
+    @Override
+    protected void tearDown() throws Exception
+    {
+        super.tearDown();
+        ApplicationRegistry.remove();
+    }
+
 
 
     public void testSetJMXManagementPort() throws ConfigurationException
     {
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        serverConfig.setJMXManagementPort(23);
-        assertEquals(23, serverConfig.getJMXManagementPort());
+        _serverConfig.initialise();
+        _serverConfig.setJMXManagementPort(23);
+        assertEquals(23, _serverConfig.getJMXManagementPort());
     }
 
     public void testGetJMXManagementPort() throws ConfigurationException
     {
         _config.setProperty("management.jmxport", 42);
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(42, serverConfig.getJMXManagementPort());
+        _serverConfig.initialise();
+        assertEquals(42, _serverConfig.getJMXManagementPort());
     }
 
     public void testGetPlatformMbeanserver() throws ConfigurationException
     {
-        // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(true, serverConfig.getPlatformMbeanserver());
+        _serverConfig.initialise();
+        assertEquals(true, _serverConfig.getPlatformMbeanserver());
 
         // Check value we set
         _config.setProperty("management.platform-mbeanserver", false);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(false, serverConfig.getPlatformMbeanserver());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(false, _serverConfig.getPlatformMbeanserver());
     }
 
     public void testGetPluginDirectory() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(null, serverConfig.getPluginDirectory());
+        _serverConfig.initialise();
+        assertEquals(null, _serverConfig.getPluginDirectory());
 
         // Check value we set
         _config.setProperty("plugin-directory", "/path/to/plugins");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals("/path/to/plugins", serverConfig.getPluginDirectory());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals("/path/to/plugins", _serverConfig.getPluginDirectory());
     }
 
     public void testGetCacheDirectory() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(null, serverConfig.getCacheDirectory());
+        _serverConfig.initialise();
+        assertEquals(null, _serverConfig.getCacheDirectory());
 
         // Check value we set
         _config.setProperty("cache-directory", "/path/to/cache");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals("/path/to/cache", serverConfig.getCacheDirectory());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals("/path/to/cache", _serverConfig.getCacheDirectory());
     }
 
     public void testGetPrincipalDatabaseNames() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(0, serverConfig.getPrincipalDatabaseNames().size());
+        _serverConfig.initialise();
+        assertEquals(0, _serverConfig.getPrincipalDatabaseNames().size());
 
         // Check value we set
         _config.setProperty("security.principal-databases.principal-database(0).name", "a");
         _config.setProperty("security.principal-databases.principal-database(1).name", "b");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        List<String> dbs = serverConfig.getPrincipalDatabaseNames();
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        List<String> dbs = _serverConfig.getPrincipalDatabaseNames();
         assertEquals(2, dbs.size());
         assertEquals("a", dbs.get(0));
         assertEquals("b", dbs.get(1));
@@ -122,16 +133,15 @@ public class ServerConfigurationTest ext
     public void testGetPrincipalDatabaseClass() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(0, serverConfig.getPrincipalDatabaseClass().size());
+        _serverConfig.initialise();
+        assertEquals(0, _serverConfig.getPrincipalDatabaseClass().size());
 
         // Check value we set
         _config.setProperty("security.principal-databases.principal-database(0).class", "a");
         _config.setProperty("security.principal-databases.principal-database(1).class", "b");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        List<String> dbs = serverConfig.getPrincipalDatabaseClass();
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        List<String> dbs = _serverConfig.getPrincipalDatabaseClass();
         assertEquals(2, dbs.size());
         assertEquals("a", dbs.get(0));
         assertEquals("b", dbs.get(1));
@@ -140,16 +150,15 @@ public class ServerConfigurationTest ext
     public void testGetPrincipalDatabaseAttributeNames() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(0, serverConfig.getPrincipalDatabaseAttributeNames(1).size());
+        _serverConfig.initialise();
+        assertEquals(0, _serverConfig.getPrincipalDatabaseAttributeNames(1).size());
 
         // Check value we set
         _config.setProperty("security.principal-databases.principal-database(0).attributes(0).attribute.name", "a");
         _config.setProperty("security.principal-databases.principal-database(0).attributes(1).attribute.name", "b");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        List<String> dbs = serverConfig.getPrincipalDatabaseAttributeNames(0);
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        List<String> dbs = _serverConfig.getPrincipalDatabaseAttributeNames(0);
         assertEquals(2, dbs.size());
         assertEquals("a", dbs.get(0));
         assertEquals("b", dbs.get(1));
@@ -158,16 +167,15 @@ public class ServerConfigurationTest ext
     public void testGetPrincipalDatabaseAttributeValues() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(0, serverConfig.getPrincipalDatabaseAttributeValues(1).size());
+        _serverConfig.initialise();
+        assertEquals(0, _serverConfig.getPrincipalDatabaseAttributeValues(1).size());
 
         // Check value we set
         _config.setProperty("security.principal-databases.principal-database(0).attributes(0).attribute.value", "a");
         _config.setProperty("security.principal-databases.principal-database(0).attributes(1).attribute.value", "b");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        List<String> dbs = serverConfig.getPrincipalDatabaseAttributeValues(0);
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        List<String> dbs = _serverConfig.getPrincipalDatabaseAttributeValues(0);
         assertEquals(2, dbs.size());
         assertEquals("a", dbs.get(0));
         assertEquals("b", dbs.get(1));
@@ -178,493 +186,460 @@ public class ServerConfigurationTest ext
     public void testGetFrameSize() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(65536, serverConfig.getFrameSize());
+        _serverConfig.initialise();
+        assertEquals(65536, _serverConfig.getFrameSize());
 
         // Check value we set
         _config.setProperty("advanced.framesize", "23");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(23, serverConfig.getFrameSize());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(23, _serverConfig.getFrameSize());
     }
 
     public void testGetStatusEnabled() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
+        _serverConfig.initialise();
         assertEquals(ServerConfiguration.DEFAULT_STATUS_UPDATES.equalsIgnoreCase("on"),
-                     serverConfig.getStatusUpdatesEnabled());
+                     _serverConfig.getStatusUpdatesEnabled());
 
         // Check disabling we set
         _config.setProperty(ServerConfiguration.STATUS_UPDATES, "off");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(false, serverConfig.getStatusUpdatesEnabled());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(false, _serverConfig.getStatusUpdatesEnabled());
 
         // Check invalid values don't cause error but result in disabled
         _config.setProperty(ServerConfiguration.STATUS_UPDATES, "Yes Please");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(false, serverConfig.getStatusUpdatesEnabled());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(false, _serverConfig.getStatusUpdatesEnabled());
 
     }
     public void testGetSynchedClocks() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(false, serverConfig.getSynchedClocks());
+        _serverConfig.initialise();
+        assertEquals(false, _serverConfig.getSynchedClocks());
 
         // Check value we set
         _config.setProperty("advanced.synced-clocks", true);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(true, serverConfig.getSynchedClocks());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(true, _serverConfig.getSynchedClocks());
     }
 
     public void testGetLocale() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
+        _serverConfig.initialise();
 
         // The Default is what ever the VMs default is
         Locale defaultLocale = Locale.getDefault();
 
-        assertEquals(defaultLocale, serverConfig.getLocale());
+        assertEquals(defaultLocale, _serverConfig.getLocale());
 
 
         //Test Language only
         Locale update = new Locale("es");
         _config.setProperty(ServerConfiguration.ADVANCED_LOCALE, "es");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(update, serverConfig.getLocale());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(update, _serverConfig.getLocale());
 
         //Test Language and Country
         update = new Locale("es","ES");
         _config.setProperty(ServerConfiguration.ADVANCED_LOCALE, "es_ES");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(update, serverConfig.getLocale());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(update, _serverConfig.getLocale());
 
         //Test Language and Country and Variant
         update = new Locale("es","ES", "Traditional_WIN");
         _config.setProperty(ServerConfiguration.ADVANCED_LOCALE, "es_ES_Traditional_WIN");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(update, serverConfig.getLocale());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(update, _serverConfig.getLocale());
     }
 
 
     public void testGetMsgAuth() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(false, serverConfig.getMsgAuth());
+        _serverConfig.initialise();
+        assertEquals(false, _serverConfig.getMsgAuth());
 
         // Check value we set
         _config.setProperty("security.msg-auth", true);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(true, serverConfig.getMsgAuth());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(true, _serverConfig.getMsgAuth());
     }
 
     public void testGetManagementKeyStorePath() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(null, serverConfig.getManagementKeyStorePath());
+        _serverConfig.initialise();
+        assertEquals(null, _serverConfig.getManagementKeyStorePath());
 
         // Check value we set
         _config.setProperty("management.ssl.keyStorePath", "a");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals("a", serverConfig.getManagementKeyStorePath());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals("a", _serverConfig.getManagementKeyStorePath());
     }
 
     public void testGetManagementSSLEnabled() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(true, serverConfig.getManagementSSLEnabled());
+        _serverConfig.initialise();
+        assertEquals(true, _serverConfig.getManagementSSLEnabled());
 
         // Check value we set
         _config.setProperty("management.ssl.enabled", false);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(false, serverConfig.getManagementSSLEnabled());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(false, _serverConfig.getManagementSSLEnabled());
     }
 
     public void testGetManagementKeyStorePassword() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(null, serverConfig.getManagementKeyStorePassword());
+        _serverConfig.initialise();
+        assertEquals(null, _serverConfig.getManagementKeyStorePassword());
 
         // Check value we set
         _config.setProperty("management.ssl.keyStorePassword", "a");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals("a", serverConfig.getManagementKeyStorePassword());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals("a", _serverConfig.getManagementKeyStorePassword());
     }
 
     public void testGetQueueAutoRegister() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(true, serverConfig.getQueueAutoRegister());
+        _serverConfig.initialise();
+        assertEquals(true, _serverConfig.getQueueAutoRegister());
 
         // Check value we set
         _config.setProperty("queue.auto_register", false);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(false, serverConfig.getQueueAutoRegister());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(false, _serverConfig.getQueueAutoRegister());
     }
 
     public void testGetManagementEnabled() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(true, serverConfig.getManagementEnabled());
+        _serverConfig.initialise();
+        assertEquals(true, _serverConfig.getManagementEnabled());
 
         // Check value we set
         _config.setProperty("management.enabled", false);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(false, serverConfig.getManagementEnabled());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(false, _serverConfig.getManagementEnabled());
     }
 
     public void testSetManagementEnabled() throws ConfigurationException
     {
         // Check value we set
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        serverConfig.setManagementEnabled(false);
-        assertEquals(false, serverConfig.getManagementEnabled());
+        _serverConfig.initialise();
+        _serverConfig.setManagementEnabled(false);
+        assertEquals(false, _serverConfig.getManagementEnabled());
     }
 
     public void testGetHeartBeatDelay() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(5, serverConfig.getHeartBeatDelay());
+        _serverConfig.initialise();
+        assertEquals(5, _serverConfig.getHeartBeatDelay());
 
         // Check value we set
         _config.setProperty("heartbeat.delay", 23);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(23, serverConfig.getHeartBeatDelay());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(23, _serverConfig.getHeartBeatDelay());
     }
 
     public void testGetHeartBeatTimeout() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(2.0, serverConfig.getHeartBeatTimeout());
+        _serverConfig.initialise();
+        assertEquals(2.0, _serverConfig.getHeartBeatTimeout());
 
         // Check value we set
         _config.setProperty("heartbeat.timeoutFactor", 2.3);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(2.3, serverConfig.getHeartBeatTimeout());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(2.3, _serverConfig.getHeartBeatTimeout());
     }
 
     public void testGetMaximumMessageAge() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(0, serverConfig.getMaximumMessageAge());
+        _serverConfig.initialise();
+        assertEquals(0, _serverConfig.getMaximumMessageAge());
 
         // Check value we set
         _config.setProperty("maximumMessageAge", 10L);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(10, serverConfig.getMaximumMessageAge());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(10, _serverConfig.getMaximumMessageAge());
     }
 
     public void testGetMaximumMessageCount() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(0, serverConfig.getMaximumMessageCount());
+        _serverConfig.initialise();
+        assertEquals(0, _serverConfig.getMaximumMessageCount());
 
         // Check value we set
         _config.setProperty("maximumMessageCount", 10L);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(10, serverConfig.getMaximumMessageCount());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(10, _serverConfig.getMaximumMessageCount());
     }
 
     public void testGetMaximumQueueDepth() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(0, serverConfig.getMaximumQueueDepth());
+        _serverConfig.initialise();
+        assertEquals(0, _serverConfig.getMaximumQueueDepth());
 
         // Check value we set
         _config.setProperty("maximumQueueDepth", 10L);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(10, serverConfig.getMaximumQueueDepth());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(10, _serverConfig.getMaximumQueueDepth());
     }
 
     public void testGetMaximumMessageSize() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(0, serverConfig.getMaximumMessageSize());
+        _serverConfig.initialise();
+        assertEquals(0, _serverConfig.getMaximumMessageSize());
 
         // Check value we set
         _config.setProperty("maximumMessageSize", 10L);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(10, serverConfig.getMaximumMessageSize());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(10, _serverConfig.getMaximumMessageSize());
     }
 
     public void testGetMinimumAlertRepeatGap() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(0, serverConfig.getMinimumAlertRepeatGap());
+        _serverConfig.initialise();
+        assertEquals(0, _serverConfig.getMinimumAlertRepeatGap());
 
         // Check value we set
         _config.setProperty("minimumAlertRepeatGap", 10L);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(10, serverConfig.getMinimumAlertRepeatGap());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(10, _serverConfig.getMinimumAlertRepeatGap());
     }
 
     public void testGetProcessors() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(4, serverConfig.getConnectorProcessors());
+        _serverConfig.initialise();
+        assertEquals(4, _serverConfig.getConnectorProcessors());
 
         // Check value we set
         _config.setProperty("connector.processors", 10);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(10, serverConfig.getConnectorProcessors());
-    }
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(10, _serverConfig.getConnectorProcessors());
+        }
 
     public void testGetPort() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertNotNull(serverConfig.getPorts());
-        assertEquals(1, serverConfig.getPorts().size());
-        assertEquals(5672, serverConfig.getPorts().get(0));
+        _serverConfig.initialise();
+        assertNotNull(_serverConfig.getPorts());
+        assertEquals(1, _serverConfig.getPorts().size());
+        assertEquals(5672, _serverConfig.getPorts().get(0));
 
 
         // Check value we set
         _config.setProperty("connector.port", "10");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertNotNull(serverConfig.getPorts());
-        assertEquals(1, serverConfig.getPorts().size());
-        assertEquals("10", serverConfig.getPorts().get(0));
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertNotNull(_serverConfig.getPorts());
+        assertEquals(1, _serverConfig.getPorts().size());
+        assertEquals("10", _serverConfig.getPorts().get(0));
     }
 
     public void testGetBind() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(WILDCARD_ADDRESS, serverConfig.getBind());
+        _serverConfig.initialise();
+        assertEquals(WILDCARD_ADDRESS, _serverConfig.getBind());
 
         // Check value we set
         _config.setProperty("connector.bind", "a");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals("a", serverConfig.getBind());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals("a", _serverConfig.getBind());
     }
 
     public void testGetReceiveBufferSize() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(ServerConfiguration.DEFAULT_BUFFER_SIZE, serverConfig.getReceiveBufferSize());
+        _serverConfig.initialise();
+        assertEquals(ServerConfiguration.DEFAULT_BUFFER_SIZE, _serverConfig.getReceiveBufferSize());
 
         // Check value we set
         _config.setProperty("connector.socketReceiveBuffer", "23");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(23, serverConfig.getReceiveBufferSize());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(23, _serverConfig.getReceiveBufferSize());
     }
 
     public void testGetWriteBufferSize() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(ServerConfiguration.DEFAULT_BUFFER_SIZE, serverConfig.getWriteBufferSize());
+        _serverConfig.initialise();
+        assertEquals(ServerConfiguration.DEFAULT_BUFFER_SIZE, _serverConfig.getWriteBufferSize());
 
         // Check value we set
         _config.setProperty("connector.socketWriteBuffer", "23");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(23, serverConfig.getWriteBufferSize());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(23, _serverConfig.getWriteBufferSize());
     }
 
     public void testGetTcpNoDelay() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(true, serverConfig.getTcpNoDelay());
+        _serverConfig.initialise();
+        assertEquals(true, _serverConfig.getTcpNoDelay());
 
         // Check value we set
         _config.setProperty("connector.tcpNoDelay", false);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(false, serverConfig.getTcpNoDelay());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(false, _serverConfig.getTcpNoDelay());
     }
 
     public void testGetEnableExecutorPool() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(false, serverConfig.getEnableExecutorPool());
+        _serverConfig.initialise();
+        assertEquals(false, _serverConfig.getEnableExecutorPool());
 
         // Check value we set
         _config.setProperty("advanced.filterchain[@enableExecutorPool]", true);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(true, serverConfig.getEnableExecutorPool());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(true, _serverConfig.getEnableExecutorPool());
     }
 
     public void testGetEnableSSL() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(false, serverConfig.getEnableSSL());
+        _serverConfig.initialise();
+        assertEquals(false, _serverConfig.getEnableSSL());
 
         // Check value we set
         _config.setProperty("connector.ssl.enabled", true);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(true, serverConfig.getEnableSSL());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(true, _serverConfig.getEnableSSL());
     }
 
     public void testGetSSLOnly() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(false, serverConfig.getSSLOnly());
+        _serverConfig.initialise();
+        assertEquals(false, _serverConfig.getSSLOnly());
 
         // Check value we set
         _config.setProperty("connector.ssl.sslOnly", true);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(true, serverConfig.getSSLOnly());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(true, _serverConfig.getSSLOnly());
     }
 
     public void testGetSSLPort() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(8672, serverConfig.getSSLPort());
+        _serverConfig.initialise();
+        assertEquals(8672, _serverConfig.getSSLPort());
 
         // Check value we set
         _config.setProperty("connector.ssl.port", 23);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(23, serverConfig.getSSLPort());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(23, _serverConfig.getSSLPort());
     }
 
     public void testGetKeystorePath() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals("none", serverConfig.getKeystorePath());
+        _serverConfig.initialise();
+        assertEquals("none", _serverConfig.getKeystorePath());
 
         // Check value we set
         _config.setProperty("connector.ssl.keystorePath", "a");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals("a", serverConfig.getKeystorePath());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals("a", _serverConfig.getKeystorePath());
     }
 
     public void testGetKeystorePassword() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals("none", serverConfig.getKeystorePassword());
+        _serverConfig.initialise();
+        assertEquals("none", _serverConfig.getKeystorePassword());
 
         // Check value we set
         _config.setProperty("connector.ssl.keystorePassword", "a");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals("a", serverConfig.getKeystorePassword());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals("a", _serverConfig.getKeystorePassword());
     }
 
     public void testGetCertType() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals("SunX509", serverConfig.getCertType());
+        _serverConfig.initialise();
+        assertEquals("SunX509", _serverConfig.getCertType());
 
         // Check value we set
         _config.setProperty("connector.ssl.certType", "a");
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals("a", serverConfig.getCertType());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals("a", _serverConfig.getCertType());
     }
 
     public void testGetUseBiasedWrites() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(false, serverConfig.getUseBiasedWrites());
+        _serverConfig.initialise();
+        assertEquals(false, _serverConfig.getUseBiasedWrites());
 
         // Check value we set
         _config.setProperty("advanced.useWriteBiasedPool", true);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(true, serverConfig.getUseBiasedWrites());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(true, _serverConfig.getUseBiasedWrites());
     }
 
     public void testGetHousekeepingExpiredMessageCheckPeriod() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(30000, serverConfig.getHousekeepingCheckPeriod());
+        _serverConfig.initialise();
+        assertEquals(30000, _serverConfig.getHousekeepingCheckPeriod());
 
         // Check value we set
         _config.setProperty("housekeeping.expiredMessageCheckPeriod", 23L);
-        serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
-        assertEquals(23, serverConfig.getHousekeepingCheckPeriod());
-        serverConfig.setHousekeepingExpiredMessageCheckPeriod(42L);
-        assertEquals(42, serverConfig.getHousekeepingCheckPeriod());
+        _serverConfig = new ServerConfiguration(_config);
+        _serverConfig.initialise();
+        assertEquals(23, _serverConfig.getHousekeepingCheckPeriod());
+        _serverConfig.setHousekeepingExpiredMessageCheckPeriod(42L);
+        assertEquals(42, _serverConfig.getHousekeepingCheckPeriod());
     }
 
     public void testSingleConfiguration() throws IOException, ConfigurationException
@@ -939,8 +914,9 @@ public class ServerConfigurationTest ext
         writeConfigFile(mainFile, false, true, null, "test");
 
         // Load config
+        ApplicationRegistry.remove();
         ApplicationRegistry reg = new ConfigurationFileApplicationRegistry(mainFile);
-        ApplicationRegistry.initialise(reg, 1);
+        ApplicationRegistry.initialise(reg);
 
         // Test config
         VirtualHostRegistry virtualHostRegistry = reg.getVirtualHostRegistry();
@@ -971,8 +947,9 @@ public class ServerConfigurationTest ext
         writeVirtualHostsFile(vhostsFile, "test");
 
         // Load config
+        ApplicationRegistry.remove();
         ApplicationRegistry reg = new ConfigurationFileApplicationRegistry(mainFile);
-        ApplicationRegistry.initialise(reg, 1);
+        ApplicationRegistry.initialise(reg);
 
         // Test config
         VirtualHostRegistry virtualHostRegistry = reg.getVirtualHostRegistry();
@@ -1005,8 +982,9 @@ public class ServerConfigurationTest ext
         writeConfigFile(mainFile, false, false, vhostsFile, null);
 
         // Load config
+        ApplicationRegistry.remove();
         ApplicationRegistry reg = new ConfigurationFileApplicationRegistry(mainFile);
-        ApplicationRegistry.initialise(reg, 1);
+        ApplicationRegistry.initialise(reg);
 
         // Test config
         VirtualHostRegistry virtualHostRegistry = reg.getVirtualHostRegistry();
@@ -1048,9 +1026,10 @@ public class ServerConfigurationTest ext
         
         // Load config
         try
-        {       
+        {
+            ApplicationRegistry.remove();
             ApplicationRegistry reg = new ConfigurationFileApplicationRegistry(mainFile);
-            ApplicationRegistry.initialise(reg, 1);
+            ApplicationRegistry.initialise(reg);
             fail("Different virtualhost XML configurations not allowed");
         }
         catch (ConfigurationException ce)
@@ -1083,8 +1062,9 @@ public class ServerConfigurationTest ext
         // Load config
         try
         {
+            ApplicationRegistry.remove();
             ApplicationRegistry reg = new ConfigurationFileApplicationRegistry(mainFile);
-            ApplicationRegistry.initialise(reg, 1);
+            ApplicationRegistry.initialise(reg);
             fail("Multiple virtualhost XML configurations not allowed");
         }
         catch (ConfigurationException ce)
@@ -1384,16 +1364,15 @@ public class ServerConfigurationTest ext
     public void testManagementAccessRejected() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
+        _serverConfig.initialise();
 
         // Check value we set
         _config.setProperty("security.jmx.access(0)", "jmxremote.access");
-        serverConfig = new ServerConfiguration(_config);
+        _serverConfig = new ServerConfiguration(_config);
         
         try
         {
-            serverConfig.initialise();
+            _serverConfig.initialise();
             fail("Exception not thrown");
         }
         catch (ConfigurationException ce)
@@ -1411,16 +1390,15 @@ public class ServerConfigurationTest ext
     public void testManagementPrincipalDatabaseRejected() throws ConfigurationException
     {
         // Check default
-        ServerConfiguration serverConfig = new ServerConfiguration(_config);
-        serverConfig.initialise();
+        _serverConfig.initialise();
 
         // Check value we set
         _config.setProperty("security.jmx.principal-database(0)", "mydb");
-        serverConfig = new ServerConfiguration(_config);
+        _serverConfig = new ServerConfiguration(_config);
 
         try
         {
-            serverConfig.initialise();
+            _serverConfig.initialise();
             fail("Exception not thrown");
         }
         catch (ConfigurationException ce)

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java Thu Jul  7 15:11:41 2011
@@ -20,15 +20,12 @@
  */
 package org.apache.qpid.server.failover;
 
-import junit.framework.TestCase;
-
 import org.apache.qpid.AMQDisconnectedException;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQConnectionURL;
 import org.apache.qpid.client.transport.TransportConnection;
 import org.apache.qpid.client.vmbroker.AMQVMBrokerCreationException;
-import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.util.InternalBrokerBaseCase;
 import org.apache.qpid.url.URLSyntaxException;
 import org.slf4j.Logger;
@@ -47,13 +44,13 @@ public class FailoverMethodTest extends 
     public void createBroker() throws Exception
     {
         super.createBroker();
-        TransportConnection.createVMBroker(ApplicationRegistry.DEFAULT_INSTANCE);
+        TransportConnection.createVMBroker(TransportConnection.DEFAULT_VM_PORT);
     }
 
     @Override
     public void stopBroker()
     {
-        TransportConnection.killVMBroker(ApplicationRegistry.DEFAULT_INSTANCE);
+        TransportConnection.killVMBroker(TransportConnection.DEFAULT_VM_PORT);
         super.stopBroker();
     }
 
@@ -71,7 +68,7 @@ public class FailoverMethodTest extends 
         //note: The VM broker has no connect delay and the default 1 retry
         //        while the tcp:localhost broker has 3 retries with a 2s connect delay
         String connectionString = "amqp://guest:guest@/test?brokerlist=" +
-                                  "'vm://:" + ApplicationRegistry.DEFAULT_INSTANCE +
+                                  "'vm://:" + TransportConnection.DEFAULT_VM_PORT +
                                   ";tcp://localhost:5670?connectdelay='2000',retries='3''";
 
         AMQConnectionURL url = new AMQConnectionURL(connectionString);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureInVM.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureInVM.java?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureInVM.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureInVM.java Thu Jul  7 15:11:41 2011
@@ -65,6 +65,6 @@ public class CauseFailureInVM implements
         int liveBroker = inVMTest.getLiveBroker();
 
         TransportConnection.killVMBroker(liveBroker);
-        ApplicationRegistry.remove(liveBroker);
+        ApplicationRegistry.remove();
     }
 }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/InVMBrokerDecorator.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/InVMBrokerDecorator.java?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/InVMBrokerDecorator.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/InVMBrokerDecorator.java Thu Jul  7 15:11:41 2011
@@ -88,7 +88,7 @@ public class InVMBrokerDecorator extends
                             // Ensure that the in-vm broker is created.
                             try
                             {
-                                ApplicationRegistry.getInstance(1);
+                                ApplicationRegistry.getInstance();
                                 TransportConnection.createVMBroker(1);
                             }
                             catch (AMQVMBrokerCreationException e)
@@ -104,7 +104,7 @@ public class InVMBrokerDecorator extends
                         {
                             // Ensure that the in-vm broker is cleaned up so that the next test starts afresh.
                             TransportConnection.killVMBroker(1);
-                            ApplicationRegistry.remove(1);
+                            ApplicationRegistry.remove();
                         }
                     });
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/Acknowledge2ConsumersTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/Acknowledge2ConsumersTest.java?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/Acknowledge2ConsumersTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/Acknowledge2ConsumersTest.java Thu Jul  7 15:11:41 2011
@@ -23,7 +23,7 @@ package org.apache.qpid.test.unit.ack;
 
 import org.apache.qpid.client.AMQDestination;
 import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.test.utils.FailoverBaseCase;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
 
 import javax.jms.Connection;
 import javax.jms.JMSException;
@@ -32,7 +32,7 @@ import javax.jms.MessageConsumer;
 import javax.jms.Queue;
 import javax.jms.Session;
 
-public class Acknowledge2ConsumersTest extends FailoverBaseCase
+public class Acknowledge2ConsumersTest extends QpidBrokerTestCase
 {
     protected static int NUM_MESSAGES = 100;
     protected Connection _con;

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=1143869&r1=1143868&r2=1143869&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 Thu Jul  7 15:11:41 2011
@@ -466,7 +466,7 @@ public class QpidBrokerTestCase extends 
             final ConfigurationFileApplicationRegistry registry = new ConfigurationFileApplicationRegistry(_configFile);
             try
             {
-                ApplicationRegistry.initialise(registry, port);
+                ApplicationRegistry.initialise(registry);
             }
             catch (Exception e)
             {
@@ -692,7 +692,7 @@ public class QpidBrokerTestCase extends 
         else if (_broker.equals(VM))
         {
             TransportConnection.killVMBroker(port);
-            ApplicationRegistry.remove(port);
+            ApplicationRegistry.remove();
         }
     }
 

Modified: qpid/trunk/qpid/java/test-profiles/JavaInVMExcludes
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/JavaInVMExcludes?rev=1143869&r1=1143868&r2=1143869&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/JavaInVMExcludes (original)
+++ qpid/trunk/qpid/java/test-profiles/JavaInVMExcludes Thu Jul  7 15:11:41 2011
@@ -27,6 +27,25 @@ org.apache.qpid.server.security.firewall
 // This test requires a broker capable of 0-8/9 and 0-10
 org.apache.qpid.test.client.message.JMSDestinationTest#testReceiveResend
 
+//Only a single InVM broker is now supported per JVM, so Failover tests do not work on InVm profiles
+org.apache.qpid.test.client.QueueBrowserAutoAckTest#testFailoverAsQueueBrowserCreated
+org.apache.qpid.test.client.QueueBrowserAutoAckTest#testFailoverWithQueueBrowser
+org.apache.qpid.test.client.QueueBrowserClientAckTest#testFailoverAsQueueBrowserCreated
+org.apache.qpid.test.client.QueueBrowserClientAckTest#testFailoverWithQueueBrowser
+org.apache.qpid.test.client.QueueBrowserDupsOkTest#testFailoverAsQueueBrowserCreated
+org.apache.qpid.test.client.QueueBrowserDupsOkTest#testFailoverWithQueueBrowser
+org.apache.qpid.test.client.QueueBrowserNoAckTest#testFailoverAsQueueBrowserCreated
+org.apache.qpid.test.client.QueueBrowserNoAckTest#testFailoverWithQueueBrowser
+org.apache.qpid.test.client.QueueBrowserPreAckTest#testFailoverAsQueueBrowserCreated
+org.apache.qpid.test.client.QueueBrowserPreAckTest#testFailoverWithQueueBrowser
+org.apache.qpid.test.client.QueueBrowserTransactedTest#testFailoverAsQueueBrowserCreated
+org.apache.qpid.test.client.QueueBrowserTransactedTest#testFailoverWithQueueBrowser
+org.apache.qpid.server.failover.MessageDisappearWithIOExceptionTest#*
+org.apache.qpid.test.client.failover.FailoverTest#*
+org.apache.qpid.test.unit.ack.AcknowledgeAfterFailoverTest#*
+org.apache.qpid.test.unit.ack.AcknowledgeAfterFailoverOnMessageTest#*
+org.apache.qpid.test.unit.publish.DirtyTransactedPublishTest#*
+
 // QPID-2478 test fails when run against broker using 0-8/9
 org.apache.qpid.test.client.message.JMSDestinationTest#testGetDestinationWithCustomExchange
 



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


Mime
View raw message