diff options
author | Gordon Sim <gsim@apache.org> | 2007-03-30 15:50:07 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2007-03-30 15:50:07 +0000 |
commit | 33d8343d134a391fa7d0a338fafad1a22ff58dc3 (patch) | |
tree | 7c8b9ef3ea62852eb38548be87f908b2892e12a2 /cpp/tests/TxBufferTest.cpp | |
parent | 8fc571ee337add8f2c4ab1f1ebc0c4784c58e2bf (diff) | |
download | qpid-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/TxBufferTest.cpp')
-rw-r--r-- | cpp/tests/TxBufferTest.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
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<TPCTransactionContext> begin(const std::string&){ + throw "Operation not supported"; + } + void prepare(TPCTransactionContext&){ + throw "Operation not supported"; + } + std::auto_ptr<TransactionContext> begin(){ actual.push_back(BEGIN); std::auto_ptr<TransactionContext> txn(new TestTransactionContext(this)); return txn; } - void commit(TransactionContext* ctxt){ + void commit(TransactionContext& ctxt){ actual.push_back(COMMIT); - TestTransactionContext* txn(dynamic_cast<TestTransactionContext*>(ctxt)); - CPPUNIT_ASSERT(txn); - txn->commit(); + dynamic_cast<TestTransactionContext&>(ctxt).commit(); } - void abort(TransactionContext* ctxt){ + void abort(TransactionContext& ctxt){ actual.push_back(ABORT); - TestTransactionContext* txn(dynamic_cast<TestTransactionContext*>(ctxt)); - CPPUNIT_ASSERT(txn); - txn->abort(); + dynamic_cast<TestTransactionContext&>(ctxt).abort(); } MockTransactionalStore& expectBegin(){ expected.push_back(BEGIN); |