summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Rudyy <orudyy@apache.org>2013-02-18 12:53:00 +0000
committerAlex Rudyy <orudyy@apache.org>2013-02-18 12:53:00 +0000
commitce27e1526e6686836f9f700d0e7e3562c6e10b67 (patch)
tree87ec0bb11e423aacb139a676fc8e844b693ad1d7
parent688c71414b162a79ec5ebb24cc9c3c6b0731a8f1 (diff)
downloadqpid-python-ce27e1526e6686836f9f700d0e7e3562c6e10b67.tar.gz
QPID-4390: Remove TestAuthenticationManagerFactory
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/java-broker-config-qpid-4390@1447226 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java2
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/model/BrokerShutdownTest.java11
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/TestAuthenticationManagerFactory.java49
-rw-r--r--qpid/java/broker/src/test/resources/META-INF/services/org.apache.qpid.server.plugin.AuthenticationManagerFactory1
4 files changed, 8 insertions, 55 deletions
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
index d8eff63de9..570bd004c5 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
+++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
@@ -30,7 +30,6 @@ import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.server.model.Broker;
import org.apache.qpid.server.queue.AMQPriorityQueue;
import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.security.auth.manager.TestAuthenticationManagerFactory;
import org.apache.qpid.server.store.TestableMemoryMessageStore;
import org.apache.qpid.server.util.BrokerTestHelper;
import org.apache.qpid.server.virtualhost.VirtualHost;
@@ -49,7 +48,6 @@ public class VirtualHostConfigurationTest extends QpidTestCase
super.setUp();
BrokerTestHelper.setUp();
_configXml = new XMLConfiguration();
- _configXml.addProperty("security." + TestAuthenticationManagerFactory.TEST_AUTH_MANAGER_MARKER, "");
_configXml.addProperty("virtualhosts.virtualhost(-1).name", getName());
_configXml.addProperty("virtualhosts.virtualhost(-1)."+getName()+".store.class", TestableMemoryMessageStore.class.getName());
_virtualHostRegistry = new VirtualHostRegistry();
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/BrokerShutdownTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/model/BrokerShutdownTest.java
index db8dce9409..6ed9740c6d 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/model/BrokerShutdownTest.java
+++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/model/BrokerShutdownTest.java
@@ -35,14 +35,17 @@ import org.apache.qpid.server.model.ConfiguredObject;
import org.apache.qpid.server.model.State;
import org.apache.qpid.server.configuration.updater.TaskExecutor;
import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
-import org.apache.qpid.server.security.auth.manager.TestAuthenticationManagerFactory;
+import org.apache.qpid.server.security.auth.manager.PlainPasswordFileAuthenticationManagerFactory;
import org.apache.qpid.server.stats.StatisticsGatherer;
import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
import org.apache.qpid.test.utils.QpidTestCase;
+import org.apache.qpid.test.utils.TestFileUtils;
+import java.io.File;
import java.security.Provider;
import java.security.Security;
import java.util.Collections;
+import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -110,8 +113,10 @@ public class BrokerShutdownTest extends QpidTestCase
{
if (_authenticationProviderId.equals(id))
{
- Map<String, Object> attributes = Collections.<String, Object> singletonMap(AuthenticationManagerFactory.ATTRIBUTE_TYPE,
- TestAuthenticationManagerFactory.TEST_AUTH_MANAGER_MARKER);
+ File file = TestFileUtils.createTempFile(BrokerShutdownTest.this, ".db.users");
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE, PlainPasswordFileAuthenticationManagerFactory.PROVIDER_TYPE);
+ attributes.put(PlainPasswordFileAuthenticationManagerFactory.ATTRIBUTE_PATH, file.getAbsolutePath());
return new ConfigurationEntry(_authenticationProviderId, AuthenticationProvider.class.getSimpleName(), attributes,
Collections.<UUID> emptySet(), this);
}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/TestAuthenticationManagerFactory.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/TestAuthenticationManagerFactory.java
deleted file mode 100644
index a349ba6cbb..0000000000
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/manager/TestAuthenticationManagerFactory.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.security.auth.manager;
-
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.qpid.server.plugin.AuthenticationManagerFactory;
-import org.apache.qpid.server.security.auth.database.PropertiesPrincipalDatabase;
-
-public class TestAuthenticationManagerFactory implements AuthenticationManagerFactory
-{
-
- public static final String TEST_AUTH_MANAGER_MARKER = "test-auth-manager";
-
- @Override
- public AuthenticationManager createInstance(Map<String, Object> attributes)
- {
- if (TEST_AUTH_MANAGER_MARKER.equals(attributes.get(ATTRIBUTE_TYPE)))
- {
- final Properties users = new Properties();
- users.put("guest","guest");
- users.put("admin","admin");
- final PropertiesPrincipalDatabase ppd = new PropertiesPrincipalDatabase(users);
- final AuthenticationManager pdam = new PrincipalDatabaseAuthenticationManager(ppd);
- return pdam;
- }
- return null;
- }
-
-}
diff --git a/qpid/java/broker/src/test/resources/META-INF/services/org.apache.qpid.server.plugin.AuthenticationManagerFactory b/qpid/java/broker/src/test/resources/META-INF/services/org.apache.qpid.server.plugin.AuthenticationManagerFactory
deleted file mode 100644
index 06549ca78e..0000000000
--- a/qpid/java/broker/src/test/resources/META-INF/services/org.apache.qpid.server.plugin.AuthenticationManagerFactory
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.qpid.server.security.auth.manager.TestAuthenticationManagerFactory