diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2010-04-26 14:33:24 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2010-04-26 14:33:24 +0000 |
| commit | ff0fe9fcb9c0e82e57d7b1146701fc2861271ce2 (patch) | |
| tree | 94c166289d21ab09b4e2cd72c3b22720f1a16412 /java/broker-plugins/extras/src | |
| parent | 67c5accb682e347436f2db76fa007119569ae9be (diff) | |
| download | qpid-python-ff0fe9fcb9c0e82e57d7b1146701fc2861271ce2.tar.gz | |
QPID-2530 : Updated build system to have a new findSubProjects macro in build.xml that will correctly locate and add all subprojects (those with a build.xml file) to the modules.plugin variable. This will correctly allow new plugins to be automatically picked up without any further build system changes.
To further simplify the build process and make better use of the module.depends option the build.deps file has been updated to contain only the libraries the module actually depends on. The dependant libraries due to a module.depends are now automatically pulled in by the build system. A further enhancement would be to do transitive dependencies, which would also allow dependencies to be built when in a sub module directory.
e.g. client depends on common, but client.libs should not contain mina, common contains mina and so those libraries are pulled in via the fact that client's module.depends contains common.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@938059 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker-plugins/extras/src')
| -rw-r--r-- | java/broker-plugins/extras/src/test/java/org/apache/qpid/server/plugins/PluginTest.java | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/java/broker-plugins/extras/src/test/java/org/apache/qpid/server/plugins/PluginTest.java b/java/broker-plugins/extras/src/test/java/org/apache/qpid/server/plugins/PluginTest.java new file mode 100644 index 0000000000..1fc0eb10e1 --- /dev/null +++ b/java/broker-plugins/extras/src/test/java/org/apache/qpid/server/plugins/PluginTest.java @@ -0,0 +1,61 @@ +/* + * + * 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.Map; + +import org.apache.qpid.server.exchange.ExchangeType; +import org.apache.qpid.server.registry.ApplicationRegistry; + +import junit.framework.TestCase; + +public class PluginTest extends TestCase +{ + + private static final String TEST_EXCHANGE_CLASS = "org.apache.qpid.extras.exchanges.example.TestExchangeType"; + private static final String PLUGIN_DIRECTORY = System.getProperty("example.plugin.target"); + + public void testLoadExchanges() throws Exception + { + PluginManager manager = new PluginManager(PLUGIN_DIRECTORY); + Map<String, ExchangeType<?>> exchanges = manager.getExchanges(); + assertNotNull("No exchanges found in "+PLUGIN_DIRECTORY, exchanges); + assertEquals("Wrong number of exchanges found in "+PLUGIN_DIRECTORY, + 2, exchanges.size()); + assertNotNull("Wrong exchange found in "+PLUGIN_DIRECTORY, + exchanges.get(TEST_EXCHANGE_CLASS)); + } + + public void testNoExchanges() throws Exception + { + PluginManager manager = new PluginManager("/path/to/nowhere"); + Map<String, ExchangeType<?>> exchanges = manager.getExchanges(); + assertEquals("Exchanges found", 0, exchanges.size()); + } + + @Override + public void tearDown() + { + // PluginManager will start an ApplicationRegistry instance. + ApplicationRegistry.remove(ApplicationRegistry.DEFAULT_INSTANCE); + } +} |
