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 | d930f07d077945ebc1db161e6b6691b987938484 (patch) | |
| tree | 22ccc0f46fc14353ef949d3c8907c39f107302dc /cpp/src/tests/BrokerFixture.h | |
| parent | b8cbcc61467d1d5cc25e1effee670abb98276336 (diff) | |
| download | qpid-python-d930f07d077945ebc1db161e6b6691b987938484.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/qpid@1159268 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/BrokerFixture.h')
| -rw-r--r-- | cpp/src/tests/BrokerFixture.h | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/cpp/src/tests/BrokerFixture.h b/cpp/src/tests/BrokerFixture.h index 672d954572..92c6d22b57 100644 --- a/cpp/src/tests/BrokerFixture.h +++ b/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 |
