diff options
author | Robert Gemmell <robbie@apache.org> | 2011-07-07 15:12:26 +0000 |
---|---|---|
committer | Robert Gemmell <robbie@apache.org> | 2011-07-07 15:12:26 +0000 |
commit | 155ed9d858367d218e43144061b9c1225dd30e2b (patch) | |
tree | 2434933cf45b0a7e890549897a89845e06dc5785 /java/broker-plugins/firewall/src/test/java/org/apache/qpid/server/security/access/FirewallPluginTest.java | |
parent | fb841fd038349acf56b2246fed59e8efc41250fc (diff) | |
download | qpid-python-155ed9d858367d218e43144061b9c1225dd30e2b.tar.gz |
QPID-2815: refactor broker startup to present a clean interface interface for starting the broker within an existing application
Applied patch by Keith Wall and myself
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1143870 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker-plugins/firewall/src/test/java/org/apache/qpid/server/security/access/FirewallPluginTest.java')
-rw-r--r-- | java/broker-plugins/firewall/src/test/java/org/apache/qpid/server/security/access/FirewallPluginTest.java | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/java/broker-plugins/firewall/src/test/java/org/apache/qpid/server/security/access/FirewallPluginTest.java b/java/broker-plugins/firewall/src/test/java/org/apache/qpid/server/security/access/FirewallPluginTest.java index 2b04962c89..00077d9d9c 100644 --- a/java/broker-plugins/firewall/src/test/java/org/apache/qpid/server/security/access/FirewallPluginTest.java +++ b/java/broker-plugins/firewall/src/test/java/org/apache/qpid/server/security/access/FirewallPluginTest.java @@ -27,12 +27,15 @@ import java.net.SocketAddress; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.XMLConfiguration; +import org.apache.qpid.server.configuration.ServerConfiguration; +import org.apache.qpid.server.registry.ApplicationRegistry; import org.apache.qpid.server.security.Result; import org.apache.qpid.server.security.access.plugins.Firewall; import org.apache.qpid.server.security.access.plugins.FirewallConfiguration; -import org.apache.qpid.server.util.InternalBrokerBaseCase; +import org.apache.qpid.server.util.TestApplicationRegistry; +import org.apache.qpid.test.utils.QpidTestCase; -public class FirewallPluginTest extends InternalBrokerBaseCase +public class FirewallPluginTest extends QpidTestCase { public class RuleInfo { @@ -73,15 +76,23 @@ public class FirewallPluginTest extends InternalBrokerBaseCase // IP address private SocketAddress _address; + private ServerConfiguration _serverConfig; @Override - public void setUp() throws Exception + protected void setUp() throws Exception { super.setUp(); - + _serverConfig = new ServerConfiguration(new XMLConfiguration()); + ApplicationRegistry.initialise(new TestApplicationRegistry(_serverConfig)); _address = new InetSocketAddress("127.0.0.1", 65535); } + @Override + protected void tearDown() throws Exception + { + super.tearDown(); + ApplicationRegistry.remove(); + } private Firewall initialisePlugin(String defaultAction, RuleInfo[] rules) throws IOException, ConfigurationException { // Create sample config file @@ -108,7 +119,7 @@ public class FirewallPluginTest extends InternalBrokerBaseCase } buf.write("</firewall>"); buf.close(); - + // Configure plugin FirewallConfiguration config = new FirewallConfiguration(); config.setConfiguration("", new XMLConfiguration(confFile)); |