You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2013/04/19 17:50:09 UTC

svn commit: r1469915 [2/2] - in /qpid/branches/0.22/qpid/java: ./ amqp-1-0-client-jms/ amqp-1-0-client/ amqp-1-0-common/ broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/ broker-plugins/management-http/src/main/java...

Modified: qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java (original)
+++ qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java Fri Apr 19 15:50:07 2013
@@ -20,10 +20,8 @@
  */
 package org.apache.qpid.server.configuration.startup;
 
-import static org.mockito.Mockito.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.verify;
 
 import java.util.Arrays;
 import java.util.Collection;
@@ -35,9 +33,9 @@ import java.util.UUID;
 
 import junit.framework.TestCase;
 
+import org.apache.qpid.server.BrokerOptions;
 import org.apache.qpid.server.configuration.ConfigurationEntry;
 import org.apache.qpid.server.configuration.ConfiguredObjectRecoverer;
-import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.configuration.RecovererProvider;
 import org.apache.qpid.server.logging.LogRecorder;
 import org.apache.qpid.server.logging.RootMessageLogger;
@@ -73,7 +71,7 @@ public class BrokerRecovererTest extends
         super.setUp();
 
         _brokerRecoverer = new BrokerRecoverer(mock(AuthenticationProviderFactory.class), mock(PortFactory.class), mock(StatisticsGatherer.class),
-                mock(VirtualHostRegistry.class), mock(LogRecorder.class), mock(RootMessageLogger.class), mock(TaskExecutor.class));
+                mock(VirtualHostRegistry.class), mock(LogRecorder.class), mock(RootMessageLogger.class), mock(TaskExecutor.class), mock(BrokerOptions.class));
         when(_brokerEntry.getId()).thenReturn(_brokerId);
         when(_brokerEntry.getChildren()).thenReturn(_brokerEntryChildren);
 
@@ -89,7 +87,6 @@ public class BrokerRecovererTest extends
     {
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
-        attributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, "authenticationProvider1");
         attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, 9l);
         attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 8l);
         attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 7l);
@@ -172,24 +169,6 @@ public class BrokerRecovererTest extends
         assertEquals(Collections.singletonList(port), broker.getPorts());
     }
 
-    public void testCreateBrokerWithoutAuthenticationProviderThrowsException()
-    {
-        assertNotNull("expected to remove the base entry", _brokerEntryChildren.remove(AuthenticationProvider.class.getSimpleName()));
-        assertTrue("should be empty", _brokerEntryChildren.isEmpty());
-
-        RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[0], new ConfiguredObject[0]);
-
-        try
-        {
-            _brokerRecoverer.create(recovererProvider, _brokerEntry);
-            fail("should have thrown an exception due to missing authentication provider configuration");
-        }
-        catch(IllegalConfigurationException e)
-        {
-            //expected
-        }
-    }
-
     public void testCreateBrokerWithOneAuthenticationProvider()
     {
         RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{_authenticationProviderEntry1},
@@ -202,29 +181,6 @@ public class BrokerRecovererTest extends
         assertEquals(Collections.singletonList(_authenticationProvider1), broker.getAuthenticationProviders());
     }
 
-    public void testCreateBrokerWithMultipleAuthenticationProvidersAndNoDefaultThrowsException()
-    {
-        AuthenticationProvider authenticationProvider2 = mock(AuthenticationProvider.class);
-        when(authenticationProvider2.getName()).thenReturn("authenticationProvider2");
-        ConfigurationEntry authenticationProviderEntry2 = mock(ConfigurationEntry.class);
-        _brokerEntryChildren.put(AuthenticationProvider.class.getSimpleName(), Arrays.asList(_authenticationProviderEntry1, authenticationProviderEntry2));
-
-        Map<String,Object> emptyBrokerAttributes = new HashMap<String,Object>();
-        when(_brokerEntry.getAttributes()).thenReturn(emptyBrokerAttributes);
-
-        RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{authenticationProviderEntry2, _authenticationProviderEntry1},
-                                                                     new ConfiguredObject[]{authenticationProvider2, _authenticationProvider1});
-        try
-        {
-            _brokerRecoverer.create(recovererProvider, _brokerEntry);
-            fail("should have thrown an exception due to missing authentication provider default");
-        }
-        catch(IllegalConfigurationException e)
-        {
-            //expected
-        }
-    }
-
     public void testCreateBrokerWithMultipleAuthenticationProvidersAndPorts()
     {
         //Create a second authentication provider
@@ -233,13 +189,10 @@ public class BrokerRecovererTest extends
         ConfigurationEntry authenticationProviderEntry2 = mock(ConfigurationEntry.class);
         _brokerEntryChildren.put(AuthenticationProvider.class.getSimpleName(), Arrays.asList(_authenticationProviderEntry1, authenticationProviderEntry2));
 
-        //Set the default authentication provider
         Map<String,Object> brokerAtttributes = new HashMap<String,Object>();
         when(_brokerEntry.getAttributes()).thenReturn(brokerAtttributes);
-        brokerAtttributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, "authenticationProvider2");
 
-        //Add a couple ports, one with a defined authentication provider and
-        //one without (which should then use the default)
+        //Add a couple ports
         ConfigurationEntry portEntry1 = mock(ConfigurationEntry.class);
         Port port1 = mock(Port.class);
         when(port1.getName()).thenReturn("port1");
@@ -249,6 +202,7 @@ public class BrokerRecovererTest extends
         Port port2 = mock(Port.class);
         when(port2.getName()).thenReturn("port2");
         when(port2.getPort()).thenReturn(5672);
+        when(port2.getAttribute(Port.AUTHENTICATION_PROVIDER)).thenReturn("authenticationProvider2");
         _brokerEntryChildren.put(Port.class.getSimpleName(), Arrays.asList(portEntry1, portEntry2));
 
         RecovererProvider recovererProvider = createRecoveryProvider(
@@ -258,47 +212,12 @@ public class BrokerRecovererTest extends
         Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
 
         assertNotNull(broker);
-        assertEquals("Unexpected number of authentication providers", 2,broker.getAuthenticationProviders().size());
+        assertEquals("Unexpected number of authentication providers", 2, broker.getAuthenticationProviders().size());
 
         Collection<Port> ports = broker.getPorts();
         assertEquals("Unexpected number of ports", 2, ports.size());
         assertTrue(ports.contains(port1));
         assertTrue(ports.contains(port2));
-
-        verify(port1).setAuthenticationProvider(any(AuthenticationProvider.class));
-        verify(port1).setAuthenticationProvider(_authenticationProvider1);
-
-        verify(port2).setAuthenticationProvider(any(AuthenticationProvider.class));
-        verify(port2).setAuthenticationProvider(authenticationProvider2);
-    }
-
-    public void testCreateBrokerAssignsGroupAccessorToAuthenticationProviders()
-    {
-        //Create a second authentication provider
-        AuthenticationProvider authenticationProvider2 = mock(AuthenticationProvider.class);
-        when(authenticationProvider2.getName()).thenReturn("authenticationProvider2");
-        ConfigurationEntry authenticationProviderEntry2 = mock(ConfigurationEntry.class);
-        _brokerEntryChildren.put(AuthenticationProvider.class.getSimpleName(), Arrays.asList(_authenticationProviderEntry1, authenticationProviderEntry2));
-
-        //Set the default authentication provider
-        Map<String,Object> brokerAtttributes = new HashMap<String,Object>();
-        when(_brokerEntry.getAttributes()).thenReturn(brokerAtttributes);
-        brokerAtttributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, "authenticationProvider2");
-
-        //Create a group provider
-        ConfigurationEntry groupProviderEntry = mock(ConfigurationEntry.class);
-        GroupProvider groupProvider = mock(GroupProvider.class);
-        _brokerEntryChildren.put(GroupProvider.class.getSimpleName(), Arrays.asList(groupProviderEntry));
-
-        RecovererProvider recovererProvider = createRecoveryProvider(
-                new ConfigurationEntry[]{groupProviderEntry, authenticationProviderEntry2, _authenticationProviderEntry1},
-                new ConfiguredObject[]{groupProvider, authenticationProvider2, _authenticationProvider1});
-
-        Broker broker = _brokerRecoverer.create(recovererProvider, _brokerEntry);
-
-        assertNotNull(broker);
-        assertEquals("Unexpected number of authentication providers", 2, broker.getAuthenticationProviders().size());
-
     }
 
     public void testCreateBrokerWithGroupProvider()

