From 72bca07ee53fb9476f268133f244d55d8f53d3b9 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@524139 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/tests/MessageBuilderTest.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'qpid/cpp/tests/MessageBuilderTest.cpp') diff --git a/qpid/cpp/tests/MessageBuilderTest.cpp b/qpid/cpp/tests/MessageBuilderTest.cpp index d3b3902e97..68e5abf60e 100644 --- a/qpid/cpp/tests/MessageBuilderTest.cpp +++ b/qpid/cpp/tests/MessageBuilderTest.cpp @@ -51,33 +51,32 @@ class MessageBuilderTest : public CppUnit::TestCase public: - void stage(Message* const msg) + void stage(PersistableMessage& msg) { - if (msg->getPersistenceId() == 0) { - header = new Buffer(msg->encodedHeaderSize()); - msg->encodeHeader(*header); + if (msg.getPersistenceId() == 0) { + header = new Buffer(msg.encodedSize()); + msg.encode(*header); content = new Buffer(contentBufferSize); - msg->setPersistenceId(1); + msg.setPersistenceId(1); } else { throw qpid::Exception("Message already staged!"); } } - void appendContent(Message* msg, const string& data) + void appendContent(PersistableMessage& msg, const string& data) { - if (msg) { + if (msg.getPersistenceId() == 1) { content->putRawData(data); } else { throw qpid::Exception("Invalid message id!"); } } - // Don't hide overloads. using NullMessageStore::destroy; - void destroy(BasicMessage* msg) + void destroy(PersistableMessage& msg) { - CPPUNIT_ASSERT(msg->getPersistenceId()); + CPPUNIT_ASSERT(msg.getPersistenceId()); } BasicMessage::shared_ptr getRestoredMessage() -- cgit v1.2.1