diff options
| author | Gordon Sim <gsim@apache.org> | 2006-11-17 11:03:22 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2006-11-17 11:03:22 +0000 |
| commit | 39afa34d1965ee3d97b8cc488ec33e46ea908699 (patch) | |
| tree | 40c4919a5ad47bc06042a78bc88ceadeef8787a9 /qpid/cpp/test | |
| parent | f82c31e4317e8eb405db923e40501b2ba85c3abd (diff) | |
| download | qpid-python-39afa34d1965ee3d97b8cc488ec33e46ea908699.tar.gz | |
Some fixes and tests for bugs uncovered during testing of persistence.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@476108 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/test')
| -rw-r--r-- | qpid/cpp/test/unit/qpid/broker/TxBufferTest.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/qpid/cpp/test/unit/qpid/broker/TxBufferTest.cpp b/qpid/cpp/test/unit/qpid/broker/TxBufferTest.cpp index ea3cd1e2b7..3789d340f8 100644 --- a/qpid/cpp/test/unit/qpid/broker/TxBufferTest.cpp +++ b/qpid/cpp/test/unit/qpid/broker/TxBufferTest.cpp @@ -153,6 +153,8 @@ class TxBufferTest : public CppUnit::TestCase CPPUNIT_TEST(testPrepareAndCommit); CPPUNIT_TEST(testFailOnPrepare); CPPUNIT_TEST(testRollback); + CPPUNIT_TEST(testBufferIsClearedAfterRollback); + CPPUNIT_TEST(testBufferIsClearedAfterCommit); CPPUNIT_TEST_SUITE_END(); public: @@ -224,6 +226,38 @@ class TxBufferTest : public CppUnit::TestCase opB.check(); opC.check(); } + + void testBufferIsClearedAfterRollback(){ + MockTxOp opA; + opA.expectRollback(); + MockTxOp opB; + opB.expectRollback(); + + TxBuffer buffer; + buffer.enlist(&opA); + buffer.enlist(&opB); + + buffer.rollback(); + buffer.commit();//second call should not reach ops + opA.check(); + opB.check(); + } + + void testBufferIsClearedAfterCommit(){ + MockTxOp opA; + opA.expectCommit(); + MockTxOp opB; + opB.expectCommit(); + + TxBuffer buffer; + buffer.enlist(&opA); + buffer.enlist(&opB); + + buffer.commit(); + buffer.rollback();//second call should not reach ops + opA.check(); + opB.check(); + } }; // Make this test suite a plugin. |
