From 84dbd5de79d3bda6a1536fc49d3c2c8314c3599f Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Sun, 21 Aug 2011 15:31:17 +0000 Subject: QPID-2720: make the PluginManager able to work with a pre-existing BundleContext Manually applied patch from Danushka Menikkumbura (no longer applied after intervening commits), then updated PluginManager close() to always close the ServiceTrackers it creates, removed the static field/methods causing test failures which lead to previously reverting the patch, enabled passing a pre existing BundleContext into the Broker instance at startup instead, and finally removed the unused MockPluginManager. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1160000 13f79535-47bb-0310-9956-ffa450edef68 --- .../qpid/server/plugins/MockPluginManager.java | 56 ---------------------- .../org/apache/qpid/server/plugins/PluginTest.java | 2 +- 2 files changed, 1 insertion(+), 57 deletions(-) delete mode 100644 java/broker/src/test/java/org/apache/qpid/server/plugins/MockPluginManager.java (limited to 'java/broker/src/test') diff --git a/java/broker/src/test/java/org/apache/qpid/server/plugins/MockPluginManager.java b/java/broker/src/test/java/org/apache/qpid/server/plugins/MockPluginManager.java deleted file mode 100644 index a64ec5d3b1..0000000000 --- a/java/broker/src/test/java/org/apache/qpid/server/plugins/MockPluginManager.java +++ /dev/null @@ -1,56 +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.plugins; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.qpid.server.configuration.plugins.ConfigurationPluginFactory; -import org.apache.qpid.server.exchange.ExchangeType; -import org.apache.qpid.server.security.SecurityPluginFactory; - -public class MockPluginManager extends PluginManager -{ - private Map _securityPlugins = new HashMap(); - private Map, ConfigurationPluginFactory> _configPlugins = new HashMap, ConfigurationPluginFactory>(); - - public MockPluginManager(String pluginPath, String cachePath) throws Exception - { - super(pluginPath, cachePath); - } - - @Override - public Map> getExchanges() - { - return null; - } - - @Override - public Map getSecurityPlugins() - { - return _securityPlugins; - } - - @Override - public Map, ConfigurationPluginFactory> getConfigurationPlugins() - { - return _configPlugins; - } -} diff --git a/java/broker/src/test/java/org/apache/qpid/server/plugins/PluginTest.java b/java/broker/src/test/java/org/apache/qpid/server/plugins/PluginTest.java index 8c18ab85b0..8c945aabfb 100644 --- a/java/broker/src/test/java/org/apache/qpid/server/plugins/PluginTest.java +++ b/java/broker/src/test/java/org/apache/qpid/server/plugins/PluginTest.java @@ -49,7 +49,7 @@ public class PluginTest extends InternalBrokerBaseCase public void testNoExchanges() throws Exception { - PluginManager manager = new PluginManager("/path/to/nowhere", "/tmp"); + PluginManager manager = new PluginManager("/path/to/nowhere", "/tmp", null); Map> exchanges = manager.getExchanges(); assertTrue("Exchanges found", exchanges.isEmpty()); } -- cgit v1.2.1