summaryrefslogtreecommitdiff
path: root/cpp/tests/TxAckTest.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-03-30 15:50:07 +0000
committerGordon Sim <gsim@apache.org>2007-03-30 15:50:07 +0000
commit33d8343d134a391fa7d0a338fafad1a22ff58dc3 (patch)
tree7c8b9ef3ea62852eb38548be87f908b2892e12a2 /cpp/tests/TxAckTest.cpp
parent8fc571ee337add8f2c4ab1f1ebc0c4784c58e2bf (diff)
downloadqpid-python-33d8343d134a391fa7d0a338fafad1a22ff58dc3.tar.gz
Refactored the MessageStore interface to restrict visibility of broker core from store implementations.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@524139 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/tests/TxAckTest.cpp')
-rw-r--r--cpp/tests/TxAckTest.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/cpp/tests/TxAckTest.cpp b/cpp/tests/TxAckTest.cpp
index c189533ea9..eb4ada4ac8 100644
--- a/cpp/tests/TxAckTest.cpp
+++ b/cpp/tests/TxAckTest.cpp
@@ -38,11 +38,11 @@ class TxAckTest : public CppUnit::TestCase
class TestMessageStore : public NullMessageStore
{
public:
- vector< std::pair<Message*, const string*> > dequeued;
+ vector<PersistableMessage*> dequeued;
- void dequeue(TransactionContext*, Message* const msg, const Queue& /*queue*/, const string * const xid)
+ void dequeue(TransactionContext*, PersistableMessage& msg, const PersistableQueue& /*queue*/)
{
- dequeued.push_back(std::pair<Message*, const string*>(msg, xid));
+ dequeued.push_back(&msg);
}
TestMessageStore() : NullMessageStore() {}
@@ -50,7 +50,6 @@ class TxAckTest : public CppUnit::TestCase
};
CPPUNIT_TEST_SUITE(TxAckTest);
- CPPUNIT_TEST(testPrepare2pc);
CPPUNIT_TEST(testPrepare);
CPPUNIT_TEST(testCommit);
CPPUNIT_TEST_SUITE_END();
@@ -62,12 +61,11 @@ class TxAckTest : public CppUnit::TestCase
vector<Message::shared_ptr> messages;
list<DeliveryRecord> deliveries;
TxAck op;
- std::string xid;
public:
- TxAckTest() : acked(0), queue(new Queue("my_queue", false, &store, 0)), op(acked, deliveries, &xid)
+ TxAckTest() : acked(0), queue(new Queue("my_queue", false, &store, 0)), op(acked, deliveries)
{
for(int i = 0; i < 10; i++){
Message::shared_ptr msg(
@@ -93,17 +91,7 @@ public:
CPPUNIT_ASSERT_EQUAL((size_t) 10, deliveries.size());
int dequeued[] = {0, 1, 2, 3, 4, 6, 8};
for (int i = 0; i < 7; i++) {
- CPPUNIT_ASSERT_EQUAL(messages[dequeued[i]].get(), store.dequeued[i].first);
- }
- }
-
- void testPrepare2pc()
- {
- xid = "abcdefg";
- testPrepare();
- const string expected(xid);
- for (int i = 0; i < 7; i++) {
- CPPUNIT_ASSERT_EQUAL(expected, *store.dequeued[i].second);
+ CPPUNIT_ASSERT_EQUAL((PersistableMessage*) messages[dequeued[i]].get(), store.dequeued[i]);
}
}