summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2016-04-28 20:11:54 +0000
committerGordon Sim <gsim@apache.org>2016-04-28 20:11:54 +0000
commit2888fc4bf8bd8940f210b2f2af709420ee03d0ef (patch)
tree80555658b47ec826ef7aeefcda38e1ac191bc3b7
parent4871a9f60d7d4c430a11839924fc3b90bc21b0ab (diff)
downloadqpid-python-2888fc4bf8bd8940f210b2f2af709420ee03d0ef.tar.gz
QPID-7234: add test
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1741505 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/tests/MessagingSessionTests.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/MessagingSessionTests.cpp b/qpid/cpp/src/tests/MessagingSessionTests.cpp
index 3c882b6028..fe9f6d2665 100644
--- a/qpid/cpp/src/tests/MessagingSessionTests.cpp
+++ b/qpid/cpp/src/tests/MessagingSessionTests.cpp
@@ -1532,6 +1532,36 @@ QPID_AUTO_TEST_CASE(testResendMapAsString)
BOOST_CHECK_EQUAL(in.getContent(), newContent);
}
+QPID_AUTO_TEST_CASE(testClientExpiration)
+{
+ QueueFixture fix;
+ Receiver receiver = fix.session.createReceiver(fix.queue);
+ receiver.setCapacity(5);
+ Sender sender = fix.session.createSender(fix.queue);
+ for (uint i = 0; i < 5000; ++i) {
+ Message msg((boost::format("a_%1%") % (i+1)).str());
+ msg.setSubject("a");
+ msg.setTtl(Duration(10));
+ sender.send(msg);
+ }
+ for (uint i = 0; i < 50; ++i) {
+ Message msg((boost::format("b_%1%") % (i+1)).str());
+ msg.setSubject("b");
+ sender.send(msg);
+ }
+ Message received;
+ bool done = false;
+ uint b_count = 0;
+ while (!done && receiver.fetch(received, Duration::IMMEDIATE)) {
+ if (received.getSubject() == "b") {
+ b_count++;
+ }
+ done = received.getContent() == "b_50";
+ fix.session.acknowledge();
+ }
+ BOOST_CHECK_EQUAL(b_count, 50);
+}
+
QPID_AUTO_TEST_SUITE_END()
}} // namespace qpid::tests