qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1515901 - in /qpid/trunk/qpid/cpp/src: qpid/client/amqp0_10/ReceiverImpl.cpp tests/MessagingSessionTests.cpp
Date Tue, 20 Aug 2013 17:54:31 GMT
Author: gsim
Date: Tue Aug 20 17:54:31 2013
New Revision: 1515901

URL: http://svn.apache.org/r1515901
Log:
QPID-5086: send completions when restarting after stop, in order to move window forward

Modified:
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp
    qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp?rev=1515901&r1=1515900&r2=1515901&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ReceiverImpl.cpp Tue Aug 20 17:54:31 2013
@@ -84,6 +84,7 @@ void ReceiverImpl::start()
     if (state == STOPPED) {
         state = STARTED;
         startFlow(l);
+        session.sendCompletion();
     }
 }
 

Modified: qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp?rev=1515901&r1=1515900&r2=1515901&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/MessagingSessionTests.cpp Tue Aug 20 17:54:31 2013
@@ -1352,6 +1352,32 @@ QPID_AUTO_TEST_CASE(testReleaseOnPriorit
     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



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


Mime
View raw message