summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
authorMichael Goulish <mgoulish@apache.org>2012-09-14 17:11:09 +0000
committerMichael Goulish <mgoulish@apache.org>2012-09-14 17:11:09 +0000
commitc9e96f18e52dfd8cc2c543dd9eb88b501d9689be (patch)
tree4bcfd1ea3703229fda662f3b01f7f54ee3d75870 /cpp/src/tests
parentb707ab9fe396beca64e2548083f4bbba45dbbd73 (diff)
downloadqpid-python-c9e96f18e52dfd8cc2c543dd9eb88b501d9689be.tar.gz
Jira QPID-4142
auto test for browse-only queues - using messaging interface git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1384851 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rw-r--r--cpp/src/tests/MessagingSessionTests.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/cpp/src/tests/MessagingSessionTests.cpp b/cpp/src/tests/MessagingSessionTests.cpp
index c8ee3aa401..6d6551458d 100644
--- a/cpp/src/tests/MessagingSessionTests.cpp
+++ b/cpp/src/tests/MessagingSessionTests.cpp
@@ -1164,6 +1164,38 @@ QPID_AUTO_TEST_CASE(testAlternateExchangeInLinkDeclare)
}
}
+QPID_AUTO_TEST_CASE(testBrowseOnly)
+{
+ /* Set up a queue browse-only, and try to receive
+ the same messages twice with two different receivers.
+ This works because the browse-only queue does not
+ allow message acquisition. */
+
+ QueueFixture fix;
+ std::string addr = "q; {create:always, node:{type:queue, durable:false, x-declare:{arguments:{browse-only:1}}}}";
+ Sender sender = fix.session.createSender(addr);
+ Message out("test-message");
+
+ int count = 10;
+ for ( int i = 0; i < count; ++ i ) {
+ sender.send(out);
+ }
+
+ Message m;
+
+ Receiver receiver_1 = fix.session.createReceiver(addr);
+ for ( int i = 0; i < count; ++ i ) {
+ BOOST_CHECK(receiver_1.fetch(m, Duration::SECOND));
+ }
+
+ Receiver receiver_2 = fix.session.createReceiver(addr);
+ for ( int i = 0; i < count; ++ i ) {
+ BOOST_CHECK(receiver_2.fetch(m, Duration::SECOND));
+ }
+
+ fix.session.acknowledge();
+}
+
QPID_AUTO_TEST_SUITE_END()
}} // namespace qpid::tests