summaryrefslogtreecommitdiff
path: root/cpp/src/tests/ClientSessionTest.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-03-05 22:05:26 +0000
committerGordon Sim <gsim@apache.org>2009-03-05 22:05:26 +0000
commitb7fb9f5027f2bf8920a6e32c649c4181db405fa9 (patch)
tree924c16680cb36d0ab10b943d9c096ae2ebeaa9a1 /cpp/src/tests/ClientSessionTest.cpp
parent203cd3edee0e1644f010450cc6037fc55d07b2a9 (diff)
downloadqpid-python-b7fb9f5027f2bf8920a6e32c649c4181db405fa9.tar.gz
QPID-1718: Ensure that cancellation caused by e.g. SubscriptionManager::get() doesn't close dispatch queue.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@750622 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/ClientSessionTest.cpp')
-rw-r--r--cpp/src/tests/ClientSessionTest.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/cpp/src/tests/ClientSessionTest.cpp b/cpp/src/tests/ClientSessionTest.cpp
index 1658f3d4ec..b164ed0166 100644
--- a/cpp/src/tests/ClientSessionTest.cpp
+++ b/cpp/src/tests/ClientSessionTest.cpp
@@ -564,6 +564,24 @@ QPID_AUTO_TEST_CASE(testSessionManagerSetFlowControl) {
BOOST_CHECK_EQUAL("my-message", got.getData());
}
+QPID_AUTO_TEST_CASE(testGetThenSubscribe) {
+ ClientSessionFixture fix;
+ std::string name("myqueue");
+ fix.session.queueDeclare(arg::queue=name, arg::exclusive=true, arg::autoDelete=true);
+ fix.session.messageTransfer(arg::content=Message("one", name));
+ fix.session.messageTransfer(arg::content=Message("two", name));
+ Message got;
+ BOOST_CHECK(fix.subs.get(got, name));
+ BOOST_CHECK_EQUAL("one", got.getData());
+
+ DummyListener listener(fix.session, name, 1);
+ listener.run();
+ BOOST_CHECK_EQUAL(1u, listener.messages.size());
+ if (!listener.messages.empty()) {
+ BOOST_CHECK_EQUAL("two", listener.messages[0].getData());
+ }
+}
+
QPID_AUTO_TEST_SUITE_END()