From 33d8343d134a391fa7d0a338fafad1a22ff58dc3 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 30 Mar 2007 15:50:07 +0000 Subject: 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 --- cpp/tests/TxBufferTest.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'cpp/tests/TxBufferTest.cpp') diff --git a/cpp/tests/TxBufferTest.cpp b/cpp/tests/TxBufferTest.cpp index 8a9b233eb9..bd8ae3796b 100644 --- a/cpp/tests/TxBufferTest.cpp +++ b/cpp/tests/TxBufferTest.cpp @@ -102,22 +102,25 @@ class TxBufferTest : public CppUnit::TestCase public: MockTransactionalStore() : state(OPEN){} + std::auto_ptr begin(const std::string&){ + throw "Operation not supported"; + } + void prepare(TPCTransactionContext&){ + throw "Operation not supported"; + } + std::auto_ptr begin(){ actual.push_back(BEGIN); std::auto_ptr txn(new TestTransactionContext(this)); return txn; } - void commit(TransactionContext* ctxt){ + void commit(TransactionContext& ctxt){ actual.push_back(COMMIT); - TestTransactionContext* txn(dynamic_cast(ctxt)); - CPPUNIT_ASSERT(txn); - txn->commit(); + dynamic_cast(ctxt).commit(); } - void abort(TransactionContext* ctxt){ + void abort(TransactionContext& ctxt){ actual.push_back(ABORT); - TestTransactionContext* txn(dynamic_cast(ctxt)); - CPPUNIT_ASSERT(txn); - txn->abort(); + dynamic_cast(ctxt).abort(); } MockTransactionalStore& expectBegin(){ expected.push_back(BEGIN); -- cgit v1.2.1