diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2014-07-01 19:12:38 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2014-07-01 19:12:38 +0000 |
| commit | c1ed3d54c1132c2810e907d87ecec7f5491b118b (patch) | |
| tree | 54f088a87c705374737f477a4160853b352dcbd4 /qpid/cpp/src/tests | |
| parent | b2bd2715e9b15271fb051e594f8bd141cf4b073a (diff) | |
| download | qpid-python-c1ed3d54c1132c2810e907d87ecec7f5491b118b.tar.gz | |
QPID-3921: Refactored Broker::Options into its own independent class
- Now called BrokerOptions
- Added extra getters to Broker so that nothing else needs to know
about BrokerOptions
- Significantly reduces header coupling as lots of files include
Broker.h, but now don't need Options.h
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1607166 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests')
| -rw-r--r-- | qpid/cpp/src/tests/BrokerFixture.h | 22 | ||||
| -rw-r--r-- | qpid/cpp/src/tests/ClientSessionTest.cpp | 6 | ||||
| -rw-r--r-- | qpid/cpp/src/tests/MessagingFixture.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/tests/MessagingSessionTests.cpp | 4 |
4 files changed, 19 insertions, 15 deletions
diff --git a/qpid/cpp/src/tests/BrokerFixture.h b/qpid/cpp/src/tests/BrokerFixture.h index b7b0f9d34b..90b2dc47e0 100644 --- a/qpid/cpp/src/tests/BrokerFixture.h +++ b/qpid/cpp/src/tests/BrokerFixture.h @@ -23,6 +23,7 @@ */ #include "qpid/broker/Broker.h" +#include "qpid/broker/BrokerOptions.h" #include "qpid/client/Connection.h" #include "qpid/client/ConnectionImpl.h" #include "qpid/client/Session.h" @@ -42,22 +43,26 @@ namespace tests { struct BrokerFixture : private boost::noncopyable { typedef qpid::broker::Broker Broker; typedef boost::intrusive_ptr<Broker> BrokerPtr; + typedef qpid::broker::BrokerOptions BrokerOptions; typedef std::vector<std::string> Args; BrokerPtr broker; + BrokerOptions opts; uint16_t port; qpid::sys::Thread brokerThread; - BrokerFixture(const Args& args=Args(), const Broker::Options& opts=Broker::Options(), - bool isExternalPort_=false, uint16_t externalPort_=0) + BrokerFixture(const Args& args=Args(), const BrokerOptions& opts0=BrokerOptions(), + bool isExternalPort_=false, uint16_t externalPort_=0) : + opts(opts0) { - init(args, opts, isExternalPort_, externalPort_); + init(args, isExternalPort_, externalPort_); } - BrokerFixture(const Broker::Options& opts, - bool isExternalPort_=false, uint16_t externalPort_=0) + BrokerFixture(const BrokerOptions& opts0, + bool isExternalPort_=false, uint16_t externalPort_=0) : + opts(opts0) { - init(Args(), opts, isExternalPort_, externalPort_); + init(Args(), isExternalPort_, externalPort_); } void shutdownBroker() { @@ -78,8 +83,7 @@ struct BrokerFixture : private boost::noncopyable { uint16_t getPort() { return port; } private: - void init(const Args& args, Broker::Options opts, - bool isExternalPort=false, uint16_t externalPort=0) + void init(const Args& args, bool isExternalPort=false, uint16_t externalPort=0) { // Keep the tests quiet unless logging env. vars have been set by user. if (!::getenv("QPID_LOG_ENABLE") && !::getenv("QPID_TRACE")) { @@ -148,7 +152,7 @@ typedef ClientT<> Client; template <class ConnectionType, class SessionType=qpid::client::Session> struct SessionFixtureT : BrokerFixture, ClientT<ConnectionType,SessionType> { - SessionFixtureT(Broker::Options opts=Broker::Options()) : + SessionFixtureT(BrokerOptions opts=BrokerOptions()) : BrokerFixture(BrokerFixture::Args(), opts), ClientT<ConnectionType,SessionType>(getPort()) {} diff --git a/qpid/cpp/src/tests/ClientSessionTest.cpp b/qpid/cpp/src/tests/ClientSessionTest.cpp index 2236882eed..6cd63e7f04 100644 --- a/qpid/cpp/src/tests/ClientSessionTest.cpp +++ b/qpid/cpp/src/tests/ClientSessionTest.cpp @@ -52,7 +52,7 @@ using namespace qpid; using qpid::sys::Monitor; using qpid::sys::Thread; using qpid::sys::TIME_SEC; -using qpid::broker::Broker; +using qpid::broker::BrokerOptions; using std::string; using std::cout; using std::endl; @@ -105,7 +105,7 @@ struct SimpleListener : public MessageListener struct ClientSessionFixture : public SessionFixture { - ClientSessionFixture(Broker::Options opts = Broker::Options()) : SessionFixture(opts) { + ClientSessionFixture(BrokerOptions opts = BrokerOptions()) : SessionFixture(opts) { session.queueDeclare(arg::queue="my-queue"); } }; @@ -248,7 +248,7 @@ QPID_AUTO_TEST_CASE(testOpenFailure) { } QPID_AUTO_TEST_CASE(testPeriodicExpiration) { - Broker::Options opts; + BrokerOptions opts; opts.queueCleanInterval = 1*TIME_SEC; opts.queueFlowStopRatio = 0; opts.queueFlowResumeRatio = 0; diff --git a/qpid/cpp/src/tests/MessagingFixture.h b/qpid/cpp/src/tests/MessagingFixture.h index 1d70d4cfa6..2d780fea14 100644 --- a/qpid/cpp/src/tests/MessagingFixture.h +++ b/qpid/cpp/src/tests/MessagingFixture.h @@ -103,7 +103,7 @@ struct MessagingFixture : public BrokerFixture messaging::Session session; BrokerAdmin admin; - MessagingFixture(Broker::Options opts = Broker::Options(), bool mgmtEnabled=false) : + MessagingFixture(BrokerOptions opts = BrokerOptions(), bool mgmtEnabled=false) : BrokerFixture(opts, mgmtEnabled), connection(open(broker->getPort(Broker::TCP_TRANSPORT))), session(connection.createSession()), diff --git a/qpid/cpp/src/tests/MessagingSessionTests.cpp b/qpid/cpp/src/tests/MessagingSessionTests.cpp index 0926765d78..3ca74fa2b7 100644 --- a/qpid/cpp/src/tests/MessagingSessionTests.cpp +++ b/qpid/cpp/src/tests/MessagingSessionTests.cpp @@ -46,7 +46,7 @@ QPID_AUTO_TEST_SUITE(MessagingSessionTests) using namespace qpid::messaging; using namespace qpid::types; using namespace qpid; -using qpid::broker::Broker; +using qpid::broker::BrokerOptions; using qpid::framing::Uuid; @@ -935,7 +935,7 @@ QPID_AUTO_TEST_CASE(testAcknowledge) QPID_AUTO_TEST_CASE(testQmfCreateAndDelete) { - MessagingFixture fix(Broker::Options(), true/*enable management*/); + MessagingFixture fix(BrokerOptions(), true/*enable management*/); MethodInvoker control(fix.session); control.createQueue("my-queue"); control.createExchange("my-exchange", "topic"); |
