summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-09-19 12:55:15 +0000
committerAlan Conway <aconway@apache.org>2008-09-19 12:55:15 +0000
commit85021877a773ca361d90ebfce5d9ff0994d50378 (patch)
treee8c851e8ec3a408d7d119fee85a47040a7d6667e /cpp/src
parent24a755709c9a28500c1e6c21905854eb970dad00 (diff)
downloadqpid-python-85021877a773ca361d90ebfce5d9ff0994d50378.tar.gz
Clean up unused members/tests
qpid/broker/SemanticState.h,.cpp,SessionState.h: removed unused members. tests/DumpClientTest.cpp: unused, remove. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@697075 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/broker/SemanticState.h1
-rw-r--r--cpp/src/qpid/broker/SessionState.cpp2
-rw-r--r--cpp/src/qpid/broker/SessionState.h1
-rw-r--r--cpp/src/qpid/cluster/Cluster.h8
-rw-r--r--cpp/src/tests/DumpClientTest.cpp122
-rw-r--r--cpp/src/tests/cluster.mk1
6 files changed, 8 insertions, 127 deletions
diff --git a/cpp/src/qpid/broker/SemanticState.h b/cpp/src/qpid/broker/SemanticState.h
index 1d32d8aa50..e2dd4af95b 100644
--- a/cpp/src/qpid/broker/SemanticState.h
+++ b/cpp/src/qpid/broker/SemanticState.h
@@ -114,7 +114,6 @@ class SemanticState : public sys::OutputTask,
SessionContext& session;
DeliveryAdapter& deliveryAdapter;
- Queue::shared_ptr defaultQueue;
ConsumerImplMap consumers;
uint32_t prefetchSize;
uint16_t prefetchCount;
diff --git a/cpp/src/qpid/broker/SessionState.cpp b/cpp/src/qpid/broker/SessionState.cpp
index d0e75849d8..6358bd2145 100644
--- a/cpp/src/qpid/broker/SessionState.cpp
+++ b/cpp/src/qpid/broker/SessionState.cpp
@@ -50,7 +50,6 @@ SessionState::SessionState(
Broker& b, SessionHandler& h, const SessionId& id, const SessionState::Configuration& config)
: qpid::SessionState(id, config),
broker(b), handler(&h),
- ignoring(false),
semanticState(*this, *this),
adapter(semanticState),
msgBuilder(&broker.getStore(), broker.getStagingThreshold()),
@@ -237,7 +236,6 @@ void SessionState::handleIn(AMQFrame& frame) {
} else {
getProxy().getExecution().exception(e.code, commandId, 0, 0, 0, e.what(), FieldTable());
}
- ignoring = true;
handler->sendDetach();
}
}
diff --git a/cpp/src/qpid/broker/SessionState.h b/cpp/src/qpid/broker/SessionState.h
index e424559228..5dd57d2299 100644
--- a/cpp/src/qpid/broker/SessionState.h
+++ b/cpp/src/qpid/broker/SessionState.h
@@ -116,7 +116,6 @@ class SessionState : public qpid::SessionState,
Broker& broker;
SessionHandler* handler;
sys::AbsTime expiry; // Used by SessionManager.
- bool ignoring;
SemanticState semanticState;
SessionAdapter adapter;
MessageBuilder msgBuilder;
diff --git a/cpp/src/qpid/cluster/Cluster.h b/cpp/src/qpid/cluster/Cluster.h
index aa077ef63c..c63e2e3e58 100644
--- a/cpp/src/qpid/cluster/Cluster.h
+++ b/cpp/src/qpid/cluster/Cluster.h
@@ -34,8 +34,11 @@
#include "qmf/org/apache/qpid/cluster/Cluster.h"
#include <boost/intrusive_ptr.hpp>
+#include <boost/bind.hpp>
+#include <algorithm>
#include <vector>
+#include <map>
namespace qpid {
namespace cluster {
@@ -93,6 +96,11 @@ class Cluster : private Cpg::Handler, public management::Manageable
broker::Broker& getBroker();
void setDumpComplete();
+
+ template <class F> void eachConnection(const F& f) {
+ std::for_each(connections.begin(), connections.end(),
+ boost::bind(f, boost::bind(&ConnectionMap::value_type::second, _1)));
+ }
private:
typedef std::map<ConnectionId, boost::intrusive_ptr<cluster::Connection> > ConnectionMap;
diff --git a/cpp/src/tests/DumpClientTest.cpp b/cpp/src/tests/DumpClientTest.cpp
deleted file mode 100644
index 03cf12aec6..0000000000
--- a/cpp/src/tests/DumpClientTest.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * Licensed 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 "unit_test.h"
-#include "test_tools.h"
-#include "BrokerFixture.h"
-#include "qpid/cluster/DumpClient.h"
-#include "qpid/framing/Buffer.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/Url.h"
-#include <boost/assign.hpp>
-
-QPID_AUTO_TEST_SUITE(DumpClientTest)
-
-using namespace std;
-using namespace qpid;
-using namespace framing;
-using namespace client;
-using namespace cluster;
-using namespace sys;
-
-// Verify we can copy shared state - wiring + messages - from one
-// broker to another via the DumpClient.
-//
-QPID_AUTO_TEST_CASE(testDumpClientSharedState) {
- BrokerFixture donor, receiver;
- {
- Client c(donor.getPort());
- FieldTable args;
- args.setString("x", "y");
- c.session.queueDeclare("qa", arg::arguments=args);
- c.session.queueDeclare("qb", arg::alternateExchange="amq.direct");
-
- c.session.exchangeDeclare(arg::exchange="exd", arg::type="direct", arg::arguments=args);
- c.session.exchangeBind(arg::exchange="exd", arg::queue="qa", arg::bindingKey="foo");
- c.session.messageTransfer(arg::destination="exd", arg::content=Message("one", "foo"));
-
- c.session.exchangeDeclare("ext", arg::type="topic");
- c.session.exchangeBind(arg::exchange="ext", arg::queue="qb", arg::bindingKey="bar");
- c.subs.subscribe(c.lq, "qa", FlowControl::messageCredit(0));
- c.session.messageTransfer(arg::destination="ext", arg::content=Message("one", "bar"));
- c.session.messageTransfer(arg::destination="ext", arg::content=Message("two", "bar"));
-
- c.session.close();
- c.connection.close();
- }
- Url url(Url::getIpAddressesUrl(receiver.getPort()));
- qpid::cluster::DumpClient dump(url, *donor.broker, 0, 0);
- dump.dump();
- {
- Client r(receiver.getPort());
- // Verify exchanges
- ExchangeQueryResult ex=r.session.exchangeQuery("exd");
- BOOST_CHECK_EQUAL(ex.getType(), "direct");
- BOOST_CHECK_EQUAL(ex.getDurable(), false);
- BOOST_CHECK_EQUAL(ex.getNotFound(), false);
- BOOST_CHECK_EQUAL(ex.getArguments().getString("x"), "y");
-
- ex = r.session.exchangeQuery("ext");
- BOOST_CHECK_EQUAL(ex.getType(), "topic");
- BOOST_CHECK_EQUAL(ex.getNotFound(), false);
-
- // Verify queues
- QueueQueryResult qq = r.session.queueQuery("qa");
- BOOST_CHECK_EQUAL(qq.getQueue(), "qa");
- BOOST_CHECK_EQUAL(qq.getAlternateExchange(), "");
- BOOST_CHECK_EQUAL(qq.getArguments().getString("x"), "y");
- BOOST_CHECK_EQUAL(qq.getMessageCount(), (unsigned)1);
-
- qq = r.session.queueQuery("qb");
- BOOST_CHECK_EQUAL(qq.getQueue(), "qb");
- BOOST_CHECK_EQUAL(qq.getAlternateExchange(), "amq.direct");
- BOOST_CHECK_EQUAL(qq.getMessageCount(), (unsigned)2);
-
- // Verify messages
- Message m;
- BOOST_CHECK(r.subs.get(m, "qa", TIME_SEC));
- BOOST_CHECK_EQUAL(m.getData(), "one");
- BOOST_CHECK_EQUAL(m.getDeliveryProperties().getExchange(), "exd");
- BOOST_CHECK_EQUAL(m.getDeliveryProperties().getRoutingKey(), "foo");
-
- BOOST_CHECK(r.subs.get(m, "qb", TIME_SEC));
- BOOST_CHECK_EQUAL(m.getData(), "one");
- BOOST_CHECK_EQUAL(m.getDeliveryProperties().getExchange(), "ext");
- BOOST_CHECK_EQUAL(m.getDeliveryProperties().getRoutingKey(), "bar");
-
- BOOST_CHECK(r.subs.get(m, "qb", TIME_SEC));
- BOOST_CHECK_EQUAL(m.getData(), "two");
- BOOST_CHECK_EQUAL(m.getDeliveryProperties().getExchange(), "ext");
- BOOST_CHECK_EQUAL(m.getDeliveryProperties().getRoutingKey(), "bar");
-
- // Verify bindings
- r.session.messageTransfer(arg::destination="exd", arg::content=Message("xxx", "foo"));
- BOOST_CHECK(r.subs.get(m, "qa"));
- BOOST_CHECK_EQUAL(m.getData(), "xxx");
-
- r.session.messageTransfer(arg::destination="ext", arg::content=Message("yyy", "bar"));
- BOOST_CHECK(r.subs.get(m, "qb"));
- BOOST_CHECK_EQUAL(m.getData(), "yyy");
-
- r.session.close();
- r.connection.close();
- }
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/cpp/src/tests/cluster.mk b/cpp/src/tests/cluster.mk
index 55fa71b5e6..88574943fd 100644
--- a/cpp/src/tests/cluster.mk
+++ b/cpp/src/tests/cluster.mk
@@ -19,6 +19,5 @@ cluster_test_SOURCES=unit_test.cpp cluster_test.cpp
cluster_test_LDADD=$(lib_client) $(lib_cluster) -lboost_unit_test_framework
unit_test_LDADD+=$(lib_cluster)
-unit_test_SOURCES+=DumpClientTest.cpp
endif