diff options
Diffstat (limited to 'cpp/src/tests')
-rw-r--r-- | cpp/src/tests/ForkedBroker.h | 6 | ||||
-rw-r--r-- | cpp/src/tests/cluster_test.cpp | 12 |
2 files changed, 13 insertions, 5 deletions
diff --git a/cpp/src/tests/ForkedBroker.h b/cpp/src/tests/ForkedBroker.h index a7869ff602..07e69a0735 100644 --- a/cpp/src/tests/ForkedBroker.h +++ b/cpp/src/tests/ForkedBroker.h @@ -53,12 +53,12 @@ class ForkedBroker { } ~ForkedBroker() { - try { stop(); } catch(const std::exception& e) { - QPID_LOG(error, QPID_MSG("Stopping forked broker: " << e.what())); + try { kill(); } catch(const std::exception& e) { + QPID_LOG(error, QPID_MSG("Killing forked broker: " << e.what())); } } - void stop() { + void kill() { using qpid::ErrnoException; if (pid == 0) return; if (::kill(pid, SIGINT) < 0) throw ErrnoException("kill failed"); diff --git a/cpp/src/tests/cluster_test.cpp b/cpp/src/tests/cluster_test.cpp index 7140cc73bd..3f09143fff 100644 --- a/cpp/src/tests/cluster_test.cpp +++ b/cpp/src/tests/cluster_test.cpp @@ -69,8 +69,8 @@ struct ClusterFixture : public vector<uint16_t> { void add(); void setup(); void kill(size_t n) { - if (n) forkedBrokers[n-1]->stop(); - else broker0.shutdown(); + if (n) forkedBrokers[n-1].kill(); + else broker0->broker->shutdown(); } }; @@ -139,6 +139,14 @@ QPID_AUTO_TEST_CASE(testForkedBroker) { BOOST_CHECK_EQUAL("direct", c.session.exchangeQuery("amq.direct").getType()); } +QPID_AUTO_TEST_CASE(testSingletonCluster) { + // Test against a singleton cluster, verify basic operation. + ClusterFixture cluster(1); + Client c(cluster[0]); + BOOST_CHECK(c.session.queueQuery("q").getQueue().empty()); + BOOST_CHECK(c.session.exchangeQuery("ex").getType().empty()); +} + QPID_AUTO_TEST_CASE(testWiringReplication) { ClusterFixture cluster(3); Client c0(cluster[0]); |