Modified: qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProviderTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProviderTest.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProviderTest.java (original)
+++ qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/DefaultRecovererProviderTest.java Fri Apr 19 15:50:07 2013
@@ -23,6 +23,7 @@ package org.apache.qpid.server.configura
 import static org.mockito.Mockito.mock;
 import junit.framework.TestCase;
 
+import org.apache.qpid.server.BrokerOptions;
 import org.apache.qpid.server.configuration.ConfiguredObjectRecoverer;
 import org.apache.qpid.server.logging.LogRecorder;
 import org.apache.qpid.server.logging.RootMessageLogger;
@@ -54,7 +55,7 @@ public class DefaultRecovererProviderTes
         RootMessageLogger rootMessageLogger = mock(RootMessageLogger.class);
         TaskExecutor taskExecutor = mock(TaskExecutor.class);
 
-        DefaultRecovererProvider provider = new DefaultRecovererProvider(statisticsGatherer, virtualHostRegistry, logRecorder, rootMessageLogger, taskExecutor);
+        DefaultRecovererProvider provider = new DefaultRecovererProvider(statisticsGatherer, virtualHostRegistry, logRecorder, rootMessageLogger, taskExecutor, mock(BrokerOptions.class));
         for (String configuredObjectType : supportedTypes)
         {
             ConfiguredObjectRecoverer<?> recovever = provider.getRecoverer(configuredObjectType);

Modified: qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java (original)
+++ qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java Fri Apr 19 15:50:07 2013
@@ -60,7 +60,6 @@ public abstract class ConfigurationEntry
         _brokerId = UUID.randomUUID();
         _brokerAttributes = new HashMap<String, Object>();
         _brokerAttributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
-        _brokerAttributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, "authenticationProvider1");
         _brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, 9);
         _brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 8);
         _brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 7);
@@ -171,7 +170,6 @@ public abstract class ConfigurationEntry
         ConfigurationEntry brokerConfigEntry = _store.getRootEntry();
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
-        attributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, "authenticationProvider1");
         attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, 19);
         attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 18);
         attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 17);

Modified: qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/model/BrokerShutdownTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/model/BrokerShutdownTest.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/model/BrokerShutdownTest.java (original)
+++ qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/model/BrokerShutdownTest.java Fri Apr 19 15:50:07 2013
@@ -23,6 +23,7 @@ package org.apache.qpid.server.model;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import org.apache.qpid.server.BrokerOptions;
 import org.apache.qpid.server.configuration.ConfigurationEntry;
 import org.apache.qpid.server.configuration.ConfigurationEntryStore;
 import org.apache.qpid.server.configuration.ConfiguredObjectRecoverer;
@@ -121,7 +122,7 @@ public class BrokerShutdownTest extends 
         RootMessageLogger rootMessageLogger = mock(RootMessageLogger.class);
 
         // recover the broker from the store
-        RecovererProvider provider = new DefaultRecovererProvider(statisticsGatherer, virtualHostRegistry, logRecorder, rootMessageLogger, _taskExecutor);
+        RecovererProvider provider = new DefaultRecovererProvider(statisticsGatherer, virtualHostRegistry, logRecorder, rootMessageLogger, _taskExecutor, mock(BrokerOptions.class));
         ConfiguredObjectRecoverer<? extends ConfiguredObject> brokerRecoverer = provider.getRecoverer(Broker.class.getSimpleName());
 
         Broker broker = (Broker) brokerRecoverer.create(provider, store.getRootEntry());

Modified: qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java (original)
+++ qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java Fri Apr 19 15:50:07 2013
@@ -36,6 +36,7 @@ import java.util.UUID;
 
 import org.apache.qpid.server.configuration.BrokerProperties;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
+import org.apache.qpid.server.model.AuthenticationProvider;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.KeyStore;
 import org.apache.qpid.server.model.Port;
@@ -58,19 +59,22 @@ public class PortFactoryTest extends Qpi
     private Broker _broker = mock(Broker.class);
     private KeyStore _keyStore = mock(KeyStore.class);
     private TrustStore _trustStore = mock(TrustStore.class);
