summaryrefslogtreecommitdiff
path: root/qpid/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
commit26061ee82f1f1790a78e391d8a5f8e2b13b16cca (patch)
tree1d19e0bfae4f96e2551647acd24903a5ae0c5c2f /qpid/cpp/src/tests/TxPublishTest.cpp
parentd801ef867c4b16ec022e4b1f1d01132670ab2bcb (diff)
downloadqpid-python-26061ee82f1f1790a78e391d8a5f8e2b13b16cca.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@566846 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/TxPublishTest.cpp')
-rw-r--r--qpid/cpp/src/tests/TxPublishTest.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/qpid/cpp/src/tests/TxPublishTest.cpp b/qpid/cpp/src/tests/TxPublishTest.cpp
index 3391be5128..d009dd9112 100644
--- a/qpid/cpp/src/tests/TxPublishTest.cpp
+++ b/qpid/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());