diff options
| author | Alan Conway <aconway@apache.org> | 2008-10-27 15:05:19 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-10-27 15:05:19 +0000 |
| commit | 98cac3ad614fc25dca52d941199c056041c7dadd (patch) | |
| tree | db1cc1972c5d3df09be77ea8ec6e768184b5a718 | |
| parent | 939ccc98d866a00c3246880a6206d61e38debf1b (diff) | |
| download | qpid-python-98cac3ad614fc25dca52d941199c056041c7dadd.tar.gz | |
client::SubscriptionManager::findSubscription() throws if not found.
Added progress indicator to boost tests.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@708210 13f79535-47bb-0310-9956-ffa450edef68
| -rw-r--r-- | qpid/cpp/src/qpid/client/SubscriptionManager.cpp | 6 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/client/SubscriptionManager.h | 4 | ||||
| -rw-r--r-- | qpid/cpp/src/tests/Makefile.am | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/qpid/cpp/src/qpid/client/SubscriptionManager.cpp b/qpid/cpp/src/qpid/client/SubscriptionManager.cpp index 13cdd7cad1..350fd86aa6 100644 --- a/qpid/cpp/src/qpid/client/SubscriptionManager.cpp +++ b/qpid/cpp/src/qpid/client/SubscriptionManager.cpp @@ -110,8 +110,10 @@ bool SubscriptionManager::get(Message& result, const std::string& queue, sys::Du Session SubscriptionManager::getSession() const { return session; } Subscription SubscriptionManager::getSubscription(const std::string& name) const { - - return (*subscriptions.find(name)).second; + std::map<std::string, Subscription>::const_iterator i = subscriptions.find(name); + if (i == subscriptions.end()) + throw Exception(QPID_MSG("Subscription not found: " << name)); + return i->second; } void SubscriptionManager::registerFailoverHandler (boost::function<void ()> fh) { diff --git a/qpid/cpp/src/qpid/client/SubscriptionManager.h b/qpid/cpp/src/qpid/client/SubscriptionManager.h index 8b27a2c9b9..46394808f4 100644 --- a/qpid/cpp/src/qpid/client/SubscriptionManager.h +++ b/qpid/cpp/src/qpid/client/SubscriptionManager.h @@ -126,8 +126,8 @@ class SubscriptionManager : public sys::Runnable */ bool get(Message& result, const std::string& queue, sys::Duration timeout=0); - /** Get a subscription by name, returns a null Subscription handle - * if not found. + /** Get a subscription by name. + *@throw Exception if not found. */ Subscription getSubscription(const std::string& name) const; diff --git a/qpid/cpp/src/tests/Makefile.am b/qpid/cpp/src/tests/Makefile.am index 52511e2f29..0f562cec16 100644 --- a/qpid/cpp/src/tests/Makefile.am +++ b/qpid/cpp/src/tests/Makefile.am @@ -132,7 +132,7 @@ check_PROGRAMS+=header_test header_test_SOURCES=header_test.cpp TestOptions.h ConnectionOptions.h header_test_LDADD=$(lib_client) -TESTS_ENVIRONMENT = VALGRIND=$(VALGRIND) srcdir=$(srcdir) QPID_DATA_DIR= $(srcdir)/run_test +TESTS_ENVIRONMENT = VALGRIND=$(VALGRIND) srcdir=$(srcdir) QPID_DATA_DIR= BOOST_TEST_SHOW_PROGRESS=yes $(srcdir)/run_test system_tests = client_test quick_perftest quick_topictest run_header_test TESTS += start_broker $(system_tests) python_tests stop_broker run_federation_tests run_acl_tests |