-
+    private String _authProviderName = "authProvider";
+    private AuthenticationProvider _authProvider = mock(AuthenticationProvider.class);
     private PortFactory _portFactory;
 
     @Override
     protected void setUp() throws Exception
     {
+        when(_broker.findAuthenticationProviderByName(_authProviderName)).thenReturn(_authProvider);
+
         setTestSystemProperty(BrokerProperties.PROPERTY_BROKER_DEFAULT_AMQP_PROTOCOL_EXCLUDES, null);
         setTestSystemProperty(BrokerProperties.PROPERTY_BROKER_DEFAULT_AMQP_PROTOCOL_INCLUDES, null);
         _portFactory = new PortFactory();
 
         _attributes.put(Port.PORT, _portNumber);
         _attributes.put(Port.TRANSPORTS, _tcpStringSet);
-
+        _attributes.put(Port.AUTHENTICATION_PROVIDER, _authProviderName);
         _attributes.put(Port.TCP_NO_DELAY, "true");
         _attributes.put(Port.RECEIVE_BUFFER_SIZE, "1");
         _attributes.put(Port.SEND_BUFFER_SIZE, "2");
@@ -111,6 +115,7 @@ public class PortFactoryTest extends Qpi
     {
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(Port.PORT, 1);
+        attributes.put(Port.AUTHENTICATION_PROVIDER, _authProviderName);
         Port port = _portFactory.createPort(_portId, _broker, attributes);
 
         assertNotNull(port);
@@ -273,6 +278,7 @@ public class PortFactoryTest extends Qpi
         Set<String> nonAmqpStringSet = Collections.singleton(Protocol.JMX_RMI.name());
         _attributes = new HashMap<String, Object>();
         _attributes.put(Port.PROTOCOLS, nonAmqpStringSet);
+        _attributes.put(Port.AUTHENTICATION_PROVIDER, _authProviderName);
         _attributes.put(Port.PORT, _portNumber);
         _attributes.put(Port.TRANSPORTS, _tcpStringSet);
 
@@ -298,6 +304,7 @@ public class PortFactoryTest extends Qpi
         Set<String> nonAmqpStringSet = Collections.singleton(Protocol.JMX_RMI.name());
         _attributes = new HashMap<String, Object>();
         _attributes.put(Port.PROTOCOLS, nonAmqpStringSet);
+        _attributes.put(Port.AUTHENTICATION_PROVIDER, _authProviderName);
         _attributes.put(Port.PORT, _portNumber);
 
         Port port = _portFactory.createPort(_portId, _broker, _attributes);

Modified: qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexInitialiserTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexInitialiserTest.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexInitialiserTest.java (original)
+++ qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/CRAMMD5HexInitialiserTest.java Fri Apr 19 15:50:07 2013
@@ -20,88 +20,94 @@
  */
 package org.apache.qpid.server.security.auth.sasl;
 
-import junit.framework.TestCase;
-
-import org.apache.qpid.server.security.auth.database.PropertiesPrincipalDatabase;
-import org.apache.qpid.server.security.auth.sasl.crammd5.CRAMMD5HexInitialiser;
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
 
 import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.NameCallback;
 import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import java.io.IOException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.Properties;
+
+import junit.framework.TestCase;
+
+import org.apache.qpid.server.security.auth.database.Base64MD5PasswordFilePrincipalDatabase;
+import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
+import org.apache.qpid.server.security.auth.sasl.crammd5.CRAMMD5HexInitialiser;
+import org.apache.qpid.test.utils.TestFileUtils;
+import org.apache.qpid.tools.security.Passwd;
 
 /**
  * These tests ensure that the Hex wrapping that the initialiser performs does actually operate when the handle method is called.
  */
 public class CRAMMD5HexInitialiserTest extends TestCase
 {
-    public void testHex()
-    {
-        //Create User details for testing
-        String user = "testUser";
-        String password = "testPassword";
+    private static final String TEST_PASSWORD = "testPassword";
+    private static final String TEST_USER = "testUser";
+    private File _file;
 
-        perform(user, password);
-    }
-
-    public void testHashedHex()
+    public void testHashedHex() throws Exception
     {
-        //Create User details for testing
-        String user = "testUser";
-        String password = "testPassword";
-
-        //Create a hashed password that we then attempt to put through the call back mechanism.
-        try
-        {
-            password = new String(MessageDigest.getInstance("MD5").digest(password.getBytes()));
-        }
-        catch (NoSuchAlgorithmException e)
-        {
-            fail(e.getMessage());
-        }
-
-        perform(user, password);
+        perform(TEST_USER, getHash(TEST_PASSWORD));
     }
 
-    public void perform(String user, String password)
+    public void perform(String user, char[] password) throws Exception
     {
         CRAMMD5HexInitialiser initialiser = new CRAMMD5HexInitialiser();
 
-        //Use properties to create a PrincipalDatabase
-        Properties users = new Properties();
-        users.put(user, password);
-
-        PropertiesPrincipalDatabase db = new PropertiesPrincipalDatabase(users);
-
+        PrincipalDatabase db = new Base64MD5PasswordFilePrincipalDatabase();
+        db.open(_file);
         initialiser.initialise(db);
 
-        //setup the callbacks
         PasswordCallback passwordCallback = new PasswordCallback("password:", false);
         NameCallback usernameCallback = new NameCallback("user:", user);
 
         Callback[] callbacks = new Callback[]{usernameCallback, passwordCallback};
 
-        //Check the
-        try
+        assertNull("The password was not null before the handle call.", passwordCallback.getPassword());
+        initialiser.getCallbackHandler().handle(callbacks);
+
+        assertArrayEquals(toHex(password), passwordCallback.getPassword());
+    }
+
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        _file = TestFileUtils.createTempFile(this, "password-file", new Passwd().getOutput(TEST_USER , TEST_PASSWORD));
+    }
+
+    public void tearDown() throws Exception
+    {
+        if (_file != null)
         {
-            assertNull("The password was not null before the handle call.", passwordCallback.getPassword());
-            initialiser.getCallbackHandler().handle(callbacks);
+            _file.delete();
         }
-        catch (IOException e)
+        super.tearDown();
+    }
+
+    private char[] getHash(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException
+    {
+
+        byte[] data = text.getBytes("utf-8");
+
+        MessageDigest md = MessageDigest.getInstance("MD5");
+
+        for (byte b : data)
         {
-            fail(e.getMessage());
+            md.update(b);
         }
-        catch (UnsupportedCallbackException e)
+
+        byte[] digest = md.digest();
+
+        char[] hash = new char[digest.length];
+
+        int index = 0;
+        for (byte b : digest)
         {
-            fail(e.getMessage());
+            hash[index++] = (char) b;
         }
 
-        //Hex the password we initialised with and compare it with the passwordCallback
-        assertArrayEquals(toHex(password.toCharArray()), passwordCallback.getPassword());
+        return hash;
     }
 
     private void assertArrayEquals(char[] expected, char[] actual)
@@ -135,4 +141,5 @@ public class CRAMMD5HexInitialiserTest e
 
         return hex;
     }
+
 }

Propchange: qpid/branches/0.22/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/LoggingManagement.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/LoggingManagement.java:r1468830

Propchange: qpid/branches/0.22/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java:r1468830

Propchange: qpid/branches/0.22/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java:r1468830

Propchange: qpid/branches/0.22/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedExchange.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedExchange.java:r1468830

Propchange: qpid/branches/0.22/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java:r1468830

Propchange: qpid/branches/0.22/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java:r1468830

Propchange: qpid/branches/0.22/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanAttribute.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanAttribute.java:r1468830

Propchange: qpid/branches/0.22/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanConstructor.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanConstructor.java:r1468830

Propchange: qpid/branches/0.22/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanDescription.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanDescription.java:r1468830

Propchange: qpid/branches/0.22/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperation.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperation.java:r1468830

Propchange: qpid/branches/0.22/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperationParameter.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperationParameter.java:r1468830

Modified: qpid/branches/0.22/qpid/java/systests/etc/config-systests.json
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/systests/etc/config-systests.json?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/systests/etc/config-systests.json (original)
+++ qpid/branches/0.22/qpid/java/systests/etc/config-systests.json Fri Apr 19 15:50:07 2013
@@ -20,7 +20,6 @@
  */
 {
   "name": "QpidBroker",
-  "defaultAuthenticationProvider" : "plain",
   "defaultVirtualHost" : "test",
   "authenticationproviders" : [ {
     "name" : "plain",
@@ -39,9 +38,11 @@
   } ],
   "ports" : [  {
     "name" : "amqp",
+    "authenticationProvider" : "plain",
     "port" : "${test.port}"
   }, {
     "name" : "http",
+    "authenticationProvider" : "plain",
     "port" : "${test.hport}",
     "protocols" : [ "HTTP" ]
   }, {
@@ -50,6 +51,7 @@
     "protocols" : [ "RMI" ]
   }, {
     "name" : "jmx",
+    "authenticationProvider" : "plain",
     "port" : "${test.cport}",
     "protocols" : [ "JMX_RMI" ]
   }],
@@ -67,4 +69,4 @@
     "name" : "jmxManagement"
   } ]
   */
-}
\ No newline at end of file
+}

Modified: qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java (original)
+++ qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java Fri Apr 19 15:50:07 2013
@@ -362,6 +362,7 @@ public class SSLTest extends QpidBrokerT
             Map<String, Object> sslPortAttributes = new HashMap<String, Object>();
             sslPortAttributes.put(Port.TRANSPORTS, Collections.singleton(Transport.SSL));
             sslPortAttributes.put(Port.PORT, DEFAULT_SSL_PORT);
