diff options
Diffstat (limited to 'java/broker/test')
| -rw-r--r-- | java/broker/test/src/org/apache/qpid/server/exchange/HeadersExchangeTest.java | 4 | ||||
| -rw-r--r-- | java/broker/test/src/org/apache/qpid/server/queue/AckTest.java | 4 | ||||
| -rw-r--r-- | java/broker/test/src/org/apache/qpid/server/queue/DeliveryManagerTest.java | 2 | ||||
| -rw-r--r-- | java/broker/test/src/org/apache/qpid/server/queue/MessageTestHelper.java | 4 | ||||
| -rw-r--r-- | java/broker/test/src/org/apache/qpid/server/queue/SendPerfTest.java | 4 | ||||
| -rw-r--r-- | java/broker/test/src/org/apache/qpid/server/util/NullAuthenticationManager.java | 82 | ||||
| -rw-r--r-- | java/broker/test/src/org/apache/qpid/server/util/TestApplicationRegistry.java (renamed from java/broker/test/src/org/apache/qpid/server/util/NullApplicationRegistry.java) | 5 |
7 files changed, 11 insertions, 94 deletions
diff --git a/java/broker/test/src/org/apache/qpid/server/exchange/HeadersExchangeTest.java b/java/broker/test/src/org/apache/qpid/server/exchange/HeadersExchangeTest.java index 86414ffae2..1c594d4374 100644 --- a/java/broker/test/src/org/apache/qpid/server/exchange/HeadersExchangeTest.java +++ b/java/broker/test/src/org/apache/qpid/server/exchange/HeadersExchangeTest.java @@ -21,7 +21,7 @@ import org.junit.Test; import org.junit.Before; import org.apache.qpid.AMQException; import org.apache.qpid.server.registry.ApplicationRegistry; -import org.apache.qpid.server.util.NullApplicationRegistry; +import org.apache.qpid.server.util.TestApplicationRegistry; import junit.framework.JUnit4TestAdapter; public class HeadersExchangeTest extends AbstractHeadersExchangeTest @@ -29,7 +29,7 @@ public class HeadersExchangeTest extends AbstractHeadersExchangeTest @Before public void init() throws Exception { - ApplicationRegistry.initialise(new NullApplicationRegistry()); + ApplicationRegistry.initialise(new TestApplicationRegistry()); } @Test diff --git a/java/broker/test/src/org/apache/qpid/server/queue/AckTest.java b/java/broker/test/src/org/apache/qpid/server/queue/AckTest.java index 904665949c..8ce006b3ae 100644 --- a/java/broker/test/src/org/apache/qpid/server/queue/AckTest.java +++ b/java/broker/test/src/org/apache/qpid/server/queue/AckTest.java @@ -28,7 +28,7 @@ import org.apache.qpid.framing.ContentHeaderBody; import org.apache.qpid.server.AMQChannel; import org.apache.qpid.server.registry.ApplicationRegistry; import org.apache.qpid.server.store.TestableMemoryMessageStore; -import org.apache.qpid.server.util.NullApplicationRegistry; +import org.apache.qpid.server.util.TestApplicationRegistry; import org.apache.log4j.Logger; import java.util.Iterator; @@ -55,7 +55,7 @@ public class AckTest public AckTest() throws Exception { - ApplicationRegistry.initialise(new NullApplicationRegistry()); + ApplicationRegistry.initialise(new TestApplicationRegistry()); } @Before diff --git a/java/broker/test/src/org/apache/qpid/server/queue/DeliveryManagerTest.java b/java/broker/test/src/org/apache/qpid/server/queue/DeliveryManagerTest.java index d00cd55fa1..f84d426877 100644 --- a/java/broker/test/src/org/apache/qpid/server/queue/DeliveryManagerTest.java +++ b/java/broker/test/src/org/apache/qpid/server/queue/DeliveryManagerTest.java @@ -21,8 +21,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import org.junit.Test; import org.apache.qpid.server.handler.OnCurrentThreadExecutor; -import org.apache.qpid.server.registry.ApplicationRegistry; -import org.apache.qpid.server.util.NullApplicationRegistry; import org.apache.qpid.AMQException; import junit.framework.JUnit4TestAdapter; diff --git a/java/broker/test/src/org/apache/qpid/server/queue/MessageTestHelper.java b/java/broker/test/src/org/apache/qpid/server/queue/MessageTestHelper.java index f9baa77b65..6e8e78f74b 100644 --- a/java/broker/test/src/org/apache/qpid/server/queue/MessageTestHelper.java +++ b/java/broker/test/src/org/apache/qpid/server/queue/MessageTestHelper.java @@ -22,7 +22,7 @@ import org.apache.qpid.framing.ContentHeaderBody; import org.apache.qpid.server.store.MessageStore; import org.apache.qpid.server.store.SkeletonMessageStore; import org.apache.qpid.server.registry.ApplicationRegistry; -import org.apache.qpid.server.util.NullApplicationRegistry; +import org.apache.qpid.server.util.TestApplicationRegistry; import org.apache.qpid.AMQException; class MessageTestHelper @@ -31,7 +31,7 @@ class MessageTestHelper MessageTestHelper() throws Exception { - ApplicationRegistry.initialise(new NullApplicationRegistry()); + ApplicationRegistry.initialise(new TestApplicationRegistry()); } AMQMessage message() throws AMQException diff --git a/java/broker/test/src/org/apache/qpid/server/queue/SendPerfTest.java b/java/broker/test/src/org/apache/qpid/server/queue/SendPerfTest.java index eff65a9350..6d1b89176f 100644 --- a/java/broker/test/src/org/apache/qpid/server/queue/SendPerfTest.java +++ b/java/broker/test/src/org/apache/qpid/server/queue/SendPerfTest.java @@ -35,7 +35,7 @@ import org.apache.qpid.server.registry.IApplicationRegistry; import org.apache.qpid.server.store.MessageStore; import org.apache.qpid.server.store.SkeletonMessageStore; import org.apache.qpid.server.util.AveragedRun; -import org.apache.qpid.server.util.NullApplicationRegistry; +import org.apache.qpid.server.util.TestApplicationRegistry; import org.apache.qpid.server.util.TimedRun; import java.util.ArrayList; @@ -77,7 +77,7 @@ public class SendPerfTest extends TimedRun public static void main(String[] argv) throws Exception { - ApplicationRegistry.initialise(new NullApplicationRegistry()); + ApplicationRegistry.initialise(new TestApplicationRegistry()); int clients = Integer.parseInt(argv[0]); int messages = Integer.parseInt(argv[1]); int iterations = Integer.parseInt(argv[2]); diff --git a/java/broker/test/src/org/apache/qpid/server/util/NullAuthenticationManager.java b/java/broker/test/src/org/apache/qpid/server/util/NullAuthenticationManager.java deleted file mode 100644 index cdde505451..0000000000 --- a/java/broker/test/src/org/apache/qpid/server/util/NullAuthenticationManager.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * - * Copyright (c) 2006 The Apache Software Foundation - * - * Licensed 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.util; - -import org.apache.qpid.server.security.auth.AuthenticationManager; -import org.apache.qpid.server.security.auth.AuthenticationResult; - -import javax.security.sasl.SaslException; -import javax.security.sasl.SaslServer; - -public class NullAuthenticationManager implements AuthenticationManager -{ - public String getMechanisms() - { - return "PLAIN"; - } - - public SaslServer createSaslServer(String mechanism, String localFQDN) throws SaslException - { - return new SaslServer() - { - public String getMechanismName() - { - return "PLAIN"; - } - - public byte[] evaluateResponse(byte[] response) throws SaslException - { - return new byte[0]; - } - - public boolean isComplete() - { - return true; - } - - public String getAuthorizationID() - { - return "guest"; - } - - public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException - { - return new byte[0]; - } - - public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException - { - return new byte[0]; - } - - public Object getNegotiatedProperty(String propName) - { - return null; - } - - public void dispose() throws SaslException - { - } - }; - } - - public AuthenticationResult authenticate(SaslServer server, byte[] response) - { - return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.SUCCESS); - } -} diff --git a/java/broker/test/src/org/apache/qpid/server/util/NullApplicationRegistry.java b/java/broker/test/src/org/apache/qpid/server/util/TestApplicationRegistry.java index 3daf143561..69939b88e4 100644 --- a/java/broker/test/src/org/apache/qpid/server/util/NullApplicationRegistry.java +++ b/java/broker/test/src/org/apache/qpid/server/util/TestApplicationRegistry.java @@ -27,6 +27,7 @@ import org.apache.qpid.server.queue.DefaultQueueRegistry; import org.apache.qpid.server.queue.QueueRegistry; import org.apache.qpid.server.registry.ApplicationRegistry; import org.apache.qpid.server.security.auth.AuthenticationManager; +import org.apache.qpid.server.security.auth.NullAuthenticationManager; import org.apache.qpid.server.store.MessageStore; import org.apache.qpid.server.store.TestableMemoryMessageStore; import org.apache.commons.configuration.Configuration; @@ -34,7 +35,7 @@ import org.apache.commons.configuration.MapConfiguration; import java.util.HashMap; -public class NullApplicationRegistry extends ApplicationRegistry +public class TestApplicationRegistry extends ApplicationRegistry { private QueueRegistry _queueRegistry; @@ -48,7 +49,7 @@ public class NullApplicationRegistry extends ApplicationRegistry private MessageStore _messageStore; - public NullApplicationRegistry() + public TestApplicationRegistry() { super(new MapConfiguration(new HashMap())); } |
