diff options
| author | Gordon Sim <gsim@apache.org> | 2008-11-20 17:24:55 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-11-20 17:24:55 +0000 |
| commit | 5b93ee887ca64e26fb2440bab4c9785ea3de2e79 (patch) | |
| tree | d9f1fe8e7c0f0a95eb3af94d2150bc27c569ab41 /cpp/src/tests/sender.cpp | |
| parent | be6a6d0014e60226607fdc8d7e5d67bd1eb13b4f (diff) | |
| download | qpid-python-5b93ee887ca64e26fb2440bab4c9785ea3de2e79.tar.gz | |
Added some extra test options.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@719298 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/sender.cpp')
| -rw-r--r-- | cpp/src/tests/sender.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cpp/src/tests/sender.cpp b/cpp/src/tests/sender.cpp index 2da1990041..a02b713d86 100644 --- a/cpp/src/tests/sender.cpp +++ b/cpp/src/tests/sender.cpp @@ -39,14 +39,14 @@ struct Args : public qpid::TestOptions { string destination; string key; - bool sendEos; + uint sendEos; - Args() : key("test-queue"), sendEos(false) + Args() : key("test-queue"), sendEos(0) { addOptions() ("exchange", qpid::optValue(destination, "EXCHANGE"), "Exchange to send messages to") ("routing-key", qpid::optValue(key, "KEY"), "Routing key to add to messages") - ("send-eos", qpid::optValue(sendEos), "Send EOS message to mark end of input"); + ("send-eos", qpid::optValue(sendEos, "N"), "Send N EOS messages to mark end of input"); } }; @@ -55,16 +55,16 @@ const string EOS("eos"); class Sender : public FailoverManager::Command { public: - Sender(const std::string& destination, const std::string& key, bool sendEos); + Sender(const std::string& destination, const std::string& key, uint sendEos); void execute(AsyncSession& session, bool isRetry); private: MessageReplayTracker sender; Message message; - const bool sendEos; + const uint sendEos; uint sent; }; -Sender::Sender(const std::string& destination, const std::string& key, bool eos) : +Sender::Sender(const std::string& destination, const std::string& key, uint eos) : sender(10), message(destination, key), sendEos(eos), sent(0) {} void Sender::execute(AsyncSession& session, bool isRetry) @@ -77,7 +77,7 @@ void Sender::execute(AsyncSession& session, bool isRetry) message.getHeaders().setInt("sn", ++sent); sender.send(message); } - if (sendEos) { + for (uint i = sendEos; i > 0; --i) { message.setData(EOS); sender.send(message); } |
