diff options
| author | Alan Conway <aconway@apache.org> | 2011-08-18 14:58:53 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2011-08-18 14:58:53 +0000 |
| commit | 3dbb71f39734ae769d258bb1548ba946e859a13a (patch) | |
| tree | 1e0b479ab1dc37e4aef389d980d0b81e1252681d /qpid/cpp/src/tests/BrokerFixture.h | |
| parent | acef88b76696a58cc53e82c3000f91d489f0a382 (diff) | |
| download | qpid-python-3dbb71f39734ae769d258bb1548ba946e859a13a.tar.gz | |
NO-JIRA: eliminate SocketProxy from tests.
Was causing problems with changes to introduce IPv6.
In most cases this was being used unnecessarilly due to cut-and-paste of tests.
In the 2 cases it was useful, replaced by simply shutting down the broker
to simulate network failure.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1159268 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/BrokerFixture.h')
| -rw-r--r-- | qpid/cpp/src/tests/BrokerFixture.h | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/qpid/cpp/src/tests/BrokerFixture.h b/qpid/cpp/src/tests/BrokerFixture.h index 672d954572..92c6d22b57 100644 --- a/qpid/cpp/src/tests/BrokerFixture.h +++ b/qpid/cpp/src/tests/BrokerFixture.h @@ -22,8 +22,6 @@ * */ -#include "SocketProxy.h" - #include "qpid/broker/Broker.h" #include "qpid/client/Connection.h" #include "qpid/client/ConnectionImpl.h" @@ -71,16 +69,15 @@ struct BrokerFixture : private boost::noncopyable { brokerThread = qpid::sys::Thread(*broker); }; - void shutdownBroker() - { - broker->shutdown(); - broker = BrokerPtr(); + void shutdownBroker() { + if (broker) { + broker->shutdown(); + brokerThread.join(); + broker = BrokerPtr(); + } } - ~BrokerFixture() { - if (broker) broker->shutdown(); - brokerThread.join(); - } + ~BrokerFixture() { shutdownBroker(); } /** Open a connection to the broker. */ void open(qpid::client::Connection& c) { @@ -97,20 +94,6 @@ struct LocalConnection : public qpid::client::Connection { ~LocalConnection() { close(); } }; -/** A local client connection via a socket proxy. */ -struct ProxyConnection : public qpid::client::Connection { - SocketProxy proxy; - ProxyConnection(int brokerPort) : proxy(brokerPort) { - open("localhost", proxy.getPort()); - } - ProxyConnection(const qpid::client::ConnectionSettings& s) : proxy(s.port) { - qpid::client::ConnectionSettings proxySettings(s); - proxySettings.port = proxy.getPort(); - open(proxySettings); - } - ~ProxyConnection() { close(); } -}; - /** Convenience class to create and open a connection and session * and some related useful objects. */ @@ -147,7 +130,6 @@ struct SessionFixtureT : BrokerFixture, ClientT<ConnectionType,SessionType> { }; typedef SessionFixtureT<LocalConnection> SessionFixture; -typedef SessionFixtureT<ProxyConnection> ProxySessionFixture; }} // namespace qpid::tests |
