summaryrefslogtreecommitdiff
path: root/cpp/tests/BrokerChannelTest.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/BrokerChannelTest.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/BrokerChannelTest.cpp')
-rw-r--r--cpp/tests/BrokerChannelTest.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/cpp/tests/BrokerChannelTest.cpp b/cpp/tests/BrokerChannelTest.cpp
index 61135c898b..66a7138dab 100644
--- a/cpp/tests/BrokerChannelTest.cpp
+++ b/cpp/tests/BrokerChannelTest.cpp
@@ -68,7 +68,7 @@ class BrokerChannelTest : public CppUnit::TestCase
struct MethodCall
{
const string name;
- Message* const msg;
+ PersistableMessage* msg;
const string data;//only needed for appendContent
void check(const MethodCall& other) const
@@ -92,7 +92,7 @@ class BrokerChannelTest : public CppUnit::TestCase
}
}
- void handle(const string& name, Message* msg, const string& data)
+ void handle(const string& name, PersistableMessage* msg, const string& data)
{
MethodCall call = {name, msg, data};
handle(call);
@@ -102,25 +102,25 @@ class BrokerChannelTest : public CppUnit::TestCase
MockMessageStore() : expectMode(false) {}
- void stage(Message* const msg)
+ void stage(PersistableMessage& msg)
{
- if(!expectMode) msg->setPersistenceId(1);
- MethodCall call = {"stage", msg, ""};
+ if(!expectMode) msg.setPersistenceId(1);
+ MethodCall call = {"stage", &msg, ""};
handle(call);
}
- void appendContent(Message* msg, const string& data)
+ void appendContent(PersistableMessage& msg, const string& data)
{
- MethodCall call = {"appendContent", msg, data};
+ MethodCall call = {"appendContent", &msg, data};
handle(call);
}
// Don't hide overloads.
using NullMessageStore::destroy;
- void destroy(Message* msg)
+ void destroy(PersistableMessage& msg)
{
- MethodCall call = {"destroy", msg, ""};
+ MethodCall call = {"destroy", &msg, ""};
handle(call);
}
@@ -249,11 +249,11 @@ class BrokerChannelTest : public CppUnit::TestCase
MockChannel::basicGetBody());
store.expect();
- store.stage(msg);
+ store.stage(*msg);
for (int i = 0; i < 3; i++) {
- store.appendContent(msg, data[i]);
+ store.appendContent(*msg, data[i]);
}
- store.destroy(msg);
+ store.destroy(*msg);
store.test();
Exchange::shared_ptr exchange =
@@ -304,8 +304,8 @@ class BrokerChannelTest : public CppUnit::TestCase
policy.update(settings);
store.expect();
- store.stage(msg3.get());
- store.destroy(msg3.get());
+ store.stage(*msg3);
+ store.destroy(*msg3);
store.test();
Queue::shared_ptr queue(new Queue("my_queue", false, &store, 0));