From cea30bd45679ae39de64cb93e25d914abc937ba0 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 6 Apr 2010 19:08:28 +0000 Subject: QPID-664: added method to release messages git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@931275 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/MessagingSessionTests.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'cpp/src/tests') diff --git a/cpp/src/tests/MessagingSessionTests.cpp b/cpp/src/tests/MessagingSessionTests.cpp index e1c0a6bb16..6341ef3f28 100644 --- a/cpp/src/tests/MessagingSessionTests.cpp +++ b/cpp/src/tests/MessagingSessionTests.cpp @@ -857,6 +857,21 @@ QPID_AUTO_TEST_CASE(testTx) BOOST_CHECK(!receiver2.fetch(in, Duration::IMMEDIATE)); } +QPID_AUTO_TEST_CASE(testRelease) +{ + QueueFixture fix; + Sender sender = fix.session.createSender(fix.queue); + Message out("test-message"); + sender.send(out, true); + Receiver receiver = fix.session.createReceiver(fix.queue); + Message m1 = receiver.fetch(Duration::IMMEDIATE); + fix.session.release(m1); + Message m2 = receiver.fetch(Duration::SECOND * 1); + BOOST_CHECK_EQUAL(m1.getContent(), out.getContent()); + BOOST_CHECK_EQUAL(m1.getContent(), m2.getContent()); + fix.session.acknowledge(true); +} + QPID_AUTO_TEST_SUITE_END() }} // namespace qpid::tests -- cgit v1.2.1