qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject svn commit: r1416595 - in /qpid/branches/java-broker-config-qpid-4390/qpid/java: bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/ broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ broker/src/main/java/org/ap...
Date Mon, 03 Dec 2012 17:14:11 GMT
Author: orudyy
Date: Mon Dec  3 17:14:08 2012
New Revision: 1416595

URL: http://svn.apache.org/viewvc?rev=1416595&view=rev
Log:
QPID-4390: remove references to ApplicationRegistry from jmx management console

Modified:
    qpid/branches/java-broker-config-qpid-4390/qpid/java/bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/BDBHAMessageStoreManagerMBeanProvider.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/MBeanInvocationHandlerImpl.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHost.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/rmi/RMIPasswordAuthenticator.java
    qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/rmi/RMIPasswordAuthenticatorTest.java

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/BDBHAMessageStoreManagerMBeanProvider.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/BDBHAMessageStoreManagerMBeanProvider.java?rev=1416595&r1=1416594&r2=1416595&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/BDBHAMessageStoreManagerMBeanProvider.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/BDBHAMessageStoreManagerMBeanProvider.java
Mon Dec  3 17:14:08 2012
@@ -28,9 +28,7 @@ import org.apache.qpid.server.jmx.MBeanP
 import org.apache.qpid.server.jmx.ManagedObject;
 import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.store.berkeleydb.BDBHAMessageStore;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
 
 /**
  * This provide will create a {@link BDBHAMessageStoreManagerMBean} if the child is a virtual
@@ -58,10 +56,7 @@ public class BDBHAMessageStoreManagerMBe
     {
         VirtualHost virtualHostChild = (VirtualHost) child;
 
-        VirtualHostRegistry virtualHostRegistry = ApplicationRegistry.getInstance().getVirtualHostRegistry();
-        org.apache.qpid.server.virtualhost.VirtualHost vhost = virtualHostRegistry.getVirtualHost(virtualHostChild.getName());
-
-        BDBHAMessageStore messageStore = (BDBHAMessageStore) vhost.getMessageStore();
+        BDBHAMessageStore messageStore = (BDBHAMessageStore) virtualHostChild.getMessageStore();
 
         if (LOGGER.isDebugEnabled())
         {

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java?rev=1416595&r1=1416594&r2=1416595&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java
Mon Dec  3 17:14:08 2012
@@ -24,12 +24,12 @@ import org.apache.log4j.Logger;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.logging.actors.CurrentActor;
 import org.apache.qpid.server.logging.messages.ManagementConsoleMessages;
+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.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.IApplicationRegistry;
 import org.apache.qpid.server.security.auth.rmi.RMIPasswordAuthenticator;
+
 import javax.management.JMException;
 import javax.management.MBeanServer;
 import javax.management.MBeanServerFactory;
@@ -45,7 +45,6 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
 import java.net.InetAddress;
-import java.net.InetSocketAddress;
 import java.net.UnknownHostException;
 import java.rmi.AlreadyBoundException;
 import java.rmi.NoSuchObjectException;
@@ -157,8 +156,7 @@ public class JMXManagedObjectRegistry im
         int jmxPortConnectorServer = _connectorPort.getPort();
 
         //add a JMXAuthenticator implementation the env map to authenticate the RMI based
JMX connector server
-        final IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
-        RMIPasswordAuthenticator rmipa = new RMIPasswordAuthenticator(appRegistry, new InetSocketAddress(jmxPortRegistryServer));
+        RMIPasswordAuthenticator rmipa = new RMIPasswordAuthenticator(_registryPort);
         HashMap<String,Object> connectorEnv = new HashMap<String,Object>();
         connectorEnv.put(JMXConnectorServer.AUTHENTICATOR, rmipa);
 
@@ -239,12 +237,14 @@ public class JMXManagedObjectRegistry im
             }
         };
 
+        Broker broker = _registryPort.getParent(Broker.class);
+
         //Add the custom invoker as an MBeanServerForwarder, and start the RMIConnectorServer.
-        MBeanServerForwarder mbsf = MBeanInvocationHandlerImpl.newProxyInstance(_jmxConfiguration);
+        MBeanServerForwarder mbsf = MBeanInvocationHandlerImpl.newProxyInstance(broker, _jmxConfiguration);
         _cs.setMBeanServerForwarder(mbsf);
 
         // Install a ManagementLogonLogoffReporter so we can report as users logon/logoff
-        ManagementLogonLogoffReporter jmxManagementUserLogonLogoffReporter = new ManagementLogonLogoffReporter(appRegistry.getRootMessageLogger(),
usernameCachingRmiServer);
+        ManagementLogonLogoffReporter jmxManagementUserLogonLogoffReporter = new ManagementLogonLogoffReporter(broker.getRootMessageLogger(),
usernameCachingRmiServer);
         _cs.addNotificationListener(jmxManagementUserLogonLogoffReporter, jmxManagementUserLogonLogoffReporter,
null);
 
         // Install the usernameCachingRmiServer as a listener so it may cleanup as clients
disconnect

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/MBeanInvocationHandlerImpl.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/MBeanInvocationHandlerImpl.java?rev=1416595&r1=1416594&r2=1416595&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/MBeanInvocationHandlerImpl.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/MBeanInvocationHandlerImpl.java
Mon Dec  3 17:14:08 2012
@@ -24,8 +24,8 @@ import org.apache.log4j.Logger;
 
 import org.apache.qpid.server.logging.actors.CurrentActor;
 import org.apache.qpid.server.logging.actors.ManagementActor;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.IApplicationRegistry;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.VirtualHost;
 import org.apache.qpid.server.security.SecurityManager;
 import org.apache.qpid.server.security.access.Operation;
 import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
@@ -55,21 +55,23 @@ public class MBeanInvocationHandlerImpl 
 {
     private static final Logger _logger = Logger.getLogger(MBeanInvocationHandlerImpl.class);
 
-    private final IApplicationRegistry _appRegistry = ApplicationRegistry.getInstance();
     private final static String DELEGATE = "JMImplementation:type=MBeanServerDelegate";
     private MBeanServer _mbs;
-    private final ManagementActor _logActor = new ManagementActor(_appRegistry.getRootMessageLogger());
+    private final ManagementActor _logActor;
 
     private final boolean _managementRightsInferAllAccess;
+    private final Broker _broker;
 
-    MBeanInvocationHandlerImpl(boolean managementRightsInferAllAccess)
+    MBeanInvocationHandlerImpl(Broker broker, boolean managementRightsInferAllAccess)
     {
         _managementRightsInferAllAccess = managementRightsInferAllAccess;
+        _broker = broker;
+        _logActor = new ManagementActor(broker.getRootMessageLogger());
     }
 
-    public static MBeanServerForwarder newProxyInstance(JMXConfiguration configuration)
+    public static MBeanServerForwarder newProxyInstance(Broker broker, JMXConfiguration configuration)
     {
-        final InvocationHandler handler = new MBeanInvocationHandlerImpl(configuration.isManagementRightsInferAllAccess());
+        final InvocationHandler handler = new MBeanInvocationHandlerImpl(broker, configuration.isManagementRightsInferAllAccess());
         final Class<?>[] interfaces = new Class[] { MBeanServerForwarder.class };
 
         Object proxy = Proxy.newProxyInstance(MBeanServerForwarder.class.getClassLoader(),
interfaces, handler);
@@ -211,11 +213,16 @@ public class MBeanInvocationHandlerImpl 
         SecurityManager security;
         if (vhost == null)
         {
-            security = _appRegistry.getSecurityManager();
+            security = _broker.getSecurityManager();
         }
         else
         {
-            security = _appRegistry.getVirtualHostRegistry().getVirtualHost(vhost).getSecurityManager();
+            VirtualHost virtualHost = _broker.findVirtualHostByName(vhost);
+            if (virtualHost == null)
+            {
+                throw new IllegalArgumentException("Virtual host with name '" + vhost + "'
is not found.");
+            }
+            security = virtualHost.getSecurityManager();
         }
 
         methodName = getMethodName(method, args);

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java?rev=1416595&r1=1416594&r2=1416595&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java
Mon Dec  3 17:14:08 2012
@@ -125,4 +125,6 @@ public interface Broker extends Configur
      */
     LogRecorder getLogRecorder();
 
