diff options
author | Stephen D. Huston <shuston@apache.org> | 2009-04-23 21:06:35 +0000 |
---|---|---|
committer | Stephen D. Huston <shuston@apache.org> | 2009-04-23 21:06:35 +0000 |
commit | a7259adba14345898e78b483b7620340ffa5cfc5 (patch) | |
tree | e8d26c0981a666442ad4aa2fff5ddb87c5ce5866 /qpid/cpp/src/tests/SimpleTestCaseBase.cpp | |
parent | 8d32b03448e8e1ba6319fc0ac484d0ab54b29b38 (diff) | |
download | qpid-python-cmake.tar.gz |
Merge in trunk changes from r758432:768028cmake
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/cmake@768053 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/SimpleTestCaseBase.cpp')
-rw-r--r-- | qpid/cpp/src/tests/SimpleTestCaseBase.cpp | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/qpid/cpp/src/tests/SimpleTestCaseBase.cpp b/qpid/cpp/src/tests/SimpleTestCaseBase.cpp deleted file mode 100644 index 2739734731..0000000000 --- a/qpid/cpp/src/tests/SimpleTestCaseBase.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -#include "SimpleTestCaseBase.h" - -using namespace qpid; - -void SimpleTestCaseBase::start() -{ - if (worker.get()) { - worker->start(); - } -} - -void SimpleTestCaseBase::stop() -{ - if (worker.get()) { - worker->stop(); - } -} - -void SimpleTestCaseBase::report(client::Message& report) -{ - if (worker.get()) { - report.getHeaders().setInt("MESSAGE_COUNT", worker->getCount()); - //add number of messages sent or received - std::stringstream reportstr; - reportstr << worker->getCount(); - report.setData(reportstr.str()); - } -} - -SimpleTestCaseBase::Sender::Sender(ConnectionOptions& options, - const Exchange& _exchange, - const std::string& _key, - const int _messages) - : Worker(options, _messages), exchange(_exchange), key(_key) {} - -void SimpleTestCaseBase::Sender::init() -{ - channel.start(); -} - -void SimpleTestCaseBase::Sender::start(){ - Message msg; - while (count < messages) { - channel.publish(msg, exchange, key); - count++; - } - stop(); -} - -SimpleTestCaseBase::Worker::Worker(ConnectionOptions& options, const int _messages) : - messages(_messages), count(0) -{ - connection.open(options.host, options.port); - connection.openChannel(channel); -} - -void SimpleTestCaseBase::Worker::stop() -{ - channel.close(); - connection.close(); -} - -int SimpleTestCaseBase::Worker::getCount() -{ - return count; -} - |