summaryrefslogtreecommitdiff
path: root/cpp/src/tests
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
commit2deb4832b4894bb2a5123daaffd54d6da652fae3 (patch)
tree94e4274601cb9eb8c70b6ddd73dd100ccca436ca /cpp/src/tests
parentd7ce27f7cc96894f149e5c20c03b306b80636727 (diff)
downloadqpid-python-2deb4832b4894bb2a5123daaffd54d6da652fae3.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/qpid@737028 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rw-r--r--cpp/src/tests/ClientSessionTest.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/cpp/src/tests/ClientSessionTest.cpp b/cpp/src/tests/ClientSessionTest.cpp
index 454632dd39..2d9239131e 100644
--- a/cpp/src/tests/ClientSessionTest.cpp
+++ b/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()