+            sslPortAttributes.put(Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
             sslPortAttributes.put(Port.NEED_CLIENT_AUTH, needClientAuth);
             sslPortAttributes.put(Port.WANT_CLIENT_AUTH, wantClientAuth);
             sslPortAttributes.put(Port.NAME, TestBrokerConfiguration.ENTRY_NAME_SSL_PORT);

Propchange: qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/server/SupportedProtocolVersionsTest.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/SupportedProtocolVersionsTest.java:r1468830

Modified: qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java (original)
+++ qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java Fri Apr 19 15:50:07 2013
@@ -95,9 +95,7 @@ public class BrokerLoggingTest extends A
     {
         String TESTID="BRK-1006";
 
-        // This logging startup code only occurs when you run a Java broker,
-        // that broker must be started via Main so not an InVM broker.
-        if (isJavaBroker() && isExternalBroker())
+        if (isJavaBroker())
         {
             startBroker();
 
@@ -165,8 +163,6 @@ public class BrokerLoggingTest extends A
      */
     public void testBrokerStartupDefaultLog4j() throws Exception
     {
-        // This logging startup code only occurs when you run a Java broker,
-        // that broker must be started via Main so not an InVM broker.
         if (isJavaBroker() && isExternalBroker() && !isInternalBroker())
         {
             String TESTID = "BRK-1007";
@@ -256,7 +252,7 @@ public class BrokerLoggingTest extends A
     public void testBrokerStartupCustomLog4j() throws Exception
     {
         // This logging startup code only occurs when you run a Java broker
-        if (isJavaBroker() && isExternalBroker())
+        if (isJavaBroker())
         {
             String customLog4j = getBrokerCommandLog4JFile().getAbsolutePath();
 
@@ -344,7 +340,7 @@ public class BrokerLoggingTest extends A
     {
         // This logging startup code only occurs when you run a Java broker,
         // that broker must be started via Main so not an InVM broker.
-        if (isJavaBroker() && isExternalBroker())
+        if (isJavaBroker())
         {
             String TESTID = "BRK-1001";
 
@@ -426,9 +422,7 @@ public class BrokerLoggingTest extends A
      */
     public void testBrokerStartupListeningTCPDefault() throws Exception
     {
-        // This logging startup code only occurs when you run a Java broker,
-        // that broker must be started via Main so not an InVM broker.
-        if (isJavaBroker() && isExternalBroker())
+        if (isJavaBroker())
         {
             String TESTID = "BRK-1002";
 
@@ -484,7 +478,7 @@ public class BrokerLoggingTest extends A
                     //3
                     String message = getMessageString(log);
                     assertTrue("Expected Listen log not correct" + message,
-                               message.endsWith("Listening on [TCP] port " + getPort()));
+                               message.endsWith("Listening on TCP port " + getPort()));
 
                     validation = true;
                 }
@@ -534,9 +528,7 @@ public class BrokerLoggingTest extends A
      */
     public void testBrokerStartupListeningTCPSSL() throws Exception
     {
-        // This logging startup code only occurs when you run a Java broker,
-        // that broker must be started via Main so not an InVM broker.
-        if (isJavaBroker() && isExternalBroker())
+        if (isJavaBroker())
         {
             String TESTID = "BRK-1002";
 
@@ -545,6 +537,8 @@ public class BrokerLoggingTest extends A
             sslPortAttributes.put(Port.TRANSPORTS, Collections.singleton(Transport.SSL));
             sslPortAttributes.put(Port.PORT, DEFAULT_SSL_PORT);
             sslPortAttributes.put(Port.NAME, TestBrokerConfiguration.ENTRY_NAME_SSL_PORT);
+            sslPortAttributes.put(Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
+            sslPortAttributes.put(Port.KEY_STORE, TestBrokerConfiguration.ENTRY_NAME_SSL_KEYSTORE);
             getBrokerConfiguration().addPortConfiguration(sslPortAttributes);
 
             startBroker();
@@ -599,12 +593,12 @@ public class BrokerLoggingTest extends A
                     //Check the first
                     String message = getMessageString(getLog(listenMessages .get(0)));
                     assertTrue("Expected Listen log not correct" + message,
-                               message.endsWith("Listening on [TCP] port " + getPort()));
+                               message.endsWith("Listening on TCP port " + getPort()));
 
                     // Check the third, ssl listen.
                     message = getMessageString(getLog(listenMessages .get(2)));
                     assertTrue("Expected Listen log not correct" + message,
-                               message.endsWith("Listening on [SSL] port " + DEFAULT_SSL_PORT));
+                               message.endsWith("Listening on SSL port " + DEFAULT_SSL_PORT));
 
                     //4 Test ports open
                     testSocketOpen(getPort());
@@ -643,9 +637,7 @@ public class BrokerLoggingTest extends A
      */
     public void testBrokerStartupReady() throws Exception
     {
-        // This logging startup code only occurs when you run a Java broker,
-        // that broker must be started via Main so not an InVM broker.
-        if (isJavaBroker() && isExternalBroker())
+        if (isJavaBroker())
         {
             String TESTID = "BRK-1004";
 
@@ -731,9 +723,7 @@ public class BrokerLoggingTest extends A
      */
     public void testBrokerShutdownListeningTCPDefault() throws Exception
     {
-        // This logging startup code only occurs when you run a Java broker,
-        // that broker must be started via Main so not an InVM broker.
-        if (isJavaBroker() && isExternalBroker())
+        if (isJavaBroker() && isInternalBroker())
         {
             String TESTID = "BRK-1003";
 
@@ -825,9 +815,7 @@ public class BrokerLoggingTest extends A
      */
     public void testBrokerShutdownListeningTCPSSL() throws Exception
     {
-        // This logging startup code only occurs when you run a Java broker,
-        // that broker must be started via Main so not an InVM broker.
-        if (isJavaBroker() && isExternalBroker())
+        if (isJavaBroker() && isInternalBroker())
         {
             String TESTID = "BRK-1003";
 
@@ -836,6 +824,8 @@ public class BrokerLoggingTest extends A
             sslPortAttributes.put(Port.TRANSPORTS, Collections.singleton(Transport.SSL));
             sslPortAttributes.put(Port.PORT, DEFAULT_SSL_PORT);
             sslPortAttributes.put(Port.NAME, TestBrokerConfiguration.ENTRY_NAME_SSL_PORT);
+            sslPortAttributes.put(Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
+            sslPortAttributes.put(Port.KEY_STORE, TestBrokerConfiguration.ENTRY_NAME_SSL_KEYSTORE);
             getBrokerConfiguration().addPortConfiguration(sslPortAttributes);
 
             startBroker();
@@ -877,7 +867,7 @@ public class BrokerLoggingTest extends A
                 // Check second, ssl, listen.
                 message = getMessageString(getLog(listenMessages.get(1)));
                 assertTrue("Expected shutdown log not correct" + message,
-                           message.endsWith("TCP/SSL port " + DEFAULT_SSL_PORT));
+                           message.endsWith("SSL port " + DEFAULT_SSL_PORT));
 
                 //4
                 //Test Port closed
@@ -913,9 +903,7 @@ public class BrokerLoggingTest extends A
      */
     public void testBrokerShutdownStopped() throws Exception
     {
-        // This logging startup code only occurs when you run a Java broker,
-        // that broker must be started via Main so not an InVM broker.
-        if (isJavaBroker() && isExternalBroker())
+        if (isJavaBroker() && isInternalBroker())
         {
             String TESTID = "BRK-1005";
 

Modified: qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java (original)
+++ qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java Fri Apr 19 15:50:07 2013
@@ -105,22 +105,25 @@ public class VirtualHostLoggingTest exte
      */
     public void testVirtualhostClosure() throws Exception
     {
-        stopBroker();
+        if (isJavaBroker() && isInternalBroker())
+        {
+            stopBroker();
 
-        // Wait for the correct VHT message to arrive.                                 
-        waitForMessage(VHT_PREFIX + "1002");
+            // Wait for the correct VHT message to arrive.
+            waitForMessage(VHT_PREFIX + "1002");
 
-        // Validate each vhost logs a closure
-        List<String> results = findMatches(VHT_PREFIX + "1002");
+            // Validate each vhost logs a closure
+            List<String> results = findMatches(VHT_PREFIX + "1002");
 
-        try
-        {
-            assertEquals("Each vhost did not close their store.", 1, results.size());
-        }
-        catch (AssertionFailedError afe)
-        {
-            dumpLogs(results, _monitor);
-            throw afe;
+            try
+            {
+                assertEquals("Each vhost did not close their store.", 1, results.size());
+            }
+            catch (AssertionFailedError afe)
+            {
+                dumpLogs(results, _monitor);
+                throw afe;
+            }
         }
     }
 

Modified: qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java (original)
+++ qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java Fri Apr 19 15:50:07 2013
@@ -42,7 +42,6 @@ import org.apache.commons.configuration.
 import org.apache.qpid.client.AMQConnectionURL;
 import org.apache.qpid.management.common.mbeans.ManagedConnection;
 import org.apache.qpid.server.model.AuthenticationProvider;
-import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.Port;
 import org.apache.qpid.server.model.Transport;
 import org.apache.qpid.server.model.TrustStore;
@@ -67,7 +66,6 @@ public class ExternalAuthenticationTest 
     public void testExternalAuthenticationManagerOnSSLPort() throws Exception
     {
         setCommonBrokerSSLProperties(true);
-        getBrokerConfiguration().setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_SSL_PORT, Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER);
         super.setUp();
 
         setClientKeystoreProperties();
@@ -94,13 +92,13 @@ public class ExternalAuthenticationTest 
     }
 
     /**
-     * Tests that when EXTERNAL authentication manager is set as the default, clients presenting certificates are able to connect.
-     * Also, checks a client with valid username and password but not using ssl is unable to connect to the non SSL port.
+     * Tests that when EXTERNAL authentication manager is set on the non-SSL port, clients with valid username and password
+     * but not using ssl are unable to connect to the non-SSL port.
      */
-    public void testExternalAuthenticationManagerAsDefault() throws Exception
+    public void testExternalAuthenticationManagerOnNonSslPort() throws Exception
     {
         setCommonBrokerSSLProperties(true);
-        getBrokerConfiguration().setBrokerAttribute(Broker.DEFAULT_AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER);
+        getBrokerConfiguration().setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_AMQP_PORT, Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER);
         super.setUp();
 
         setClientKeystoreProperties();
@@ -115,25 +113,15 @@ public class ExternalAuthenticationTest 
         {
             // pass
         }
-
-        try
-        {
-            getExternalSSLConnection(false);
-        }
-        catch (JMSException e)
-        {
-            fail("Should be able to create a connection to the SSL port. " + e.getMessage());
-        }
     }
 
     /**
-     * Tests that when EXTERNAL authentication manager is set as the default, clients without certificates are unable to connect to the SSL port
+     * Tests that when EXTERNAL authentication manager is used, clients without certificates are unable to connect to the SSL port
      * even with valid username and password.
      */
     public void testExternalAuthenticationManagerWithoutClientKeyStore() throws Exception
     {
         setCommonBrokerSSLProperties(false);
-        getBrokerConfiguration().setBrokerAttribute(Broker.DEFAULT_AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER);
         super.setUp();
 
         setClientTrustoreProperties();
@@ -156,7 +144,6 @@ public class ExternalAuthenticationTest 
     public void testExternalAuthenticationDeniesUntrustedClientCert() throws Exception
     {
         setCommonBrokerSSLProperties(true);
-        getBrokerConfiguration().setBrokerAttribute(Broker.DEFAULT_AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER);
         super.setUp();
 
         setUntrustedClientKeystoreProperties();
@@ -219,8 +206,6 @@ public class ExternalAuthenticationTest 
         sslTrustStoreAttributes.put(TrustStore.PEERS_ONLY, true);
         getBrokerConfiguration().addTrustStoreConfiguration(sslTrustStoreAttributes);
 
-        getBrokerConfiguration().setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_SSL_PORT, Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER);
-
         super.setUp();
 
         setClientKeystoreProperties();
@@ -267,7 +252,6 @@ public class ExternalAuthenticationTest 
         JMXTestUtils jmxUtils = new JMXTestUtils(this);
 
         setCommonBrokerSSLProperties(true);
-        getBrokerConfiguration().setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_SSL_PORT, Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER);
         getBrokerConfiguration().addJmxManagementConfiguration();
 
         super.setUp();
@@ -301,7 +285,6 @@ public class ExternalAuthenticationTest 
         JMXTestUtils jmxUtils = new JMXTestUtils(this);
 
         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();
 
@@ -354,6 +337,7 @@ public class ExternalAuthenticationTest 
     private void setCommonBrokerSSLProperties(boolean needClientAuth, Collection<String> trustStoreNames) throws ConfigurationException
     {
         TestBrokerConfiguration config = getBrokerConfiguration();
+
         Map<String, Object> sslPortAttributes = new HashMap<String, Object>();
         sslPortAttributes.put(Port.TRANSPORTS, Collections.singleton(Transport.SSL));
         sslPortAttributes.put(Port.PORT, DEFAULT_SSL_PORT);
@@ -364,9 +348,11 @@ public class ExternalAuthenticationTest 
         config.addPortConfiguration(sslPortAttributes);
 
         Map<String, Object> externalAuthProviderAttributes = new HashMap<String, Object>();
-        externalAuthProviderAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE, ExternalAuthenticationManagerFactory.PROVIDER_TYPE);
         externalAuthProviderAttributes.put(AuthenticationProvider.NAME, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER);
+        externalAuthProviderAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE, ExternalAuthenticationManagerFactory.PROVIDER_TYPE);
         config.addAuthenticationProviderConfiguration(externalAuthProviderAttributes);
+
+        config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_SSL_PORT, Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER);
     }
 
     private void setUntrustedClientKeystoreProperties()

Modified: qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java (original)
+++ qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java Fri Apr 19 15:50:07 2013
@@ -126,7 +126,6 @@ public class BrokerRestTest extends Qpid
     public void testPutToUpdateWithInvalidAttributeValues() throws Exception
     {
         Map<String, Object> invalidAttributes = new HashMap<String, Object>();
-        invalidAttributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, "non-existing-provider");
         invalidAttributes.put(Broker.DEFAULT_VIRTUAL_HOST, "non-existing-host");
         invalidAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, -1000);
         invalidAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, -2000);
@@ -166,7 +165,6 @@ public class BrokerRestTest extends Qpid
     private Map<String, Object> getValidBrokerAttributes()
     {
         Map<String, Object> brokerAttributes = new HashMap<String, Object>();
-        brokerAttributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, ANONYMOUS_AUTHENTICATION_PROVIDER);
         brokerAttributes.put(Broker.DEFAULT_VIRTUAL_HOST, TEST3_VIRTUALHOST);
         brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, 1000);
         brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 2000);

Modified: qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/KeyStoreRestTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/KeyStoreRestTest.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/KeyStoreRestTest.java (original)
+++ qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/KeyStoreRestTest.java Fri Apr 19 15:50:07 2013
@@ -115,6 +115,7 @@ public class KeyStoreRestTest extends Qp
         sslPortAttributes.put(Port.TRANSPORTS, Collections.singleton(Transport.SSL));
         sslPortAttributes.put(Port.PORT, DEFAULT_SSL_PORT);
         sslPortAttributes.put(Port.NAME, TestBrokerConfiguration.ENTRY_NAME_SSL_PORT);
+        sslPortAttributes.put(Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
         sslPortAttributes.put(Port.KEY_STORE, name);
         getBrokerConfiguration().addPortConfiguration(sslPortAttributes);
 

Modified: qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java (original)
+++ qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java Fri Apr 19 15:50:07 2013
@@ -78,6 +78,7 @@ public class PortRestTest extends QpidRe
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(Port.NAME, portName);
         attributes.put(Port.PORT, findFreePort());
+        attributes.put(Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
 
         int responseCode = getRestTestHelper().submitRequest("/rest/port/" + portName, "PUT", attributes);
         assertEquals("Unexpected response code", 201, responseCode);
@@ -138,6 +139,7 @@ public class PortRestTest extends QpidRe
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(Port.NAME, portName);
         attributes.put(Port.PORT, findFreePort());
+        attributes.put(Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
 
         int responseCode = getRestTestHelper().submitRequest("/rest/port/" + portName, "PUT", attributes);
         assertEquals("Unexpected response code for port creation", 201, responseCode);
@@ -161,25 +163,6 @@ public class PortRestTest extends QpidRe
 
         responseCode = getRestTestHelper().submitRequest("/rest/port/" + portName, "PUT", attributes);
         assertEquals("Port cannot be updated in non management mode", 409, responseCode);
-
-        restartBrokerInManagementMode();
-
-        responseCode = getRestTestHelper().submitRequest("/rest/port/" + portName, "PUT", attributes);
-        assertEquals("Port should be allwed to update in a management mode", 200, responseCode);
-
-        portDetails = getRestTestHelper().getJsonAsList("/rest/port/" + portName);
-        assertNotNull("Port details cannot be null", portDetails);
-        assertEquals("Unexpected number of ports with name " + portName, 1, portDetails.size());
-        port = portDetails.get(0);
-
-        assertEquals("Unexpected authentication provider", TestBrokerConfiguration.ENTRY_NAME_ANONYMOUS_PROVIDER, port.get(Port.AUTHENTICATION_PROVIDER));
-        Object protocols = port.get(Port.PROTOCOLS);
-        assertNotNull("Protocols attribute is not found", protocols);
-        assertTrue("Protocol attribute value is not collection:" + protocols, protocols instanceof Collection);
-        @SuppressWarnings("unchecked")
-        Collection<String> protocolsCollection = ((Collection<String>)protocols);
-        assertEquals("Unexpected protocols size", 1, protocolsCollection.size());
-        assertEquals("Unexpected protocols", Protocol.AMQP_0_9_1.name(), protocolsCollection.iterator().next());
     }
 
     public void testPutUpdateOpenedAmqpPortFails() throws Exception
@@ -199,6 +182,7 @@ public class PortRestTest extends QpidRe
     public void testUpdatePortTransportFromTCPToSSLWhenKeystoreIsConfigured() throws Exception
     {
         restartBrokerInManagementMode();
+        getRestTestHelper().setManagementModeCredentials();
 
         String portName = TestBrokerConfiguration.ENTRY_NAME_AMQP_PORT;
         Map<String, Object> attributes = new HashMap<String, Object>();
@@ -210,6 +194,7 @@ public class PortRestTest extends QpidRe
         assertEquals("Transport has not been changed to SSL " , 200, responseCode);
 
         restartBroker();
+        getRestTestHelper().setUsernameAndPassword("webadmin", "webadmin");
 
         Map<String, Object> port = getRestTestHelper().getJsonAsSingletonList("/rest/port/" + portName);
 
@@ -225,6 +210,7 @@ public class PortRestTest extends QpidRe
     public void testUpdateTransportFromTCPToSSLWithoutKeystoreConfiguredFails() throws Exception
     {
         restartBrokerInManagementMode();
+        getRestTestHelper().setManagementModeCredentials();
 
         String portName = TestBrokerConfiguration.ENTRY_NAME_AMQP_PORT;
         Map<String, Object> attributes = new HashMap<String, Object>();
@@ -241,6 +227,7 @@ public class PortRestTest extends QpidRe
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(Port.NAME, portName);
         attributes.put(Port.PORT, DEFAULT_SSL_PORT);
+        attributes.put(Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
         attributes.put(Port.TRANSPORTS, Collections.singleton(Transport.SSL));
         attributes.put(Port.KEY_STORE, TestBrokerConfiguration.ENTRY_NAME_SSL_KEYSTORE);
         attributes.put(Port.TRUST_STORES, Collections.singleton(TestBrokerConfiguration.ENTRY_NAME_SSL_TRUSTSTORE));
@@ -249,6 +236,7 @@ public class PortRestTest extends QpidRe
         assertEquals("SSL port was not added", 201, responseCode);
 
         restartBrokerInManagementMode();
+        getRestTestHelper().setManagementModeCredentials();
 
         attributes.put(Port.NEED_CLIENT_AUTH, true);
         attributes.put(Port.WANT_CLIENT_AUTH, true);
@@ -257,6 +245,7 @@ public class PortRestTest extends QpidRe
         assertEquals("Attributes for need/want client auth are not set", 200, responseCode);
 
         restartBroker();
+        getRestTestHelper().setUsernameAndPassword("webadmin", "webadmin");
         Map<String, Object> port = getRestTestHelper().getJsonAsSingletonList("/rest/port/" + portName);
         assertEquals("Unexpected " + Port.NEED_CLIENT_AUTH, true, port.get(Port.NEED_CLIENT_AUTH));
         assertEquals("Unexpected " + Port.WANT_CLIENT_AUTH, true, port.get(Port.WANT_CLIENT_AUTH));
@@ -267,6 +256,7 @@ public class PortRestTest extends QpidRe
                 new HashSet<String>(trustStores));
 
         restartBrokerInManagementMode();
+        getRestTestHelper().setManagementModeCredentials();
 
         attributes = new HashMap<String, Object>();
         attributes.put(Port.NAME, portName);
@@ -285,6 +275,7 @@ public class PortRestTest extends QpidRe
         assertEquals("Should be able to change transport to TCP ", 200, responseCode);
 
         restartBroker();
+        getRestTestHelper().setUsernameAndPassword("webadmin", "webadmin");
         port = getRestTestHelper().getJsonAsSingletonList("/rest/port/" + portName);
         assertEquals("Unexpected " + Port.NEED_CLIENT_AUTH, false, port.get(Port.NEED_CLIENT_AUTH));
         assertEquals("Unexpected " + Port.WANT_CLIENT_AUTH, false, port.get(Port.WANT_CLIENT_AUTH));
@@ -298,6 +289,7 @@ public class PortRestTest extends QpidRe
     public void testUpdateSettingWantNeedCertificateFailsForNonSSLPort() throws Exception
     {
         restartBrokerInManagementMode();
+        getRestTestHelper().setManagementModeCredentials();
 
         String portName = TestBrokerConfiguration.ENTRY_NAME_AMQP_PORT;
         Map<String, Object> attributes = new HashMap<String, Object>();
@@ -316,6 +308,7 @@ public class PortRestTest extends QpidRe
     public void testUpdatePortAuthenticationProvider() throws Exception
     {
         restartBrokerInManagementMode();
+        getRestTestHelper().setManagementModeCredentials();
 
         String portName = TestBrokerConfiguration.ENTRY_NAME_AMQP_PORT;
         Map<String, Object> attributes = new HashMap<String, Object>();

Modified: qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java (original)
+++ qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java Fri Apr 19 15:50:07 2013
@@ -51,6 +51,7 @@ import junit.framework.Assert;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.log4j.Logger;
+import org.apache.qpid.server.BrokerOptions;
 import org.apache.qpid.server.security.auth.manager.AbstractPrincipalDatabaseAuthManagerFactory;
 import org.apache.qpid.ssl.SSLContextFactory;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
@@ -400,6 +401,11 @@ public class RestTestHelper
         _password = password;
     }
 
+    public void setManagementModeCredentials()
+    {
+        setUsernameAndPassword(BrokerOptions.MANAGEMENT_MODE_USER_NAME, QpidBrokerTestCase.MANAGEMENT_MODE_PASSWORD);
+    }
+
     /**
      * Create password file that follows the convention username=password, which is deleted by {@link #tearDown()}
      */

Modified: qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/SaslRestTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/SaslRestTest.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/SaslRestTest.java (original)
+++ qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/SaslRestTest.java Fri Apr 19 15:50:07 2013
@@ -20,20 +20,20 @@
  */
 package org.apache.qpid.systest.rest;
 
+import static org.apache.qpid.server.security.auth.sasl.SaslUtil.generateCramMD5ClientResponse;
+import static org.apache.qpid.server.security.auth.sasl.SaslUtil.generateCramMD5HexClientResponse;
+import static org.apache.qpid.server.security.auth.sasl.SaslUtil.generatePlainClientResponse;
+
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.net.HttpURLConnection;
-import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import javax.crypto.Mac;
-import javax.crypto.spec.SecretKeySpec;
-
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
@@ -345,59 +345,6 @@ public class SaslRestTest extends QpidRe
         }
     }
 
-    private static byte SEPARATOR = 0;
-
-    private byte[] generatePlainClientResponse(String userName, String userPassword) throws Exception
-    {
-        byte[] password = userPassword.getBytes("UTF8");
-        byte user[] = userName.getBytes("UTF8");
-        byte response[] = new byte[password.length + user.length + 2 ];
-        int size = 0;
-        response[size++] = SEPARATOR;
-        System.arraycopy(user, 0, response, size, user.length);
-        size += user.length;
-        response[size++] = SEPARATOR;
-        System.arraycopy(password, 0, response, size, password.length);
-        return response;
-    }
-
-    private byte[] generateCramMD5HexClientResponse(String userName, String userPassword, byte[] challengeBytes) throws Exception
-    {
-        String macAlgorithm = "HmacMD5";
-        byte[] digestedPasswordBytes = MessageDigest.getInstance("MD5").digest(userPassword.getBytes("UTF-8"));
-        byte[] hexEncodedDigestedPasswordBytes = toHex(digestedPasswordBytes).getBytes("UTF-8");
-        Mac mac = Mac.getInstance(macAlgorithm);
-        mac.init(new SecretKeySpec(hexEncodedDigestedPasswordBytes, macAlgorithm));
-        final byte[] messageAuthenticationCode = mac.doFinal(challengeBytes);
-        String responseAsString = userName + " " + toHex(messageAuthenticationCode);
-        return responseAsString.getBytes();
-    }
-
-    private byte[] generateCramMD5ClientResponse(String userName, String userPassword, byte[] challengeBytes) throws Exception
-    {
-        String macAlgorithm = "HmacMD5";
-        Mac mac = Mac.getInstance(macAlgorithm);
-        mac.init(new SecretKeySpec(userPassword.getBytes("UTF-8"), macAlgorithm));
-        final byte[] messageAuthenticationCode = mac.doFinal(challengeBytes);
-        String responseAsString = userName + " " + toHex(messageAuthenticationCode);
-        return responseAsString.getBytes();
-    }
-
-    private String toHex(byte[] data)
-    {
-        StringBuffer hash = new StringBuffer();
-        for (int i = 0; i < data.length; i++)
-        {
-            String hex = Integer.toHexString(0xFF & data[i]);
-            if (hex.length() == 1)
-            {
-                hash.append('0');
-            }
-            hash.append(hex);
-        }
-        return hash.toString();
-    }
-
     private void configureBase64MD5FilePrincipalDatabase() throws IOException, ConfigurationException
     {
         // generate user password entry

Modified: qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/TrustStoreRestTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/TrustStoreRestTest.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/TrustStoreRestTest.java (original)
+++ qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/TrustStoreRestTest.java Fri Apr 19 15:50:07 2013
@@ -114,6 +114,7 @@ public class TrustStoreRestTest extends 
         sslPortAttributes.put(Port.TRANSPORTS, Collections.singleton(Transport.SSL));
         sslPortAttributes.put(Port.PORT, DEFAULT_SSL_PORT);
         sslPortAttributes.put(Port.NAME, TestBrokerConfiguration.ENTRY_NAME_SSL_PORT);
+        sslPortAttributes.put(Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
         sslPortAttributes.put(Port.KEY_STORE, TestBrokerConfiguration.ENTRY_NAME_SSL_KEYSTORE);
         sslPortAttributes.put(Port.TRUST_STORES, Collections.singleton(name));
         getBrokerConfiguration().addPortConfiguration(sslPortAttributes);

Modified: qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java (original)
+++ qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java Fri Apr 19 15:50:07 2013
@@ -260,8 +260,6 @@ public class BrokerACLTest extends QpidR
         String portName = TestBrokerConfiguration.ENTRY_NAME_AMQP_PORT;
         assertPortExists(portName);
 
-        restartBrokerInManagementMode();
-
         getRestTestHelper().setUsernameAndPassword(DENIED_USER, DENIED_USER);
 
         int responseCode = getRestTestHelper().submitRequest("/rest/port/" + portName, "DELETE", null);
@@ -270,15 +268,14 @@ public class BrokerACLTest extends QpidR
         assertPortExists(portName);
     }
 
-    public void testDeletePortAllowed() throws Exception
+    // TODO:  test disabled until allowing the deletion of active ports outside management mode
+    public void DISABLED_testDeletePortAllowed() throws Exception
     {
         getRestTestHelper().setUsernameAndPassword(ALLOWED_USER, ALLOWED_USER);
 
         String portName = TestBrokerConfiguration.ENTRY_NAME_AMQP_PORT;
         assertPortExists(portName);
 
-        restartBrokerInManagementMode();
-
         getRestTestHelper().setUsernameAndPassword(ALLOWED_USER, ALLOWED_USER);
 
         int responseCode = getRestTestHelper().submitRequest("/rest/port/" + portName, "DELETE", null);
@@ -287,7 +284,8 @@ public class BrokerACLTest extends QpidR
         assertPortDoesNotExist(portName);
     }
 
-    public void testSetPortAttributesAllowed() throws Exception
+    // TODO:  test disabled until allowing the updating of active ports outside management mode
+    public void DISABLED_testSetPortAttributesAllowed() throws Exception
     {
         getRestTestHelper().setUsernameAndPassword(ALLOWED_USER, ALLOWED_USER);
 
@@ -298,7 +296,6 @@ public class BrokerACLTest extends QpidR
 
         assertPortExists(portName);
 
-        restartBrokerInManagementMode();
 
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(Port.NAME, portName);
@@ -322,8 +319,6 @@ public class BrokerACLTest extends QpidR
 
         assertPortExists(portName);
 
-        restartBrokerInManagementMode();
-
         getRestTestHelper().setUsernameAndPassword(DENIED_USER, DENIED_USER);
 
         Map<String, Object> attributes = new HashMap<String, Object>();
@@ -600,42 +595,45 @@ public class BrokerACLTest extends QpidR
     {
         getRestTestHelper().setUsernameAndPassword(ALLOWED_USER, ALLOWED_USER);
 
-        String defaultAuthenticationProvider = TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER;
+        int initialAlertRepeatGap = 30000;
+        int updatedAlertRepeatGap = 29999;
+
         Map<String, Object> brokerAttributes = getRestTestHelper().getJsonAsSingletonList("/rest/broker");
-        assertEquals("Unexpected authentication provider", defaultAuthenticationProvider,
-                brokerAttributes.get(Broker.DEFAULT_AUTHENTICATION_PROVIDER));
-        restartBrokerInManagementMode();
+        assertEquals("Unexpected alert repeat gap", initialAlertRepeatGap,
+                brokerAttributes.get(Broker.QUEUE_ALERT_REPEAT_GAP));
 
         Map<String, Object> newAttributes = new HashMap<String, Object>();
-        newAttributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, ANONYMOUS_AUTHENTICATION_PROVIDER);
+        newAttributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, updatedAlertRepeatGap);
+
         int responseCode = getRestTestHelper().submitRequest("/rest/broker", "PUT", newAttributes);
         assertEquals("Setting of port attribites should be allowed", 200, responseCode);
 
         brokerAttributes = getRestTestHelper().getJsonAsSingletonList("/rest/broker");
-        assertEquals("Unexpected default authentication provider attribute value", ANONYMOUS_AUTHENTICATION_PROVIDER,
-                brokerAttributes.get(Broker.DEFAULT_AUTHENTICATION_PROVIDER));
+        assertEquals("Unexpected default alert repeat gap", updatedAlertRepeatGap,
+                brokerAttributes.get(Broker.QUEUE_ALERT_REPEAT_GAP));
     }
 
     public void testSetBrokerAttributesDenied() throws Exception
     {
         getRestTestHelper().setUsernameAndPassword(ALLOWED_USER, ALLOWED_USER);
 
-        String defaultAuthenticationProvider = TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER;
+        int initialAlertRepeatGap = 30000;
+        int updatedAlertRepeatGap = 29999;
 
         Map<String, Object> brokerAttributes = getRestTestHelper().getJsonAsSingletonList("/rest/broker");
-        assertEquals("Unexpected authentication provider", defaultAuthenticationProvider,
-                brokerAttributes.get(Broker.DEFAULT_AUTHENTICATION_PROVIDER));
-        restartBrokerInManagementMode();
+        assertEquals("Unexpected alert repeat gap", initialAlertRepeatGap,
+                brokerAttributes.get(Broker.QUEUE_ALERT_REPEAT_GAP));
 
         getRestTestHelper().setUsernameAndPassword(DENIED_USER, DENIED_USER);
         Map<String, Object> newAttributes = new HashMap<String, Object>();
-        newAttributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, ANONYMOUS_AUTHENTICATION_PROVIDER);
+        newAttributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, updatedAlertRepeatGap);
+
         int responseCode = getRestTestHelper().submitRequest("/rest/broker", "PUT", newAttributes);
         assertEquals("Setting of port attribites should be allowed", 403, responseCode);
 
         brokerAttributes = getRestTestHelper().getJsonAsSingletonList("/rest/broker");
-        assertEquals("Unexpected default authentication provider attribute value", defaultAuthenticationProvider,
-                brokerAttributes.get(Broker.DEFAULT_AUTHENTICATION_PROVIDER));
+        assertEquals("Unexpected default alert repeat gap", initialAlertRepeatGap,
+                brokerAttributes.get(Broker.QUEUE_ALERT_REPEAT_GAP));
     }
 
     private int createPort(String portName) throws Exception

Modified: qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java (original)
+++ qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java Fri Apr 19 15:50:07 2013
@@ -184,6 +184,7 @@ public class QpidBrokerTestCase extends 
     protected List<Connection> _connections = new ArrayList<Connection>();
     public static final String QUEUE = "queue";
     public static final String TOPIC = "topic";
+    public static final String MANAGEMENT_MODE_PASSWORD = "mm_password";
 
     /** Map to hold test defined environment properties */
     private Map<String, String> _env;
@@ -467,6 +468,10 @@ public class QpidBrokerTestCase extends 
             options.setConfigurationStoreType(_brokerStoreType);
             options.setConfigurationStoreLocation(testConfig);
             options.setManagementMode(managementMode);
+            if (managementMode)
+            {
+                options.setManagementModePassword(MANAGEMENT_MODE_PASSWORD);
+            }
 
             //Set the log config file, relying on the log4j.configuration system property
             //set on the JVM by the JUnit runner task in module.xml.
@@ -486,9 +491,11 @@ public class QpidBrokerTestCase extends 
             String[] cmd = _brokerCommandHelper.getBrokerCommand(port, testConfig, _brokerStoreType, _logConfigFile);
             if (managementMode)
             {
-                String[] newCmd = new String[cmd.length + 1];
+                String[] newCmd = new String[cmd.length + 3];
                 System.arraycopy(cmd, 0, newCmd, 0, cmd.length);
                 newCmd[cmd.length] = "-mm";
+                newCmd[cmd.length + 1] = "-mmpass";
+                newCmd[cmd.length + 2] = MANAGEMENT_MODE_PASSWORD;
                 cmd = newCmd;
             }
             _logger.info("Starting spawn broker using command: " + StringUtils.join(cmd, ' '));

Propchange: qpid/branches/0.22/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/CPPExcludes
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/CPPExcludes:r1468830

Modified: qpid/branches/0.22/qpid/java/test-profiles/Excludes
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/test-profiles/Excludes?rev=1469915&r1=1469914&r2=1469915&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/test-profiles/Excludes (original)
+++ qpid/branches/0.22/qpid/java/test-profiles/Excludes Fri Apr 19 15:50:07 2013
@@ -17,16 +17,4 @@
 // under the License.
 //
 
-//
-// QPID-2031 : Broker is not cleanly shutdown by QpidTestCase
-//
-org.apache.qpid.server.logging.BrokerLoggingTest#testBrokerShutdownListeningTCPDefault
-org.apache.qpid.server.logging.BrokerLoggingTest#testBrokerShutdownListeningTCPSSL
-org.apache.qpid.server.logging.BrokerLoggingTest#testBrokerShutdownStopped
-org.apache.qpid.server.logging.VirtualHostLoggingTest#testVirtualhostClosure
-org.apache.qpid.server.logging.MemoryMessageStoreLoggingTest#testMessageStoreClose
-
-// QPID-3424 : Test fails to start external broker due to Derby Exception.
-org.apache.qpid.server.logging.DerbyMessageStoreLoggingTest#*
-
 org.apache.qpid.client.ssl.SSLTest#testVerifyLocalHostLocalDomain

Propchange: qpid/branches/0.22/qpid/java/test-profiles/Excludes
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/Excludes:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/JavaBDBExcludes
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/JavaBDBExcludes:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/JavaExcludes
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/JavaExcludes:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/JavaPre010Excludes
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/JavaPre010Excludes:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/JavaTransientExcludes
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/XAExcludes
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/XAExcludes:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/cpp.async.testprofile
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/cpp.async.testprofile:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/cpp.cluster.testprofile
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/cpp.cluster.testprofile:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/cpp.noprefetch.testprofile
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/cpp.noprefetch.testprofile:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/cpp.ssl.excludes
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/cpp.ssl.excludes:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/cpp.ssl.testprofile
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/cpp.ssl.testprofile:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/cpp.testprofile
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/cpp.testprofile:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/java-bdb-spawn.0-9-1.testprofile
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-9-1.testprofile:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/java-bdb.0-9-1.testprofile
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/java-bdb.0-9-1.testprofile:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/java-dby-spawn.0-9-1.testprofile
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/java-dby-spawn.0-9-1.testprofile:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/java-dby.0-9-1.testprofile
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/java-dby.0-9-1.testprofile:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/java-mms-spawn.0-10.testprofile
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/java-mms-spawn.0-10.testprofile:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/java-mms-spawn.0-9-1.testprofile
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/java-mms-spawn.0-9-1.testprofile:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/java-mms.0-9-1.testprofile
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/java-mms.0-9-1.testprofile:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/log4j-test.xml
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/log4j-test.xml:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/test-provider.properties
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/test-provider.properties:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/test_resources/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/test_resources:r1468830

Propchange: qpid/branches/0.22/qpid/java/test-profiles/testprofile.defaults
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/test-profiles/testprofile.defaults:r1468830



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