Author: gsim
Date: Thu Apr 28 20:11:54 2016
New Revision: 1741505

URL: http://svn.apache.org/viewvc?rev=1741505&view=rev
Log:
QPID-7234: add test

Modified:
    qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp

Modified: qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp?rev=1741505&r1=1741504&r2=1741505&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp Thu Apr 28 20:11:54 
2016
@@ -1532,6 +1532,36 @@ QPID_AUTO_TEST_CASE(testResendMapAsStrin
     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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to