summaryrefslogtreecommitdiff
path: root/cpp/src/tests/ClientSessionTest.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-12-10 23:26:18 +0000
committerGordon Sim <gsim@apache.org>2008-12-10 23:26:18 +0000
commit6f03c29cfec851d9f63e7d8b0bbb98791dfc06db (patch)
treeae23c75c37acc2a35542d6c465ba6267e33aaa3b /cpp/src/tests/ClientSessionTest.cpp
parent312c15a3daeb89956b58540f55f65145062bda7a (diff)
downloadqpid-python-6f03c29cfec851d9f63e7d8b0bbb98791dfc06db.tar.gz
QPID-1527: Added exclusive option to SubscriptionSettings and accompanying test.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@725484 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/ClientSessionTest.cpp')
-rw-r--r--cpp/src/tests/ClientSessionTest.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/cpp/src/tests/ClientSessionTest.cpp b/cpp/src/tests/ClientSessionTest.cpp
index ec040cabff..5d047dcd0e 100644
--- a/cpp/src/tests/ClientSessionTest.cpp
+++ b/cpp/src/tests/ClientSessionTest.cpp
@@ -19,6 +19,7 @@
*
*/
#include "unit_test.h"
+#include "test_tools.h"
#include "BrokerFixture.h"
#include "qpid/client/SubscriptionManager.h"
#include "qpid/sys/Monitor.h"
@@ -338,9 +339,6 @@ QPID_AUTO_TEST_CASE(testRelease) {
QPID_AUTO_TEST_CASE(testCompleteOnAccept) {
ClientSessionFixture fix;
-
- fix.session.queueDeclare(arg::queue="HELP_FIND_ME");
-
const uint count = 8;
const uint chunk = 4;
for (uint i = 0; i < count; i++) {
@@ -377,9 +375,6 @@ QPID_AUTO_TEST_CASE(testCompleteOnAccept) {
accepted.add(m.getId());
}
fix.session.messageAccept(accepted);
-
- fix.session.queueDelete(arg::queue="HELP_FIND_ME");
-
}
namespace
@@ -436,6 +431,22 @@ QPID_AUTO_TEST_CASE(testConcurrentSenders)
connection.close();
}
+
+QPID_AUTO_TEST_CASE(testExclusiveSubscribe)
+{
+ ClientSessionFixture fix;
+ fix.session.queueDeclare(arg::queue="myq", arg::exclusive=true, arg::autoDelete=true);
+ SubscriptionSettings settings;
+ settings.exclusive = true;
+ LocalQueue q;
+ fix.subs.subscribe(q, "myq", settings, "first");
+ //attempt to create new subscriber should fail
+ ScopedSuppressLogging sl;
+ BOOST_CHECK_THROW(fix.subs.subscribe(q, "myq", "second"), ResourceLockedException);
+ ;
+
+}
+
QPID_AUTO_TEST_SUITE_END()