diff options
| author | Gordon Sim <gsim@apache.org> | 2013-08-20 17:54:31 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2013-08-20 17:54:31 +0000 |
| commit | fd04bb3ba94abd9979ae820e7717fdb77d230097 (patch) | |
| tree | 29e02eac9be90a9005f743fe18fb7b56b5f5469d /qpid/cpp/src/tests | |
| parent | c650385858c765561454be123085010438a9ff3d (diff) | |
| download | qpid-python-fd04bb3ba94abd9979ae820e7717fdb77d230097.tar.gz | |
QPID-5086: send completions when restarting after stop, in order to move window forward
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1515901 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests')
| -rw-r--r-- | qpid/cpp/src/tests/MessagingSessionTests.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/MessagingSessionTests.cpp b/qpid/cpp/src/tests/MessagingSessionTests.cpp index 2133cb5605..5cc595c56f 100644 --- a/qpid/cpp/src/tests/MessagingSessionTests.cpp +++ b/qpid/cpp/src/tests/MessagingSessionTests.cpp @@ -1352,6 +1352,32 @@ QPID_AUTO_TEST_CASE(testReleaseOnPriorityQueue) fix.session.acknowledge(); } +QPID_AUTO_TEST_CASE(testRollbackWithFullPrefetch) +{ + QueueFixture fix; + std::string first("first"); + std::string second("second"); + Sender sender = fix.session.createSender(fix.queue); + for (uint i = 0; i < 10; ++i) { + sender.send(Message((boost::format("MSG_%1%") % (i+1)).str())); + } + Session txsession = fix.connection.createTransactionalSession(); + Receiver receiver = txsession.createReceiver(fix.queue); + receiver.setCapacity(9); + Message msg; + for (uint i = 0; i < 10; ++i) { + if (receiver.fetch(msg, Duration::SECOND)) { + BOOST_CHECK_EQUAL(msg.getContent(), std::string("MSG_1")); + txsession.rollback(); + } else { + BOOST_FAIL("Released message not redelivered as expected."); + break; + } + } + txsession.acknowledge(); + txsession.commit(); +} + QPID_AUTO_TEST_SUITE_END() }} // namespace qpid::tests |
