summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-10-27 15:05:19 +0000
committerAlan Conway <aconway@apache.org>2008-10-27 15:05:19 +0000
commit56480c85567423e45a97a1f1c710e656ff0ed52e (patch)
tree9a037672c7be40ec4040224d4b992c8e547c3b85 /cpp
parent825327492ededcf62f7307a96eb29f5e7df88351 (diff)
downloadqpid-python-56480c85567423e45a97a1f1c710e656ff0ed52e.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/qpid@708210 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/client/SubscriptionManager.cpp6
-rw-r--r--cpp/src/qpid/client/SubscriptionManager.h4
-rw-r--r--cpp/src/tests/Makefile.am2
3 files changed, 7 insertions, 5 deletions
diff --git a/cpp/src/qpid/client/SubscriptionManager.cpp b/cpp/src/qpid/client/SubscriptionManager.cpp
index 13cdd7cad1..350fd86aa6 100644
--- a/cpp/src/qpid/client/SubscriptionManager.cpp
+++ b/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/cpp/src/qpid/client/SubscriptionManager.h b/cpp/src/qpid/client/SubscriptionManager.h
index 8b27a2c9b9..46394808f4 100644
--- a/cpp/src/qpid/client/SubscriptionManager.h
+++ b/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/cpp/src/tests/Makefile.am b/cpp/src/tests/Makefile.am
index 52511e2f29..0f562cec16 100644
--- a/cpp/src/tests/Makefile.am
+++ b/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