summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/ClientSessionTest.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-01-23 14:08:42 +0000
committerGordon Sim <gsim@apache.org>2009-01-23 14:08:42 +0000
commit7863ff6b35b29796185108ef263f13294756cf29 (patch)
tree0861fbc31869099880d75327f5eb39ff1df383c8 /qpid/cpp/src/tests/ClientSessionTest.cpp
parent963ff95bbe9b5e627a51d96b8e0372f518cd7f8f (diff)
downloadqpid-python-7863ff6b35b29796185108ef263f13294756cf29.tar.gz
QPID-1613: Ensure that the rule registered with the demuxer for LocalQueue subscriptions is removed when they are cancelled.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@737028 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/ClientSessionTest.cpp')
-rw-r--r--qpid/cpp/src/tests/ClientSessionTest.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/ClientSessionTest.cpp b/qpid/cpp/src/tests/ClientSessionTest.cpp
index 454632dd39..2d9239131e 100644
--- a/qpid/cpp/src/tests/ClientSessionTest.cpp
+++ b/qpid/cpp/src/tests/ClientSessionTest.cpp
@@ -468,6 +468,25 @@ QPID_AUTO_TEST_CASE(testExclusiveBinding) {
BOOST_CHECK(!fix.subs.get(got, "queue-2"));
}
+QPID_AUTO_TEST_CASE(testResubscribeWithLocalQueue) {
+ ClientSessionFixture fix;
+ fix.session.queueDeclare(arg::queue="some-queue", arg::exclusive=true, arg::autoDelete=true);
+ LocalQueue p, q;
+ fix.subs.subscribe(p, "some-queue");
+ fix.subs.cancel("some-queue");
+ fix.subs.subscribe(q, "some-queue");
+
+ fix.session.messageTransfer(arg::content=Message("some-data", "some-queue"));
+ fix.session.messageFlush(arg::destination="some-queue");
+
+ Message got;
+ BOOST_CHECK(!p.get(got));
+
+ BOOST_CHECK(q.get(got));
+ BOOST_CHECK_EQUAL("some-data", got.getData());
+ BOOST_CHECK(!q.get(got));
+}
+
QPID_AUTO_TEST_SUITE_END()