+    VirtualHost findVirtualHostByName(String name);
+
 }

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHost.java?rev=1416595&r1=1416594&r2=1416595&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHost.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHost.java
Mon Dec  3 17:14:08 2012
@@ -22,6 +22,7 @@ package org.apache.qpid.server.model;
 
 import org.apache.qpid.server.queue.QueueEntry;
 import org.apache.qpid.server.security.SecurityManager;
+import org.apache.qpid.server.store.MessageStore;
 
 import java.security.AccessControlException;
 import java.util.Arrays;
@@ -157,4 +158,6 @@ public interface VirtualHost extends Con
      * TODO We need to add and implement an authorization provider configured object instead
      */
     SecurityManager getSecurityManager();
+
+    MessageStore getMessageStore();
 }

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java?rev=1416595&r1=1416594&r2=1416595&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
Mon Dec  3 17:14:08 2012
@@ -713,4 +713,10 @@ public class BrokerAdapter extends Abstr
     {
         return _applicationRegistry.getLogRecorder();
     }
+
+    @Override
+    public VirtualHost findVirtualHostByName(String name)
+    {
+        return _vhostAdapters.get(name);
+    }
 }

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java?rev=1416595&r1=1416594&r2=1416595&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
Mon Dec  3 17:14:08 2012
@@ -957,4 +957,10 @@ public final class VirtualHostAdapter ex
         return _virtualHost.getSecurityManager();
     }
 
