summaryrefslogtreecommitdiff
path: root/qpid/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
commit64d4fcb837518533e4f81b14ae8e509cc66edea4 (patch)
treed87029cef6090611e2723ea4280291b364e73adf /qpid/cpp/src/tests/ClientSessionTest.cpp
parent9024f9cdcbc17402ba415c0a1e4f7e93df26dceb (diff)
downloadqpid-python-64d4fcb837518533e4f81b14ae8e509cc66edea4.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@750622 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/ClientSessionTest.cpp')
-rw-r--r--qpid/cpp/src/tests/ClientSessionTest.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/ClientSessionTest.cpp b/qpid/cpp/src/tests/ClientSessionTest.cpp
index 1658f3d4ec..b164ed0166 100644
--- a/qpid/cpp/src/tests/ClientSessionTest.cpp
+++ b/qpid/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()