diff options
author | Alan Conway <aconway@apache.org> | 2008-08-26 19:19:44 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-08-26 19:19:44 +0000 |
commit | eeb3180c4c2e7a200e959e54f5e20ed6df26439e (patch) | |
tree | fa86d31d3424c062ba2d344c234673eeade6690b | |
parent | 7b71d1fc839fb93d3c3849b9a4ab82597aa423e8 (diff) | |
download | qpid-python-eeb3180c4c2e7a200e959e54f5e20ed6df26439e.tar.gz |
Added ClusterFixture::kill
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@689174 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/tests/cluster_test.cpp | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/qpid/cpp/src/tests/cluster_test.cpp b/qpid/cpp/src/tests/cluster_test.cpp index 8f3927732d..7140cc73bd 100644 --- a/qpid/cpp/src/tests/cluster_test.cpp +++ b/qpid/cpp/src/tests/cluster_test.cpp @@ -68,6 +68,10 @@ struct ClusterFixture : public vector<uint16_t> { void add(size_t n) { for (size_t i=0; i < n; ++i) add(); } void add(); void setup(); + void kill(size_t n) { + if (n) forkedBrokers[n-1]->stop(); + else broker0.shutdown(); + } }; ClusterFixture::ClusterFixture(size_t n) : name(Uuid(true).str()) { @@ -127,41 +131,6 @@ ostream& operator<<(ostream& o, const pair<T*, int>& array) { return o; } -struct Callback : public Cpg::Handler { - Callback(const string group_) : group(group_) {} - string group; - vector<string> delivered; - vector<int> configChanges; - - void deliver ( - cpg_handle_t /*handle*/, - struct cpg_name *grp, - uint32_t /*nodeid*/, - uint32_t /*pid*/, - void* msg, - int msg_len) - { - BOOST_CHECK_EQUAL(group, Cpg::str(*grp)); - delivered.push_back(string((char*)msg,msg_len)); - } - - void configChange( - cpg_handle_t /*handle*/, - struct cpg_name *grp, - struct cpg_address */*members*/, int nMembers, - struct cpg_address */*left*/, int nLeft, - struct cpg_address */*joined*/, int nJoined - ) - { - BOOST_CHECK_EQUAL(group, Cpg::str(*grp)); - configChanges.push_back(nMembers); - BOOST_MESSAGE("configChange: "<< - nLeft<<" left "<< - nJoined<<" joined "<< - nMembers<<" members."); - } -}; - QPID_AUTO_TEST_CASE(testForkedBroker) { // Verify the ForkedBroker works as expected. const char* argv[] = { "", "--auth=no", "--no-data-dir", "--log-prefix=testForkedBroker" }; |