+    @Override
+    public MessageStore getMessageStore()
+    {
+        return _virtualHost.getMessageStore();
+    }
+
 }

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/rmi/RMIPasswordAuthenticator.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/rmi/RMIPasswordAuthenticator.java?rev=1416595&r1=1416594&r2=1416595&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/rmi/RMIPasswordAuthenticator.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/rmi/RMIPasswordAuthenticator.java
Mon Dec  3 17:14:08 2012
@@ -20,9 +20,8 @@
  */
 package org.apache.qpid.server.security.auth.rmi;
 
-import java.net.SocketAddress;
-
-import org.apache.qpid.server.registry.IApplicationRegistry;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.Port;
 import org.apache.qpid.server.security.SecurityManager;
 import org.apache.qpid.server.security.SubjectCreator;
 import org.apache.qpid.server.security.auth.AuthenticationResult.AuthenticationStatus;
@@ -42,13 +41,11 @@ public class RMIPasswordAuthenticator im
     static final String CREDENTIALS_REQUIRED = "User details are required. " +
                         "Please ensure you are using an up to date management console to
connect.";
 
-    private final IApplicationRegistry _appRegistry;
-    private final SocketAddress _socketAddress;
+    private final Port _registryPort;
 
-    public RMIPasswordAuthenticator(IApplicationRegistry appRegistry, SocketAddress socketAddress)
+    public RMIPasswordAuthenticator(Port registryPort)
     {
-        _appRegistry = appRegistry;
-        _socketAddress = socketAddress;
+        _registryPort = registryPort;
     }
 
     public Subject authenticate(Object credentials) throws SecurityException
@@ -94,10 +91,10 @@ public class RMIPasswordAuthenticator im
             throw new SecurityException(SHOULD_BE_NON_NULL);
         }
 
