diff options
| author | Robert Godfrey <rgodfrey@apache.org> | 2014-04-30 01:22:13 +0000 |
|---|---|---|
| committer | Robert Godfrey <rgodfrey@apache.org> | 2014-04-30 01:22:13 +0000 |
| commit | ae71aa7102a41735e49ec5c98409bc69fffd9a8f (patch) | |
| tree | f0709ee8c5993d6995e5de59c0cdc855a540614e /qpid/java/systests/src | |
| parent | 0d49f2fa419a414e1c9548001fcbde03d442f5c1 (diff) | |
| download | qpid-python-ae71aa7102a41735e49ec5c98409bc69fffd9a8f.tar.gz | |
QPID-5578 : [Java Broker] Use annotation to allow registration of all ConfiguredObject types at startup. Use this meta data for REST servlets. Remove unnecessary pluggable factory interfaces
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1591170 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests/src')
20 files changed, 95 insertions, 95 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java index 31888167af..1faacbb079 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java @@ -34,7 +34,7 @@ import org.apache.qpid.server.management.plugin.HttpManagement; import org.apache.qpid.server.model.AuthenticationProvider; import org.apache.qpid.server.model.Plugin; import org.apache.qpid.server.model.Port; -import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManagerFactory; +import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManager; import org.apache.qpid.systest.rest.RestTestHelper; import org.apache.qpid.test.utils.TestBrokerConfiguration; @@ -159,7 +159,7 @@ public class AlertingTest extends AbstractTestLogging config.removeObjectConfiguration(Port.class, TestBrokerConfiguration.ENTRY_NAME_RMI_PORT); Map<String, Object> anonymousProviderAttributes = new HashMap<String, Object>(); - anonymousProviderAttributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE); + anonymousProviderAttributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManager.PROVIDER_TYPE); anonymousProviderAttributes.put(AuthenticationProvider.NAME, "testAnonymous"); config.addObjectConfiguration(AuthenticationProvider.class, anonymousProviderAttributes); diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java index e58fa0c45d..0d0c1257a2 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java @@ -284,7 +284,7 @@ public class ExternalAuthenticationTest extends QpidBrokerTestCase JMXTestUtils jmxUtils = new JMXTestUtils(this); setCommonBrokerSSLProperties(true); - getBrokerConfiguration().setObjectAttribute(AuthenticationProvider.class, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER, ExternalAuthenticationManagerFactory.ATTRIBUTE_USE_FULL_DN, "true"); + getBrokerConfiguration().setObjectAttribute(AuthenticationProvider.class, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER, ExternalAuthenticationManager.ATTRIBUTE_USE_FULL_DN, "true"); getBrokerConfiguration().addJmxManagementConfiguration(); super.setUp(); @@ -348,7 +348,7 @@ public class ExternalAuthenticationTest extends QpidBrokerTestCase Map<String, Object> externalAuthProviderAttributes = new HashMap<String, Object>(); externalAuthProviderAttributes.put(AuthenticationProvider.NAME, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER); - externalAuthProviderAttributes.put(AuthenticationProvider.TYPE, ExternalAuthenticationManagerFactory.PROVIDER_TYPE); + externalAuthProviderAttributes.put(AuthenticationProvider.TYPE, ExternalAuthenticationManager.PROVIDER_TYPE); config.addObjectConfiguration(AuthenticationProvider.class, externalAuthProviderAttributes); config.setObjectAttribute(Port.class, TestBrokerConfiguration.ENTRY_NAME_SSL_PORT, Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER); diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/MultipleAuthenticationManagersTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/MultipleAuthenticationManagersTest.java index ae5785ba89..1c32a3f671 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/MultipleAuthenticationManagersTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/MultipleAuthenticationManagersTest.java @@ -48,7 +48,7 @@ public class MultipleAuthenticationManagersTest extends QpidBrokerTestCase TestBrokerConfiguration config = getBrokerConfiguration(); Map<String, Object> externalAuthProviderAttributes = new HashMap<String, Object>(); - externalAuthProviderAttributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE); + externalAuthProviderAttributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManager.PROVIDER_TYPE); externalAuthProviderAttributes.put(AuthenticationProvider.NAME, TestBrokerConfiguration.ENTRY_NAME_ANONYMOUS_PROVIDER); config.addObjectConfiguration(AuthenticationProvider.class, externalAuthProviderAttributes); diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java index 06f03faa37..32f936983f 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/store/VirtualHostMessageStoreTest.java @@ -20,7 +20,6 @@ */ package org.apache.qpid.server.store; -import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.io.File; @@ -31,6 +30,7 @@ import java.util.Map; import java.util.UUID; import org.apache.qpid.common.AMQPFilterTypes; +import org.apache.qpid.exchange.ExchangeDefaults; import org.apache.qpid.framing.AMQShortString; import org.apache.qpid.framing.BasicContentHeaderProperties; import org.apache.qpid.framing.ContentHeaderBody; @@ -39,9 +39,7 @@ import org.apache.qpid.framing.abstraction.MessagePublishInfo; import org.apache.qpid.framing.amqp_8_0.BasicConsumeBodyImpl; import org.apache.qpid.server.configuration.updater.TaskExecutor; import org.apache.qpid.server.configuration.updater.TaskExecutorImpl; -import org.apache.qpid.server.exchange.DirectExchange; import org.apache.qpid.server.exchange.ExchangeImpl; -import org.apache.qpid.server.exchange.TopicExchange; import org.apache.qpid.server.message.InstanceProperties; import org.apache.qpid.server.message.MessageSource; import org.apache.qpid.server.model.Binding; @@ -54,7 +52,6 @@ import org.apache.qpid.server.model.Queue; import org.apache.qpid.server.model.State; import org.apache.qpid.server.model.UUIDGenerator; import org.apache.qpid.server.model.VirtualHostNode; -import org.apache.qpid.server.plugin.ExchangeType; import org.apache.qpid.server.protocol.v0_8.AMQMessage; import org.apache.qpid.server.protocol.v0_8.MessageMetaData; import org.apache.qpid.server.queue.AMQQueue; @@ -176,15 +173,15 @@ public class VirtualHostMessageStoreTest extends QpidTestCase createAllTopicQueues(); //Register Non-Durable DirectExchange - ExchangeImpl<?> nonDurableExchange = createExchange(DirectExchange.TYPE, nonDurableExchangeName, false); + ExchangeImpl<?> nonDurableExchange = createExchange(ExchangeDefaults.DIRECT_EXCHANGE_CLASS, nonDurableExchangeName, false); bindAllQueuesToExchange(nonDurableExchange, directRouting); //Register DirectExchange - ExchangeImpl<?> directExchange = createExchange(DirectExchange.TYPE, directExchangeName, true); + ExchangeImpl<?> directExchange = createExchange(ExchangeDefaults.DIRECT_EXCHANGE_CLASS, directExchangeName, true); bindAllQueuesToExchange(directExchange, directRouting); //Register TopicExchange - ExchangeImpl<?> topicExchange = createExchange(TopicExchange.TYPE, topicExchangeName, true); + ExchangeImpl<?> topicExchange = createExchange(ExchangeDefaults.TOPIC_EXCHANGE_CLASS, topicExchangeName, true); bindAllTopicQueuesToExchange(topicExchange, topicRouting); //Send Message To NonDurable direct Exchange = persistent @@ -344,7 +341,7 @@ public class VirtualHostMessageStoreTest extends QpidTestCase { int origExchangeCount = _virtualHost.getExchanges().size(); - createExchange(DirectExchange.TYPE, directExchangeName, true); + createExchange(ExchangeDefaults.DIRECT_EXCHANGE_CLASS, directExchangeName, true); assertEquals("Incorrect number of exchanges registered before recovery", origExchangeCount + 1, _virtualHost.getExchanges().size()); @@ -408,7 +405,7 @@ public class VirtualHostMessageStoreTest extends QpidTestCase public void testDurableBindingRemoval() throws Exception { //create durable queue and exchange, bind them - ExchangeImpl<?> exch = createExchange(DirectExchange.TYPE, directExchangeName, true); + ExchangeImpl<?> exch = createExchange(ExchangeDefaults.DIRECT_EXCHANGE_CLASS, directExchangeName, true); createQueue(durableQueueName, false, true, false, false); bindQueueToExchange(exch, directRouting, _virtualHost.getQueue(durableQueueName), false); @@ -670,23 +667,23 @@ public class VirtualHostMessageStoreTest extends QpidTestCase Map<String, ExchangeImpl<?>> exchanges = new HashMap<String, ExchangeImpl<?>>(); //Register non-durable DirectExchange - exchanges.put(nonDurableExchangeName, createExchange(DirectExchange.TYPE, nonDurableExchangeName, false)); + exchanges.put(nonDurableExchangeName, createExchange(ExchangeDefaults.DIRECT_EXCHANGE_CLASS, nonDurableExchangeName, false)); //Register durable DirectExchange and TopicExchange - exchanges.put(directExchangeName ,createExchange(DirectExchange.TYPE, directExchangeName, true)); - exchanges.put(topicExchangeName,createExchange(TopicExchange.TYPE, topicExchangeName, true)); + exchanges.put(directExchangeName ,createExchange(ExchangeDefaults.DIRECT_EXCHANGE_CLASS, directExchangeName, true)); + exchanges.put(topicExchangeName,createExchange(ExchangeDefaults.TOPIC_EXCHANGE_CLASS, topicExchangeName, true)); return exchanges; } - private ExchangeImpl<?> createExchange(ExchangeType<?> type, String name, boolean durable) throws Exception + private ExchangeImpl<?> createExchange(String type, String name, boolean durable) throws Exception { ExchangeImpl<?> exchange = null; Map<String,Object> attributes = new HashMap<String, Object>(); attributes.put(org.apache.qpid.server.model.Exchange.NAME, name); - attributes.put(org.apache.qpid.server.model.Exchange.TYPE, type.getType()); + attributes.put(org.apache.qpid.server.model.Exchange.TYPE, type); attributes.put(org.apache.qpid.server.model.Exchange.DURABLE, durable); attributes.put(org.apache.qpid.server.model.Exchange.LIFETIME_POLICY, durable ? LifetimePolicy.DELETE_ON_NO_LINKS : LifetimePolicy.PERMANENT); diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/UserManagementTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/UserManagementTest.java index 922fb69845..25b09f04c3 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/UserManagementTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/UserManagementTest.java @@ -31,7 +31,7 @@ import javax.jms.JMSException; import org.apache.qpid.management.common.mbeans.UserManagement; import org.apache.qpid.server.model.AuthenticationProvider; -import org.apache.qpid.server.security.auth.manager.PlainPasswordFileAuthenticationManagerFactory; +import org.apache.qpid.server.security.auth.manager.PlainPasswordDatabaseAuthenticationManager; import org.apache.qpid.test.utils.JMXTestUtils; import org.apache.qpid.test.utils.QpidBrokerTestCase; import org.apache.qpid.test.utils.TestBrokerConfiguration; @@ -175,7 +175,7 @@ public class UserManagementTest extends QpidBrokerTestCase protected String getAuthenticationManagerType() { - return PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE; + return PlainPasswordDatabaseAuthenticationManager.PROVIDER_TYPE; } private File createTemporaryPasswordFileWithJmxAdminUser() throws Exception diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/UserManagementWithBase64MD5PasswordsTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/UserManagementWithBase64MD5PasswordsTest.java index 1423bc557e..ff441169b3 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/UserManagementWithBase64MD5PasswordsTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/management/jmx/UserManagementWithBase64MD5PasswordsTest.java @@ -18,7 +18,7 @@ */ package org.apache.qpid.systest.management.jmx; -import org.apache.qpid.server.security.auth.manager.Base64MD5PasswordFileAuthenticationManagerFactory; +import org.apache.qpid.server.security.auth.manager.Base64MD5PasswordDatabaseAuthenticationManager; import org.apache.qpid.tools.security.Passwd; public class UserManagementWithBase64MD5PasswordsTest extends UserManagementTest @@ -32,6 +32,6 @@ public class UserManagementWithBase64MD5PasswordsTest extends UserManagementTest @Override protected String getAuthenticationManagerType() { - return Base64MD5PasswordFileAuthenticationManagerFactory.PROVIDER_TYPE; + return Base64MD5PasswordDatabaseAuthenticationManager.PROVIDER_TYPE; } } diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AnonymousAccessRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AnonymousAccessRestTest.java index 79406cc81e..adbd8d6821 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AnonymousAccessRestTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AnonymousAccessRestTest.java @@ -29,7 +29,7 @@ import org.apache.qpid.server.model.AuthenticationProvider; import org.apache.qpid.server.model.Broker; import org.apache.qpid.server.model.Plugin; import org.apache.qpid.server.model.Port; -import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManagerFactory; +import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManager; import org.apache.qpid.test.utils.TestBrokerConfiguration; public class AnonymousAccessRestTest extends QpidRestTestCase @@ -52,7 +52,7 @@ public class AnonymousAccessRestTest extends QpidRestTestCase TestBrokerConfiguration config = getBrokerConfiguration(); Map<String, Object> anonymousAuthProviderAttributes = new HashMap<String, Object>(); - anonymousAuthProviderAttributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE); + anonymousAuthProviderAttributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManager.PROVIDER_TYPE); anonymousAuthProviderAttributes.put(AuthenticationProvider.NAME, TestBrokerConfiguration.ENTRY_NAME_ANONYMOUS_PROVIDER); config.addObjectConfiguration(AuthenticationProvider.class, anonymousAuthProviderAttributes); diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java index ac3c9251f7..cccf94c739 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java @@ -31,10 +31,10 @@ import java.util.Map; import javax.jms.JMSException; import org.apache.qpid.client.AMQConnection; -import org.apache.qpid.server.model.AbstractConfiguredObject; import org.apache.qpid.server.model.Binding; import org.apache.qpid.server.model.Broker; import org.apache.qpid.server.model.ConfiguredObject; +import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry; import org.apache.qpid.server.model.Connection; import org.apache.qpid.server.model.Exchange; import org.apache.qpid.server.model.ExclusivityPolicy; @@ -56,7 +56,7 @@ public class Asserts { assertNotNull("Virtualhost " + virtualHostName + " data are not found", virtualHost); assertAttributesPresent(virtualHost, - AbstractConfiguredObject.getAttributeNames(VirtualHost.class), + ConfiguredObjectTypeRegistry.getAttributeNames(VirtualHost.class), ConfiguredObject.CREATED_BY, ConfiguredObject.CREATED_TIME, ConfiguredObject.LAST_UPDATED_BY, @@ -105,7 +105,7 @@ public class Asserts { assertNotNull("Queue " + queueName + " is not found!", queueData); Asserts.assertAttributesPresent(queueData, - AbstractConfiguredObject.getAttributeNames(Queue.class), + ConfiguredObjectTypeRegistry.getAttributeNames(Queue.class), Queue.CREATED_BY, Queue.CREATED_TIME, Queue.LAST_UPDATED_BY, @@ -211,7 +211,7 @@ public class Asserts { assertNotNull("Unexpected connection data", connectionData); assertAttributesPresent(connectionData, - AbstractConfiguredObject.getAttributeNames(Connection.class), + ConfiguredObjectTypeRegistry.getAttributeNames(Connection.class), Connection.STATE, Connection.DURABLE, Connection.LIFETIME_POLICY, @@ -271,7 +271,7 @@ public class Asserts if ("AMQP".equals(port.get(ConfiguredObject.TYPE))) { assertAttributesPresent(port, - AbstractConfiguredObject.getAttributeNames(Port.class), + ConfiguredObjectTypeRegistry.getAttributeNames(Port.class), ConfiguredObject.TYPE, ConfiguredObject.CREATED_BY, ConfiguredObject.CREATED_TIME, @@ -288,7 +288,7 @@ public class Asserts else { assertAttributesPresent(port, - AbstractConfiguredObject.getAttributeNames(Port.class), + ConfiguredObjectTypeRegistry.getAttributeNames(Port.class), ConfiguredObject.TYPE, ConfiguredObject.CREATED_BY, ConfiguredObject.CREATED_TIME, @@ -325,7 +325,7 @@ public class Asserts public static void assertExchange(String exchangeName, String type, Map<String, Object> exchangeData) { assertNotNull("Exchange " + exchangeName + " is not found!", exchangeData); - assertAttributesPresent(exchangeData, AbstractConfiguredObject.getAttributeNames(Exchange.class), + assertAttributesPresent(exchangeData, ConfiguredObjectTypeRegistry.getAttributeNames(Exchange.class), Exchange.ALTERNATE_EXCHANGE, ConfiguredObject.CREATED_BY, ConfiguredObject.CREATED_TIME, @@ -360,7 +360,7 @@ public class Asserts { assertNotNull("Binding map should not be null", binding); assertAttributesPresent(binding, - AbstractConfiguredObject.getAttributeNames(Binding.class), + ConfiguredObjectTypeRegistry.getAttributeNames(Binding.class), Binding.STATE, ConfiguredObject.TYPE, ConfiguredObject.CREATED_BY, diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java index 8d9f1997f0..6f4b553530 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java @@ -27,15 +27,16 @@ import java.util.Map; import java.util.UUID; import org.apache.qpid.server.BrokerOptions; -import org.apache.qpid.server.model.AbstractConfiguredObject; import org.apache.qpid.server.model.AuthenticationProvider; import org.apache.qpid.server.model.ConfiguredObject; +import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry; +import org.apache.qpid.server.model.ExternalFileBasedAuthenticationManager; import org.apache.qpid.server.model.LifetimePolicy; import org.apache.qpid.server.model.Port; import org.apache.qpid.server.model.State; import org.apache.qpid.server.model.User; -import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManagerFactory; -import org.apache.qpid.server.security.auth.manager.PlainPasswordFileAuthenticationManagerFactory; +import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManager; +import org.apache.qpid.server.security.auth.manager.PlainPasswordDatabaseAuthenticationManager; import org.apache.qpid.test.utils.TestBrokerConfiguration; public class AuthenticationProviderRestTest extends QpidRestTestCase @@ -49,10 +50,10 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase for (Map<String, Object> provider : providerDetails) { boolean managesPrincipals = true; - String type = PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE; + String type = PlainPasswordDatabaseAuthenticationManager.PROVIDER_TYPE; if (ANONYMOUS_AUTHENTICATION_PROVIDER.equals(provider.get(AuthenticationProvider.NAME))) { - type = AnonymousAuthenticationManagerFactory.PROVIDER_TYPE; + type = AnonymousAuthenticationManager.PROVIDER_TYPE; managesPrincipals = false; } assertProvider(managesPrincipals, type , provider); @@ -70,8 +71,8 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase String providerName = "test-provider"; Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put(AuthenticationProvider.NAME, providerName); - attributes.put(AuthenticationProvider.TYPE, PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE); - attributes.put(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH, principalDatabase.getAbsolutePath()); + attributes.put(AuthenticationProvider.TYPE, PlainPasswordDatabaseAuthenticationManager.PROVIDER_TYPE); + attributes.put(ExternalFileBasedAuthenticationManager.PATH, principalDatabase.getAbsolutePath()); int responseCode = getRestTestHelper().submitRequest("/rest/authenticationprovider/" + providerName, "PUT", attributes); assertEquals("failed to create authentication provider", 201, responseCode); @@ -82,7 +83,7 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase String providerName = "test-provider"; Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put(AuthenticationProvider.NAME, providerName); - attributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE); + attributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManager.PROVIDER_TYPE); int responseCode = getRestTestHelper().submitRequest("/rest/authenticationprovider/" + providerName, "PUT", attributes); assertEquals("Unexpected response code", 201, responseCode); @@ -91,7 +92,7 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase assertNotNull("Providers details cannot be null", providerDetails); assertEquals("Unexpected number of providers", 1, providerDetails.size()); Map<String, Object> provider = providerDetails.get(0); - assertProvider(false, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE, provider); + assertProvider(false, AnonymousAuthenticationManager.PROVIDER_TYPE, provider); } public void testUpdateAuthenticationProviderIdFails() throws Exception @@ -99,7 +100,7 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase String providerName = "test-provider"; Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put(AuthenticationProvider.NAME, providerName); - attributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE); + attributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManager.PROVIDER_TYPE); int responseCode = getRestTestHelper().submitRequest("/rest/authenticationprovider/" + providerName, "PUT", attributes); assertEquals("Unexpected response code", 201, responseCode); @@ -116,7 +117,7 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase String providerName = "test-provider"; Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put(AuthenticationProvider.NAME, providerName); - attributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE); + attributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManager.PROVIDER_TYPE); int responseCode = getRestTestHelper().submitRequest("/rest/authenticationprovider/" + providerName, "PUT", attributes); assertEquals("Unexpected response code for provider creation", 201, responseCode); @@ -137,7 +138,7 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase List<Map<String, Object>> providerDetails = getRestTestHelper().getJsonAsList("/rest/authenticationprovider/" + providerName); assertNotNull("Providers details cannot be null", providerDetails); assertEquals("Unexpected number of providers", 1, providerDetails.size()); - assertProvider(false, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE, providerDetails.get(0)); + assertProvider(false, AnonymousAuthenticationManager.PROVIDER_TYPE, providerDetails.get(0)); } public void testDeleteOfUnusedAuthenticationProvider() throws Exception @@ -146,7 +147,7 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase String providerName = "test-provider"; Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put(AuthenticationProvider.NAME, providerName); - attributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE); + attributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManager.PROVIDER_TYPE); int responseCode = getRestTestHelper().submitRequest("/rest/authenticationprovider/" + providerName, "PUT", attributes); assertEquals("Unexpected response code for provider creation", 201, responseCode); @@ -174,9 +175,9 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase String providerName = getTestName(); Map<String, Object> attributes = new HashMap<String, Object>(); - attributes.put(AuthenticationProvider.TYPE, PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE); + attributes.put(AuthenticationProvider.TYPE, PlainPasswordDatabaseAuthenticationManager.PROVIDER_TYPE); attributes.put(AuthenticationProvider.NAME, providerName); - attributes.put(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH, file.getAbsoluteFile()); + attributes.put(ExternalFileBasedAuthenticationManager.PATH, file.getAbsoluteFile()); UUID id = config.addObjectConfiguration(AuthenticationProvider.class, attributes); config.setSaved(false); @@ -187,7 +188,7 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase Map<String, Object> provider = getRestTestHelper().getJsonAsSingletonList("/rest/authenticationprovider/" + providerName); assertEquals("Unexpected id", id.toString(), provider.get(AuthenticationProvider.ID)); assertEquals("Unexpected name", providerName, provider.get(AuthenticationProvider.NAME)); - assertEquals("Unexpected path", file.getAbsolutePath() , provider.get(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH)); + assertEquals("Unexpected path", file.getAbsolutePath() , provider.get(ExternalFileBasedAuthenticationManager.PATH)); assertEquals("Unexpected state", State.ERRORED.name() , provider.get(AuthenticationProvider.STATE)); int status = getRestTestHelper().submitRequest("/rest/authenticationprovider/" + providerName, "DELETE", null); @@ -212,9 +213,9 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase String providerName = getTestName(); Map<String, Object> attributes = new HashMap<String, Object>(); - attributes.put(AuthenticationProvider.TYPE, PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE); + attributes.put(AuthenticationProvider.TYPE, PlainPasswordDatabaseAuthenticationManager.PROVIDER_TYPE); attributes.put(AuthenticationProvider.NAME, providerName); - attributes.put(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH, file.getAbsoluteFile()); + attributes.put(ExternalFileBasedAuthenticationManager.PATH, file.getAbsoluteFile()); UUID id = config.addObjectConfiguration(AuthenticationProvider.class, attributes); config.setSaved(false); @@ -225,7 +226,7 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase Map<String, Object> provider = getRestTestHelper().getJsonAsSingletonList("/rest/authenticationprovider/" + providerName); assertEquals("Unexpected id", id.toString(), provider.get(AuthenticationProvider.ID)); assertEquals("Unexpected name", providerName, provider.get(AuthenticationProvider.NAME)); - assertEquals("Unexpected path", file.getAbsolutePath() , provider.get(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH)); + assertEquals("Unexpected path", file.getAbsolutePath() , provider.get(ExternalFileBasedAuthenticationManager.PATH)); assertEquals("Unexpected state", State.ERRORED.name() , provider.get(AuthenticationProvider.STATE)); File principalDatabase = null; @@ -235,8 +236,8 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase attributes = new HashMap<String, Object>(); attributes.put(AuthenticationProvider.NAME, providerName); attributes.put(AuthenticationProvider.ID, id); - attributes.put(AuthenticationProvider.TYPE, PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE); - attributes.put(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH, principalDatabase.getAbsolutePath()); + attributes.put(AuthenticationProvider.TYPE, PlainPasswordDatabaseAuthenticationManager.PROVIDER_TYPE); + attributes.put(ExternalFileBasedAuthenticationManager.PATH, principalDatabase.getAbsolutePath()); int status = getRestTestHelper().submitRequest("/rest/authenticationprovider/" + providerName, "PUT", attributes); assertEquals("ACL was not deleted", 200, status); @@ -244,7 +245,8 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase provider = getRestTestHelper().getJsonAsSingletonList("/rest/authenticationprovider/" + providerName); assertEquals("Unexpected id", id.toString(), provider.get(AuthenticationProvider.ID)); assertEquals("Unexpected name", providerName, provider.get(AuthenticationProvider.NAME)); - assertEquals("Unexpected path", principalDatabase.getAbsolutePath() , provider.get(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH)); + assertEquals("Unexpected path", principalDatabase.getAbsolutePath() , provider.get( + ExternalFileBasedAuthenticationManager.PATH)); assertEquals("Unexpected state", State.ACTIVE.name() , provider.get(AuthenticationProvider.STATE)); } finally @@ -277,8 +279,8 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase String providerName = "test-provider"; Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put(AuthenticationProvider.NAME, providerName); - attributes.put(AuthenticationProvider.TYPE, PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE); - attributes.put(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH, file.getAbsolutePath()); + attributes.put(AuthenticationProvider.TYPE, PlainPasswordDatabaseAuthenticationManager.PROVIDER_TYPE); + attributes.put(ExternalFileBasedAuthenticationManager.PATH, file.getAbsolutePath()); int responseCode = getRestTestHelper().submitRequest("/rest/authenticationprovider/" + providerName, "PUT", attributes); assertEquals("Password provider was not created", 201, responseCode); @@ -287,8 +289,9 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase Map<String, Object> providerDetails = getRestTestHelper().getJsonAsSingletonList("/rest/authenticationprovider/" + providerName); assertNotNull("Providers details cannot be null", providerDetails); assertEquals("Unexpected name", providerName, providerDetails.get(AuthenticationProvider.NAME)); - assertEquals("Unexpected type", PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE, providerDetails.get(AuthenticationProvider.TYPE)); - assertEquals("Unexpected path", file.getAbsolutePath(), providerDetails.get(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH)); + assertEquals("Unexpected type", PlainPasswordDatabaseAuthenticationManager.PROVIDER_TYPE, providerDetails.get(AuthenticationProvider.TYPE)); + assertEquals("Unexpected path", file.getAbsolutePath(), providerDetails.get( + ExternalFileBasedAuthenticationManager.PATH)); assertTrue("User file should be created", file.exists()); @@ -304,8 +307,8 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase private void assertProvider(boolean managesPrincipals, String type, Map<String, Object> provider) { - Asserts.assertAttributesPresent(provider, AbstractConfiguredObject.getAttributeNames( - AuthenticationProvider.class), + Asserts.assertAttributesPresent(provider, ConfiguredObjectTypeRegistry.getAttributeNames( + AuthenticationProvider.class), AuthenticationProvider.DESCRIPTION, ConfiguredObject.CONTEXT, ConfiguredObject.CREATED_BY, ConfiguredObject.CREATED_TIME, ConfiguredObject.LAST_UPDATED_BY, ConfiguredObject.LAST_UPDATED_TIME); assertEquals("Unexpected value of provider attribute " + AuthenticationProvider.STATE, State.ACTIVE.name(), diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsClientCertAuthTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsClientCertAuthTest.java index 6d6223048a..e3e74c8670 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsClientCertAuthTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsClientCertAuthTest.java @@ -34,7 +34,7 @@ import org.apache.qpid.server.model.AuthenticationProvider; import org.apache.qpid.server.model.Port; import org.apache.qpid.server.model.Protocol; import org.apache.qpid.server.model.Transport; -import org.apache.qpid.server.security.auth.manager.ExternalAuthenticationManagerFactory; +import org.apache.qpid.server.security.auth.manager.ExternalAuthenticationManager; import org.apache.qpid.test.utils.TestBrokerConfiguration; public class BrokerRestHttpsClientCertAuthTest extends QpidRestTestCase @@ -66,7 +66,7 @@ public class BrokerRestHttpsClientCertAuthTest extends QpidRestTestCase Map<String, Object> externalProviderAttributes = new HashMap<String, Object>(); - externalProviderAttributes.put(AuthenticationProvider.TYPE, ExternalAuthenticationManagerFactory.PROVIDER_TYPE); + externalProviderAttributes.put(AuthenticationProvider.TYPE, ExternalAuthenticationManager.PROVIDER_TYPE); externalProviderAttributes.put(AuthenticationProvider.NAME, EXTERNAL_AUTHENTICATION_PROVIDER); getBrokerConfiguration().addObjectConfiguration(AuthenticationProvider.class, externalProviderAttributes); diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java index fd7dbf0831..6baf9d1109 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java @@ -28,9 +28,9 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; -import org.apache.qpid.server.model.AbstractConfiguredObject; import org.apache.qpid.server.model.Broker; import org.apache.qpid.server.model.ConfiguredObject; +import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry; import org.apache.qpid.server.model.Port; import org.apache.qpid.server.model.Protocol; import org.apache.qpid.server.model.Transport; @@ -63,7 +63,7 @@ public class BrokerRestHttpsTest extends QpidRestTestCase { Map<String, Object> brokerDetails = getRestTestHelper().getJsonAsSingletonList("/rest/broker"); - Asserts.assertAttributesPresent(brokerDetails, AbstractConfiguredObject.getAttributeNames(Broker.class), + Asserts.assertAttributesPresent(brokerDetails, ConfiguredObjectTypeRegistry.getAttributeNames(Broker.class), Broker.PROCESS_PID, Broker.SUPPORTED_VIRTUALHOST_STORE_TYPES, ConfiguredObject.TYPE, ConfiguredObject.CREATED_BY, diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java index b68c53739c..afd647a969 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java @@ -33,13 +33,12 @@ import javax.jms.Session; import javax.jms.TextMessage; import org.apache.qpid.common.QpidProperties; -import org.apache.qpid.server.model.AbstractConfiguredObject; import org.apache.qpid.server.model.Broker; import org.apache.qpid.server.model.ConfiguredObject; +import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry; import org.apache.qpid.server.model.LifetimePolicy; import org.apache.qpid.server.model.Port; import org.apache.qpid.server.model.State; -import org.apache.qpid.server.model.VirtualHost; import org.apache.qpid.server.model.VirtualHostNode; import org.apache.qpid.server.plugin.MessageStoreFactory; import org.apache.qpid.test.client.UnroutableMessageTestExceptionListener; @@ -203,7 +202,7 @@ public class BrokerRestTest extends QpidRestTestCase protected void assertBrokerAttributes(Map<String, Object> brokerDetails) { - Asserts.assertAttributesPresent(brokerDetails, AbstractConfiguredObject.getAttributeNames(Broker.class), + Asserts.assertAttributesPresent(brokerDetails, ConfiguredObjectTypeRegistry.getAttributeNames(Broker.class), Broker.PROCESS_PID, ConfiguredObject.TYPE, ConfiguredObject.CREATED_BY, diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java index bf11ff9ae0..9013db7469 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ConnectionRestTest.java @@ -34,9 +34,9 @@ import javax.jms.MessageProducer; import org.apache.qpid.client.AMQConnection; import org.apache.qpid.client.AMQSession; import org.apache.qpid.server.model.ConfiguredObject; +import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry; import org.apache.qpid.server.model.Connection; import org.apache.qpid.server.model.Session; -import org.apache.qpid.server.model.AbstractConfiguredObject; public class ConnectionRestTest extends QpidRestTestCase { @@ -174,7 +174,7 @@ public class ConnectionRestTest extends QpidRestTestCase private void assertSession(Map<String, Object> sessionData, AMQSession<?, ?> session) { assertNotNull("Session map cannot be null", sessionData); - Asserts.assertAttributesPresent(sessionData, AbstractConfiguredObject.getAttributeNames(Session.class), + Asserts.assertAttributesPresent(sessionData, ConfiguredObjectTypeRegistry.getAttributeNames(Session.class), ConfiguredObject.TYPE, ConfiguredObject.CREATED_BY, ConfiguredObject.CREATED_TIME, diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java index 9246877528..884d3d321a 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/GroupProviderRestTest.java @@ -29,8 +29,8 @@ import java.util.Properties; import java.util.UUID; import org.apache.qpid.server.BrokerOptions; -import org.apache.qpid.server.model.AbstractConfiguredObject; import org.apache.qpid.server.model.ConfiguredObject; +import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry; import org.apache.qpid.server.model.Group; import org.apache.qpid.server.model.GroupProvider; import org.apache.qpid.server.model.LifetimePolicy; @@ -322,7 +322,7 @@ public class GroupProviderRestTest extends QpidRestTestCase private void assertProvider(String name, String type, Map<String, Object> provider) { - Asserts.assertAttributesPresent(provider, AbstractConfiguredObject.getAttributeNames(GroupProvider.class), + Asserts.assertAttributesPresent(provider, ConfiguredObjectTypeRegistry.getAttributeNames(GroupProvider.class), ConfiguredObject.TYPE, ConfiguredObject.CREATED_BY, ConfiguredObject.CREATED_TIME, diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java index e80c1df41a..40ffc680a7 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PortRestTest.java @@ -35,7 +35,7 @@ import org.apache.qpid.server.model.Port; import org.apache.qpid.server.model.Protocol; import org.apache.qpid.server.model.State; import org.apache.qpid.server.model.Transport; -import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManagerFactory; +import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManager; import org.apache.qpid.test.utils.TestBrokerConfiguration; public class PortRestTest extends QpidRestTestCase @@ -152,7 +152,7 @@ public class PortRestTest extends QpidRestTestCase Asserts.assertPortAttributes(port); Map<String, Object> authProviderAttributes = new HashMap<String, Object>(); - authProviderAttributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE); + authProviderAttributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManager.PROVIDER_TYPE); authProviderAttributes.put(AuthenticationProvider.NAME, TestBrokerConfiguration.ENTRY_NAME_ANONYMOUS_PROVIDER); responseCode = getRestTestHelper().submitRequest("/rest/authenticationprovider/" + TestBrokerConfiguration.ENTRY_NAME_ANONYMOUS_PROVIDER, "PUT", authProviderAttributes); diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java index 6ef3dd500a..a5b96fa6cd 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java @@ -27,14 +27,15 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.qpid.server.model.AbstractConfiguredObject; import org.apache.qpid.server.model.AuthenticationProvider; import org.apache.qpid.server.model.ConfiguredObject; +import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry; +import org.apache.qpid.server.model.ExternalFileBasedAuthenticationManager; import org.apache.qpid.server.model.LifetimePolicy; import org.apache.qpid.server.model.PreferencesProvider; import org.apache.qpid.server.model.State; import org.apache.qpid.server.model.adapter.FileSystemPreferencesProvider; -import org.apache.qpid.server.security.auth.manager.PlainPasswordFileAuthenticationManagerFactory; +import org.apache.qpid.server.security.auth.manager.PlainPasswordDatabaseAuthenticationManager; import org.apache.qpid.test.utils.TestBrokerConfiguration; import org.apache.qpid.test.utils.TestFileUtils; @@ -74,9 +75,9 @@ public class PreferencesProviderRestTest extends QpidRestTestCase { super.customizeConfiguration(); Map<String, Object> anonymousAuthProviderAttributes = new HashMap<String, Object>(); - anonymousAuthProviderAttributes.put(AuthenticationProvider.TYPE, PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE); + anonymousAuthProviderAttributes.put(AuthenticationProvider.TYPE, PlainPasswordDatabaseAuthenticationManager.PROVIDER_TYPE); anonymousAuthProviderAttributes.put(AuthenticationProvider.NAME, TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER + "-2"); - anonymousAuthProviderAttributes.put(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH, _authenticationProviderFile.getAbsolutePath()); + anonymousAuthProviderAttributes.put(ExternalFileBasedAuthenticationManager.PATH, _authenticationProviderFile.getAbsolutePath()); getBrokerConfiguration().addObjectConfiguration(AuthenticationProvider.class,anonymousAuthProviderAttributes); } @@ -162,7 +163,7 @@ public class PreferencesProviderRestTest extends QpidRestTestCase public void assertProviderCommonAttributes(Map<String, Object> provider) { Asserts.assertAttributesPresent(provider, - AbstractConfiguredObject.getAttributeNames(PreferencesProvider.class), + ConfiguredObjectTypeRegistry.getAttributeNames(PreferencesProvider.class), ConfiguredObject.CREATED_BY, ConfiguredObject.CREATED_TIME, ConfiguredObject.LAST_UPDATED_BY, diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QpidRestTestCase.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QpidRestTestCase.java index 1a8fe9d930..9322f79984 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QpidRestTestCase.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QpidRestTestCase.java @@ -28,9 +28,8 @@ import org.apache.qpid.server.management.plugin.HttpManagement; import org.apache.qpid.server.model.AuthenticationProvider; import org.apache.qpid.server.model.Plugin; import org.apache.qpid.server.model.Port; -import org.apache.qpid.server.model.VirtualHost; import org.apache.qpid.server.model.VirtualHostNode; -import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManagerFactory; +import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManager; import org.apache.qpid.test.utils.QpidBrokerTestCase; import org.apache.qpid.test.utils.TestBrokerConfiguration; @@ -89,7 +88,7 @@ public class QpidRestTestCase extends QpidBrokerTestCase config.removeObjectConfiguration(Port.class, TestBrokerConfiguration.ENTRY_NAME_RMI_PORT); Map<String, Object> anonymousProviderAttributes = new HashMap<String, Object>(); - anonymousProviderAttributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE); + anonymousProviderAttributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManager.PROVIDER_TYPE); anonymousProviderAttributes.put(AuthenticationProvider.NAME, ANONYMOUS_AUTHENTICATION_PROVIDER); config.addObjectConfiguration(AuthenticationProvider.class, anonymousProviderAttributes); diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java index 70cc6414cd..7780022251 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java @@ -36,10 +36,10 @@ import javax.jms.Session; import org.apache.qpid.server.model.Binding; import org.apache.qpid.server.model.ConfiguredObject; +import org.apache.qpid.server.model.ConfiguredObjectTypeRegistry; import org.apache.qpid.server.model.Consumer; import org.apache.qpid.server.model.LifetimePolicy; import org.apache.qpid.server.model.Queue; -import org.apache.qpid.server.model.AbstractConfiguredObject; public class QueueRestTest extends QpidRestTestCase { @@ -212,7 +212,7 @@ public class QueueRestTest extends QpidRestTestCase { assertNotNull("Consumer map should not be null", consumer); Asserts.assertAttributesPresent(consumer, - AbstractConfiguredObject.getAttributeNames(Consumer.class), Consumer.STATE, + ConfiguredObjectTypeRegistry.getAttributeNames(Consumer.class), Consumer.STATE, Consumer.SETTLEMENT_MODE, Consumer.EXCLUSIVE, Consumer.SELECTOR, Consumer.NO_LOCAL, ConfiguredObject.TYPE, diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/SaslRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/SaslRestTest.java index 6a910df04d..d1f9053221 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/SaslRestTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/SaslRestTest.java @@ -39,7 +39,7 @@ import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.JsonMappingException; import org.apache.qpid.server.model.AuthenticationProvider; -import org.apache.qpid.server.security.auth.manager.Base64MD5PasswordFileAuthenticationManagerFactory; +import org.apache.qpid.server.security.auth.manager.Base64MD5PasswordDatabaseAuthenticationManager; import org.apache.qpid.test.utils.TestBrokerConfiguration; import org.apache.qpid.tools.security.Passwd; @@ -378,7 +378,7 @@ public class SaslRestTest extends QpidRestTestCase // configure broker to use Base64MD5PasswordFilePrincipalDatabase Map<String, Object> newAttributes = new HashMap<String, Object>(); newAttributes.put("path", passwordFile.getAbsolutePath()); - newAttributes.put(AuthenticationProvider.TYPE, Base64MD5PasswordFileAuthenticationManagerFactory.PROVIDER_TYPE); + newAttributes.put(AuthenticationProvider.TYPE, Base64MD5PasswordDatabaseAuthenticationManager.PROVIDER_TYPE); getBrokerConfiguration().setObjectAttributes(AuthenticationProvider.class,TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER, newAttributes); } } diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java index 2575fb7e43..9168d5c81a 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java @@ -33,6 +33,7 @@ import org.apache.qpid.server.management.plugin.HttpManagement; import org.apache.qpid.server.model.AccessControlProvider; import org.apache.qpid.server.model.AuthenticationProvider; import org.apache.qpid.server.model.Broker; +import org.apache.qpid.server.model.ExternalFileBasedAuthenticationManager; import org.apache.qpid.server.model.GroupProvider; import org.apache.qpid.server.model.KeyStore; import org.apache.qpid.server.model.Plugin; @@ -46,8 +47,8 @@ import org.apache.qpid.server.security.FileTrustStore; import org.apache.qpid.server.model.VirtualHostNode; import org.apache.qpid.server.security.access.FileAccessControlProviderConstants; import org.apache.qpid.server.security.acl.AbstractACLTestCase; -import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManagerFactory; -import org.apache.qpid.server.security.auth.manager.PlainPasswordFileAuthenticationManagerFactory; +import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManager; +import org.apache.qpid.server.security.auth.manager.PlainPasswordDatabaseAuthenticationManager; import org.apache.qpid.server.store.DurableConfigurationStore; import org.apache.qpid.systest.rest.QpidRestTestCase; import org.apache.qpid.test.utils.TestBrokerConfiguration; @@ -155,8 +156,8 @@ public class BrokerACLTest extends QpidRestTestCase Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put(AuthenticationProvider.NAME, providerName); - attributes.put(AuthenticationProvider.TYPE, PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE); - attributes.put(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH, file.getAbsolutePath()); + attributes.put(AuthenticationProvider.TYPE, PlainPasswordDatabaseAuthenticationManager.PROVIDER_TYPE); + attributes.put(ExternalFileBasedAuthenticationManager.PATH, file.getAbsolutePath()); int responseCode = getRestTestHelper().submitRequest("/rest/authenticationprovider/" + providerName, "PUT", attributes); assertEquals("Setting of provider attribites should be allowed", 200, responseCode); @@ -178,16 +179,16 @@ public class BrokerACLTest extends QpidRestTestCase Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put(AuthenticationProvider.NAME, providerName); - attributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE); - attributes.put(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH, file.getAbsolutePath()); + attributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManager.PROVIDER_TYPE); + attributes.put(ExternalFileBasedAuthenticationManager.PATH, file.getAbsolutePath()); int responseCode = getRestTestHelper().submitRequest("/rest/authenticationprovider/" + providerName, "PUT", attributes); assertEquals("Setting of provider attribites should be allowed", 403, responseCode); Map<String, Object> provider = getRestTestHelper().getJsonAsSingletonList("/rest/authenticationprovider/" + providerName); assertEquals("Unexpected PATH attribute value", - providerData.get(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH), - provider.get(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH)); + providerData.get(ExternalFileBasedAuthenticationManager.PATH), + provider.get(ExternalFileBasedAuthenticationManager.PATH)); } /* === VirtualHostNode === */ @@ -1012,7 +1013,7 @@ public class BrokerACLTest extends QpidRestTestCase { Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put(AuthenticationProvider.NAME, authenticationProviderName); - attributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE); + attributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManager.PROVIDER_TYPE); return getRestTestHelper().submitRequest("/rest/authenticationprovider/" + authenticationProviderName, "PUT", attributes); } |
