summaryrefslogtreecommitdiff
path: root/cpp/src/tests/TxPublishTest.cpp
diff options
context:
space:
mode:
authorCarl C. Trieloff <cctrieloff@apache.org>2007-08-16 20:57:43 +0000
committerCarl C. Trieloff <cctrieloff@apache.org>2007-08-16 20:57:43 +0000
commitc47ffec9b9e4608e511c03ed597a6c988460703f (patch)
treebac0c12a88c63c02be820dcf2758ae15cdfd80c2 /cpp/src/tests/TxPublishTest.cpp
parentd146e757b26e03349db432c8732f0067aecb4e7b (diff)
downloadqpid-python-c47ffec9b9e4608e511c03ed597a6c988460703f.tar.gz
- 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
Diffstat (limited to 'cpp/src/tests/TxPublishTest.cpp')
-rw-r--r--cpp/src/tests/TxPublishTest.cpp14
1 files changed, 11 insertions, 3 deletions
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());