From c47ffec9b9e4608e511c03ed597a6c988460703f Mon Sep 17 00:00:00 2001 From: "Carl C. Trieloff" Date: Thu, 16 Aug 2007 20:57:43 +0000 Subject: - Fix for asyncIO for store - Fix for dtx async IO recover - Temp patch for Tx commit ( existing bug uncovered ) - All store tests should be working again Know issues: - If a msg is sent to more than one queue, then the io complete is signaled on the first record written, not the last - Open issues for tx begin then commit with no prepare using duarble msgs and async IO. async complete bit not set on recovery. will be fixed with next commit. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@566846 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/TxPublishTest.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'cpp/src/tests/TxPublishTest.cpp') diff --git a/cpp/src/tests/TxPublishTest.cpp b/cpp/src/tests/TxPublishTest.cpp index 3391be5128..d009dd9112 100644 --- a/cpp/src/tests/TxPublishTest.cpp +++ b/cpp/src/tests/TxPublishTest.cpp @@ -44,7 +44,8 @@ class TxPublishTest : public CppUnit::TestCase void enqueue(TransactionContext*, PersistableMessage& msg, const PersistableQueue& queue) { - enqueued.push_back(msg_queue_pair(queue.getName(), &msg)); + msg.enqueueComplete(); + enqueued.push_back(msg_queue_pair(queue.getName(), &msg)); } //dont care about any of the other methods: @@ -61,7 +62,7 @@ class TxPublishTest : public CppUnit::TestCase TestMessageStore store; Queue::shared_ptr queue1; Queue::shared_ptr queue2; - Message::shared_ptr const msg; + Message::shared_ptr msg; TxPublish op; public: @@ -88,14 +89,21 @@ public: CPPUNIT_ASSERT_EQUAL((PersistableMessage*) msg.get(), store.enqueued[0].second); CPPUNIT_ASSERT_EQUAL(string("queue2"), store.enqueued[1].first); CPPUNIT_ASSERT_EQUAL((PersistableMessage*) msg.get(), store.enqueued[1].second); + CPPUNIT_ASSERT_EQUAL( true, ((PersistableMessage*) msg.get())->isEnqueueComplete()); + + } void testCommit() { //ensure messages are delivered to queue + op.prepare(0); op.commit(); CPPUNIT_ASSERT_EQUAL((uint32_t) 1, queue1->getMessageCount()); - CPPUNIT_ASSERT_EQUAL(msg, queue1->dequeue()); + Message::shared_ptr msg_dequeue = queue1->dequeue(); + + CPPUNIT_ASSERT_EQUAL( true, ((PersistableMessage*) msg_dequeue.get())->isEnqueueComplete()); + CPPUNIT_ASSERT_EQUAL(msg, msg_dequeue); CPPUNIT_ASSERT_EQUAL((uint32_t) 1, queue2->getMessageCount()); CPPUNIT_ASSERT_EQUAL(msg, queue2->dequeue()); -- cgit v1.2.1