summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2012-09-24 13:49:13 +0000
committerKim van der Riet <kpvdr@apache.org>2012-09-24 13:49:13 +0000
commitc095a631dcb2c7be5e167ed50f658f7c24330a45 (patch)
treef3c6dc1e3a9f6e12501c1dcb794d18779db477ac /cpp/src/tests
parent0f327ee25b5ab4b9a38a8620a666e6bfc66000e7 (diff)
downloadqpid-python-c095a631dcb2c7be5e167ed50f658f7c24330a45.tar.gz
QPID-3858: WIP: Provisional checkin: Wiring of async store interface to broker. Code compiles, but as persistent transactions are currentl disconnected, not all tests pass.
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1389378 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rw-r--r--cpp/src/tests/AsyncCompletion.cpp63
-rw-r--r--cpp/src/tests/DtxWorkRecordTest.cpp3
-rw-r--r--cpp/src/tests/QueueTest.cpp2
-rw-r--r--cpp/src/tests/TxBufferTest.cpp3
-rw-r--r--cpp/src/tests/test_store.cpp43
5 files changed, 64 insertions, 50 deletions
diff --git a/cpp/src/tests/AsyncCompletion.cpp b/cpp/src/tests/AsyncCompletion.cpp
index e32097106f..a864841f07 100644
--- a/cpp/src/tests/AsyncCompletion.cpp
+++ b/cpp/src/tests/AsyncCompletion.cpp
@@ -16,33 +16,34 @@
*
*/
-
-#include "unit_test.h"
-#include "test_tools.h"
-#include "BrokerFixture.h"
-#include "qpid/broker/NullMessageStore.h"
-#include "qpid/sys/BlockingQueue.h"
-#include "qpid/client/AsyncSession.h"
-#include "qpid/sys/Time.h"
-#include "qpid/framing/QueueQueryResult.h"
-#include "qpid/client/TypedResult.h"
-
-using namespace std;
-using namespace qpid;
-using namespace client;
-using namespace framing;
-
-namespace qpid { namespace broker {
-class TransactionContext;
-class PersistableQueue;
-}}
-
-using broker::PersistableMessage;
-using broker::NullMessageStore;
-using broker::TransactionContext;
-using broker::PersistableQueue;
-using sys::TIME_SEC;
-using boost::intrusive_ptr;
+// TODO: kpvdr: Rewrite this test in terms of an Null AsyncStore
+
+//#include "unit_test.h"
+//#include "test_tools.h"
+//#include "BrokerFixture.h"
+//#include "qpid/broker/NullMessageStore.h"
+//#include "qpid/sys/BlockingQueue.h"
+//#include "qpid/client/AsyncSession.h"
+//#include "qpid/sys/Time.h"
+//#include "qpid/framing/QueueQueryResult.h"
+//#include "qpid/client/TypedResult.h"
+//
+//using namespace std;
+//using namespace qpid;
+//using namespace client;
+//using namespace framing;
+//
+//namespace qpid { namespace broker {
+//class TransactionContext;
+//class PersistableQueue;
+//}}
+//
+//using broker::PersistableMessage;
+//using broker::NullMessageStore;
+//using broker::TransactionContext;
+//using broker::PersistableQueue;
+//using sys::TIME_SEC;
+//using boost::intrusive_ptr;
/** @file Unit tests for async completion.
* Using a dummy store, verify that the broker indicates async completion of
@@ -52,6 +53,7 @@ using boost::intrusive_ptr;
namespace qpid {
namespace tests {
+/*
class AsyncCompletionMessageStore : public NullMessageStore {
public:
sys::BlockingQueue<boost::intrusive_ptr<PersistableMessage> > enqueued;
@@ -72,8 +74,10 @@ QPID_AUTO_TEST_SUITE(AsyncCompletionTestSuite)
QPID_AUTO_TEST_CASE(testWaitTillComplete) {
SessionFixture fix;
AsyncCompletionMessageStore* store = new AsyncCompletionMessageStore;
- boost::shared_ptr<qpid::broker::MessageStore> p;
- p.reset(store);
+// boost::shared_ptr<qpid::broker::MessageStore> p;
+ boost::shared_ptr<qpid::broker::AsyncStore> p;
+// p.reset(store);
+ // TODO: kpvdr: Rewrite this test to use AsyncStore
fix.broker->setStore(p);
AsyncSession s = fix.session;
@@ -116,5 +120,6 @@ QPID_AUTO_TEST_CASE(testGetResult) {
}
QPID_AUTO_TEST_SUITE_END()
+*/
}} // namespace qpid::tests
diff --git a/cpp/src/tests/DtxWorkRecordTest.cpp b/cpp/src/tests/DtxWorkRecordTest.cpp
index 9d7666dca4..654342037e 100644
--- a/cpp/src/tests/DtxWorkRecordTest.cpp
+++ b/cpp/src/tests/DtxWorkRecordTest.cpp
@@ -32,6 +32,7 @@ namespace tests {
QPID_AUTO_TEST_SUITE(DtxWorkRecordTestSuite)
+/*
QPID_AUTO_TEST_CASE(testOnePhaseCommit){
MockTransactionalStore store;
store.expectBegin().expectCommit();
@@ -187,6 +188,8 @@ QPID_AUTO_TEST_CASE(testRollback){
opA->check();
opB->check();
}
+*/
+// TODO: kpvdr: Rewrite this test (and TxMocks.h) to use Async store
QPID_AUTO_TEST_SUITE_END()
diff --git a/cpp/src/tests/QueueTest.cpp b/cpp/src/tests/QueueTest.cpp
index 3dfe3863f4..7b7c653029 100644
--- a/cpp/src/tests/QueueTest.cpp
+++ b/cpp/src/tests/QueueTest.cpp
@@ -29,7 +29,7 @@
#include "qpid/broker/Deliverable.h"
#include "qpid/broker/ExchangeRegistry.h"
#include "qpid/broker/QueueRegistry.h"
-#include "qpid/broker/NullMessageStore.h"
+//#include "qpid/broker/NullMessageStore.h"
#include "qpid/broker/ExpiryPolicy.h"
#include "qpid/framing/DeliveryProperties.h"
#include "qpid/framing/FieldTable.h"
diff --git a/cpp/src/tests/TxBufferTest.cpp b/cpp/src/tests/TxBufferTest.cpp
index 4807026ab7..6c4473a662 100644
--- a/cpp/src/tests/TxBufferTest.cpp
+++ b/cpp/src/tests/TxBufferTest.cpp
@@ -32,6 +32,7 @@ namespace tests {
QPID_AUTO_TEST_SUITE(TxBufferTestSuite)
+/*
QPID_AUTO_TEST_CASE(testCommitLocal)
{
MockTransactionalStore store;
@@ -175,6 +176,8 @@ QPID_AUTO_TEST_CASE(testBufferIsClearedAfterCommit)
opA->check();
opB->check();
}
+*/
+// TODO: kpvdr: Rewrite this test (and TxMocks.h) to use Async store
QPID_AUTO_TEST_SUITE_END()
diff --git a/cpp/src/tests/test_store.cpp b/cpp/src/tests/test_store.cpp
index 83f6a5e4b1..e6bc55c033 100644
--- a/cpp/src/tests/test_store.cpp
+++ b/cpp/src/tests/test_store.cpp
@@ -19,7 +19,7 @@
*
*/
-
+// TODO: kpvdr: Rewrite this test in terms of an Null AsyncStore
/**@file
* Plug-in message store for tests.
*
@@ -32,26 +32,26 @@
* - do async completion after a delay.
*/
-#include "qpid/broker/NullMessageStore.h"
-#include "qpid/broker/Broker.h"
-#include "qpid/broker/amqp_0_10/MessageTransfer.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/log/Statement.h"
-#include "qpid/Plugin.h"
-#include "qpid/Options.h"
-#include <boost/cast.hpp>
-#include <boost/lexical_cast.hpp>
-#include <memory>
-#include <fstream>
-
-using namespace qpid;
-using namespace broker;
-using namespace std;
-using namespace qpid::sys;
+//#include "qpid/broker/NullMessageStore.h"
+//#include "qpid/broker/Broker.h"
+//#include "qpid/broker/amqp_0_10/MessageTransfer.h"
+//#include "qpid/framing/AMQFrame.h"
+//#include "qpid/log/Statement.h"
+//#include "qpid/Plugin.h"
+//#include "qpid/Options.h"
+//#include <boost/cast.hpp>
+//#include <boost/lexical_cast.hpp>
+//#include <memory>
+//#include <fstream>
+//
+//using namespace qpid;
+//using namespace broker;
+//using namespace std;
+//using namespace qpid::sys;
namespace qpid {
namespace tests {
-
+/*
struct TestStoreOptions : public Options {
string name;
@@ -76,6 +76,7 @@ struct Completer : public Runnable {
}
};
+
class TestStore : public NullMessageStore {
public:
TestStore(const TestStoreOptions& opts, Broker& broker_)
@@ -157,6 +158,7 @@ const string TestStore::EXCEPTION = "exception";
const string TestStore::EXIT_PROCESS = "exit_process";
const string TestStore::ASYNC="async ";
+
struct TestStorePlugin : public Plugin {
TestStoreOptions options;
@@ -168,12 +170,13 @@ struct TestStorePlugin : public Plugin {
Broker* broker = dynamic_cast<Broker*>(&target);
if (!broker) return;
boost::shared_ptr<MessageStore> p(new TestStore(options, *broker));
- broker->setStore (p);
+// broker->setStore (p);
+ // TODO: kpvdr: This test will need to be reworked in terms of an AsyncStore.
}
void initialize(qpid::Plugin::Target&) {}
};
static TestStorePlugin pluginInstance;
-
+*/
}} // namespace qpid::tests