-        SubjectCreator subjectCreator = _appRegistry.getSubjectCreator(_socketAddress);
+        SubjectCreator subjectCreator = _registryPort.getAuthenticationProvider().getSubjectCreator();
         if (subjectCreator == null)
         {
-            throw new SecurityException("Can't get subject creator for " + _socketAddress);
+            throw new SecurityException("Can't get subject creator for " + _registryPort.getBindingAddress());
         }
 
         final SubjectAuthenticationResult result = subjectCreator.authenticate(username,
password);
@@ -119,9 +116,10 @@ public class RMIPasswordAuthenticator im
     private void doManagementAuthorisation(Subject authenticatedSubject)
     {
         SecurityManager.setThreadSubject(authenticatedSubject);
+        Broker broker = _registryPort.getParent(Broker.class);
         try
         {
-            if (!_appRegistry.getSecurityManager().accessManagement())
+            if (!broker.getSecurityManager().accessManagement())
             {
                 throw new SecurityException(USER_NOT_AUTHORISED_FOR_MANAGEMENT);
             }

Modified: qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/rmi/RMIPasswordAuthenticatorTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/rmi/RMIPasswordAuthenticatorTest.java?rev=1416595&r1=1416594&r2=1416595&view=diff
==============================================================================
--- qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/rmi/RMIPasswordAuthenticatorTest.java
(original)
+++ qpid/branches/java-broker-config-qpid-4390/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/rmi/RMIPasswordAuthenticatorTest.java
Mon Dec  3 17:14:08 2012
@@ -24,14 +24,15 @@ import static org.mockito.Matchers.anySt
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
-import java.net.InetSocketAddress;
 import java.security.Principal;
 
 import javax.security.auth.Subject;
 
 import junit.framework.TestCase;
 
-import org.apache.qpid.server.registry.ApplicationRegistry;
+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.security.SubjectCreator;
 import org.apache.qpid.server.security.auth.AuthenticationResult;
 import org.apache.qpid.server.security.auth.AuthenticationResult.AuthenticationStatus;
@@ -47,9 +48,10 @@ public class RMIPasswordAuthenticatorTes
     private static final String USERNAME = "guest";
     private static final String PASSWORD = "password";
 
-    private final ApplicationRegistry _applicationRegistry = mock(ApplicationRegistry.class);
+    private final Broker _broker = mock(Broker.class);
+    private final Port _rmiPort = mock(Port.class);
+    private final AuthenticationProvider _authenticationProvider = mock(AuthenticationProvider.class);
     private final SecurityManager _securityManager = mock(SecurityManager.class);
-    private final InetSocketAddress _jmxSocketAddress = new InetSocketAddress(8999);
     private final Subject _loginSubject = new Subject();
     private final String[] _credentials = new String[] {USERNAME, PASSWORD};
 
@@ -60,9 +62,11 @@ public class RMIPasswordAuthenticatorTes
 
     protected void setUp() throws Exception
     {
-        _rmipa = new RMIPasswordAuthenticator(_applicationRegistry, _jmxSocketAddress);
-
-        when(_applicationRegistry.getSecurityManager()).thenReturn(_securityManager);
+        when(_rmiPort.getBindingAddress()).thenReturn("0.0.0.0:8999");
+        when(_rmiPort.getAuthenticationProvider()).thenReturn(_authenticationProvider);
+        when(_rmiPort.getParent(Broker.class)).thenReturn(_broker);
+        when(_broker.getSecurityManager()).thenReturn(_securityManager);
+        _rmipa = new RMIPasswordAuthenticator(_rmiPort);
     }
 
     /**
@@ -70,7 +74,7 @@ public class RMIPasswordAuthenticatorTes
      */
     public void testAuthenticationSuccess()
     {
-        when(_applicationRegistry.getSubjectCreator(_jmxSocketAddress)).thenReturn(_usernamePasswordOkaySuvjectCreator);
+        when(_authenticationProvider.getSubjectCreator()).thenReturn(_usernamePasswordOkaySuvjectCreator);
         when(_securityManager.accessManagement()).thenReturn(true);
 
         Subject newSubject = _rmipa.authenticate(_credentials);
@@ -82,7 +86,7 @@ public class RMIPasswordAuthenticatorTes
      */
     public void testUsernameOrPasswordInvalid()
     {
-        when(_applicationRegistry.getSubjectCreator(_jmxSocketAddress)).thenReturn(_badPasswordSubjectCreator);
+        when(_authenticationProvider.getSubjectCreator()).thenReturn(_badPasswordSubjectCreator);
 
         try
         {
@@ -98,7 +102,7 @@ public class RMIPasswordAuthenticatorTes
 
     public void testAuthorisationFailure()
     {
-        when(_applicationRegistry.getSubjectCreator(_jmxSocketAddress)).thenReturn(_usernamePasswordOkaySuvjectCreator);
+        when(_authenticationProvider.getSubjectCreator()).thenReturn(_usernamePasswordOkaySuvjectCreator);
         when(_securityManager.accessManagement()).thenReturn(false);
 
         try
@@ -117,7 +121,7 @@ public class RMIPasswordAuthenticatorTes
     {
         final Exception mockAuthException = new Exception("Mock Auth system failure");
         SubjectCreator subjectCreator = createMockSubjectCreator(false, mockAuthException);
-        when(_applicationRegistry.getSubjectCreator(_jmxSocketAddress)).thenReturn(subjectCreator);
+        when(_authenticationProvider.getSubjectCreator()).thenReturn(subjectCreator);
 
         try
         {
@@ -135,7 +139,7 @@ public class RMIPasswordAuthenticatorTes
      */
     public void testNullSubjectCreator() throws Exception
     {
-        when(_applicationRegistry.getSubjectCreator(_jmxSocketAddress)).thenReturn(null);
+        when(_authenticationProvider.getSubjectCreator()).thenReturn(null);
 
         try
         {
@@ -145,7 +149,7 @@ public class RMIPasswordAuthenticatorTes
         catch (SecurityException se)
         {
             assertEquals("Unexpected exception message",
-                    "Can't get subject creator for 0.0.0.0/0.0.0.0:8999", se.getMessage());
+                    "Can't get subject creator for 0.0.0.0:8999", se.getMessage());
         }
     }
 



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


Mime
View raw message