diff options
| author | Alan Conway <aconway@apache.org> | 2007-02-02 22:03:10 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2007-02-02 22:03:10 +0000 |
| commit | b5c270f10496f522ef6a03a8fa60f85d55c9187d (patch) | |
| tree | 714e7abf7ba591d00232d821440e51461175cb9e /cpp/tests/MessageBuilderTest.cpp | |
| parent | 750f272ac99e8c830807affb3ae68ab0beeca63f (diff) | |
| download | qpid-python-b5c270f10496f522ef6a03a8fa60f85d55c9187d.tar.gz | |
* cpp/lib/common/framing/MethodContext.h: Reduced MethodContext to
ChannelAdapter and Method Body. Request ID comes from body,
ChannelAdapter is used to send frames, not OutputHandler.
* cpp/lib/common/framing/ChannelAdapter.h,.cpp: Removed context member.
Context is per-method not per-channel.
* cpp/lib/broker/*: Replace direct use of OutputHandler and ChannelId
with MethodContext (for responses) or ChannelAdapter (for requests.)
Use context request-ID to construct responses, send all bodies via
ChannelAdapter.
* cpp/lib/broker/BrokerAdapter.cpp: Link broker::Channel to BrokerAdapter.
* cpp/lib/broker/*: Remove unnecessary ProtocolVersion parameters.
Fix bogus signatures: ProtocolVersion* -> const ProtocolVersion&
* Cosmetic changes, many files:
- fixed indentation, broke long lines.
- removed unnecessary qpid:: prefixes.
* broker/BrokerAdapter,BrokerChannel: Merged BrokerAdapter into
broker::channel.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@502767 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/tests/MessageBuilderTest.cpp')
| -rw-r--r-- | cpp/tests/MessageBuilderTest.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/cpp/tests/MessageBuilderTest.cpp b/cpp/tests/MessageBuilderTest.cpp index e84d1df0e7..dc660751b7 100644 --- a/cpp/tests/MessageBuilderTest.cpp +++ b/cpp/tests/MessageBuilderTest.cpp @@ -26,6 +26,7 @@ #include <qpid_test_plugin.h> #include <iostream> #include <memory> +#include "DummyChannel.h" using namespace boost; using namespace qpid::broker; @@ -36,7 +37,7 @@ class MessageBuilderTest : public CppUnit::TestCase { struct DummyHandler : MessageBuilder::CompletionHandler{ Message::shared_ptr msg; - + virtual void complete(Message::shared_ptr& _msg){ msg = _msg; } @@ -48,7 +49,7 @@ class MessageBuilderTest : public CppUnit::TestCase Buffer* content; const u_int32_t contentBufferSize; - public: + public: void stage(Message* const msg) { @@ -98,7 +99,7 @@ class MessageBuilderTest : public CppUnit::TestCase } //dont care about any of the other methods: - TestMessageStore(u_int32_t _contentBufferSize) : NullMessageStore(false), header(0), content(0), + TestMessageStore(u_int32_t _contentBufferSize) : NullMessageStore(), header(0), content(0), contentBufferSize(_contentBufferSize) {} ~TestMessageStore(){} }; @@ -116,7 +117,10 @@ class MessageBuilderTest : public CppUnit::TestCase DummyHandler handler; MessageBuilder builder(&handler); - Message::shared_ptr message(new BasicMessage(0, "test", "my_routing_key", false, false)); + Message::shared_ptr message( + new BasicMessage( + 0, "test", "my_routing_key", false, false, + DummyChannel::basicGetBody())); AMQHeaderBody::shared_ptr header(new AMQHeaderBody(BASIC)); header->setContentSize(0); @@ -133,7 +137,9 @@ class MessageBuilderTest : public CppUnit::TestCase string data1("abcdefg"); - Message::shared_ptr message(new BasicMessage(0, "test", "my_routing_key", false, false)); + Message::shared_ptr message( + new BasicMessage(0, "test", "my_routing_key", false, false, + DummyChannel::basicGetBody())); AMQHeaderBody::shared_ptr header(new AMQHeaderBody(BASIC)); header->setContentSize(7); AMQContentBody::shared_ptr part1(new AMQContentBody(data1)); @@ -154,7 +160,9 @@ class MessageBuilderTest : public CppUnit::TestCase string data1("abcdefg"); string data2("hijklmn"); - Message::shared_ptr message(new BasicMessage(0, "test", "my_routing_key", false, false)); + Message::shared_ptr message( + new BasicMessage(0, "test", "my_routing_key", false, false, + DummyChannel::basicGetBody())); AMQHeaderBody::shared_ptr header(new AMQHeaderBody(BASIC)); header->setContentSize(14); AMQContentBody::shared_ptr part1(new AMQContentBody(data1)); @@ -183,7 +191,9 @@ class MessageBuilderTest : public CppUnit::TestCase string data1("abcdefg"); string data2("hijklmn"); - Message::shared_ptr message(new BasicMessage(0, "test", "my_routing_key", false, false)); + Message::shared_ptr message( + new BasicMessage(0, "test", "my_routing_key", false, false, + DummyChannel::basicGetBody())); AMQHeaderBody::shared_ptr header(new AMQHeaderBody(BASIC)); header->setContentSize(14); BasicHeaderProperties* properties = dynamic_cast<BasicHeaderProperties*>(header->getProperties()); |
