diff options
author | Alan Conway <aconway@apache.org> | 2007-02-06 15:01:45 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-02-06 15:01:45 +0000 |
commit | fbd97f554b04a109c95c01fe6ad538c5f50161af (patch) | |
tree | 0324d02ee4f8d6ca2387d1d3ff85bcd61a123a34 /cpp/tests/ChannelTest.cpp | |
parent | 80b1b0b5f443bfb3c9d62a80e1419c224d0229d8 (diff) | |
download | qpid-python-fbd97f554b04a109c95c01fe6ad538c5f50161af.tar.gz |
* broker/Reference, tests/ReferenceTest: class representing a reference.
* broker/BrokerChannel.cpp (complete): get destination exchange from Message,
don't assume only one message in progress (could have multiple
references open.)
* broker/BrokerMessageMessage.cpp,.h: Contains transfer body and
vector of append bodies. Construct from Reference.
* broker/CompletionHandler.h: Extracted from BrokerMessage, used for
MessageMessage also.
* broker/ExchangeRegistry.cpp: Moved throw for missing exchanges to
registry.
* cpp/tests/start_broker: Increased wait time to 5 secs.
* cpp/tests/*: renamed DummyChannel as MockChannel.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@504172 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/tests/ChannelTest.cpp')
-rw-r--r-- | cpp/tests/ChannelTest.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/cpp/tests/ChannelTest.cpp b/cpp/tests/ChannelTest.cpp index a3dabe6408..dcfd2fdb90 100644 --- a/cpp/tests/ChannelTest.cpp +++ b/cpp/tests/ChannelTest.cpp @@ -28,7 +28,7 @@ #include <memory> #include <AMQP_HighestVersion.h> #include "AMQFrame.h" -#include "DummyChannel.h" +#include "MockChannel.h" #include "broker/Connection.h" #include "ProtocolInitiation.h" @@ -39,7 +39,7 @@ using namespace qpid::sys; using std::string; using std::queue; -struct DummyHandler : ConnectionOutputHandler{ +struct MockHandler : ConnectionOutputHandler{ std::vector<AMQFrame*> frames; void send(AMQFrame* frame){ frames.push_back(frame); } @@ -60,7 +60,7 @@ class ChannelTest : public CppUnit::TestCase Broker::shared_ptr broker; Connection connection; - DummyHandler handler; + MockHandler handler; class MockMessageStore : public NullMessageStore { @@ -240,10 +240,10 @@ class ChannelTest : public CppUnit::TestCase Channel channel( connection, 1, 1000/*framesize*/, &store, 10/*staging threshold*/); const string data[] = {"abcde", "fghij", "klmno"}; - + Message* msg = new BasicMessage( 0, "my_exchange", "my_routing_key", false, false, - DummyChannel::basicGetBody()); + MockChannel::basicGetBody()); store.expect(); store.stage(msg); @@ -253,7 +253,8 @@ class ChannelTest : public CppUnit::TestCase store.destroy(msg); store.test(); - Exchange::shared_ptr exchange(new FanOutExchange("my_exchange")); + Exchange::shared_ptr exchange = + broker->getExchanges().declare("my_exchange", "fanout").first; Queue::shared_ptr queue(new Queue("my_queue")); exchange->bind(queue, "", 0); @@ -333,7 +334,7 @@ class ChannelTest : public CppUnit::TestCase { BasicMessage* msg = new BasicMessage( 0, exchange, routingKey, false, false, - DummyChannel::basicGetBody()); + MockChannel::basicGetBody()); AMQHeaderBody::shared_ptr header(new AMQHeaderBody(BASIC)); header->setContentSize(contentSize); msg->setHeader(header); |