diff options
author | Gordon Sim <gsim@apache.org> | 2008-11-03 17:21:38 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2008-11-03 17:21:38 +0000 |
commit | a95eb74d7f806e3a60bbd61a042329bcfba9b21d (patch) | |
tree | 1f300ecd3d7dd2a39fdcd3882fb788b5dce28bf2 /cpp/src/tests/exception_test.cpp | |
parent | c7ed94d2a123f3753a6d64eff5a83b742ce30163 (diff) | |
download | qpid-python-a95eb74d7f806e3a60bbd61a042329bcfba9b21d.tar.gz |
Various fixes arising from testing client failover:
* introduced new exception type for signalling connection failure (as distinct from any logical connection errors)
* ConnectionImpl::closeInternal(): take copy of session map to prevent concurrent modification (by the same thread) as sessions are deleted and erase themselves.
* ConnectionImpl::shutdown: hold lock before calling closeInternal(); mark handler failed before informing sessions of failure
* SessionImpl::connectionBroker(): remove code as its rather meaningless
* Don't swallow exceptions in Dispatcher
* Handle exceptions in FailoverListener
* Take weak_ptr to ConnectionImpl on constructor of Connector, then convert to shared_ptr when 'receiver' thread is started.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@710106 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/exception_test.cpp')
-rw-r--r-- | cpp/src/tests/exception_test.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cpp/src/tests/exception_test.cpp b/cpp/src/tests/exception_test.cpp index f3f5435699..e420bf2f0b 100644 --- a/cpp/src/tests/exception_test.cpp +++ b/cpp/src/tests/exception_test.cpp @@ -92,7 +92,7 @@ QPID_AUTO_TEST_CASE(DisconnectedPop) { ProxyConnection c(fix.broker->getPort(Broker::TCP_TRANSPORT)); fix.session.queueDeclare(arg::queue="q"); fix.subs.subscribe(fix.lq, "q"); - Catcher<ConnectionException> pop(bind(&LocalQueue::pop, &fix.lq, sys::TIME_SEC)); + Catcher<TransportFailure> pop(bind(&LocalQueue::pop, &fix.lq, sys::TIME_SEC)); fix.connection.proxy.close(); BOOST_CHECK(pop.join()); } @@ -106,11 +106,10 @@ QPID_AUTO_TEST_CASE(DisconnectedListen) { fix.session.queueDeclare(arg::queue="q"); fix.subs.subscribe(l, "q"); - ScopedSuppressLogging sl; // Suppress messages for expected errors. - Thread t(fix.subs); + Catcher<TransportFailure> runner(bind(&SubscriptionManager::run, boost::ref(fix.subs))); fix.connection.proxy.close(); - t.join(); - BOOST_CHECK_THROW(fix.session.close(), ConnectionException); + runner.join(); + BOOST_CHECK_THROW(fix.session.close(), TransportFailure); } QPID_AUTO_TEST_CASE(NoSuchQueueTest) { |