summaryrefslogtreecommitdiff
path: root/cpp/src/tests/cluster_test.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-10-26 20:11:08 +0000
committerAlan Conway <aconway@apache.org>2009-10-26 20:11:08 +0000
commitb6eb88609aea82e676f33ae8ff68918b68b81d33 (patch)
tree7180c10a249f84f635459086ffab7fe93ece3e01 /cpp/src/tests/cluster_test.cpp
parentf5c7bf95dd04dc1cf0248511982a18a45847da14 (diff)
downloadqpid-python-b6eb88609aea82e676f33ae8ff68918b68b81d33.tar.gz
Separate FailoverListener from client::Connection.
client::ConnectionImpl used to contain a FailoverListener to subscribe for updates on the amq.failover exchange. This caused some lifecycle issues including memory leaks. Now FailoverListener is a public API class that the user must create associated with a session to get known-broker updates. Removed the weak_ptr logic in client::SessionImpl which was only required because of FailoverListener. Made SessionImpl::close() idempotent. Gets rid of spurious warning messages in some tests. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@829931 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/cluster_test.cpp')
-rw-r--r--cpp/src/tests/cluster_test.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/cpp/src/tests/cluster_test.cpp b/cpp/src/tests/cluster_test.cpp
index 247aef1b2a..de8ec49ea6 100644
--- a/cpp/src/tests/cluster_test.cpp
+++ b/cpp/src/tests/cluster_test.cpp
@@ -358,13 +358,15 @@ QPID_AUTO_TEST_CASE(testTxTransaction) {
rollbackSession.txRollback();
rollbackSession.messageRelease(rollbackMessage.getId());
-
// Verify queue status: just the comitted messages and dequeues should remain.
BOOST_CHECK_EQUAL(c1.session.queueQuery("q").getMessageCount(), 4u);
BOOST_CHECK_EQUAL(c1.subs.get("q", TIMEOUT).getData(), "B");
BOOST_CHECK_EQUAL(c1.subs.get("q", TIMEOUT).getData(), "a");
BOOST_CHECK_EQUAL(c1.subs.get("q", TIMEOUT).getData(), "b");
BOOST_CHECK_EQUAL(c1.subs.get("q", TIMEOUT).getData(), "c");
+
+ commitSession.close();
+ rollbackSession.close();
}
QPID_AUTO_TEST_CASE(testUnacked) {
@@ -859,9 +861,12 @@ QPID_AUTO_TEST_CASE(testHeartbeatCancelledOnFailover)
Receiver receiver(fmgr, "my-queue", "my-data");
qpid::sys::Thread runner(receiver);
receiver.waitForReady();
- cluster.kill(1);
- //sleep for 2 secs to allow the heartbeat task to fire on the now dead connection:
- ::usleep(2*1000*1000);
+ {
+ ScopedSuppressLogging allQuiet; // suppress connection closed messages
+ cluster.kill(1);
+ //sleep for 2 secs to allow the heartbeat task to fire on the now dead connection:
+ ::usleep(2*1000*1000);
+ }
fmgr.execute(sender);
runner.join();
BOOST_CHECK(!receiver.failed);