summaryrefslogtreecommitdiff
path: root/cpp/src/tests
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-06-26 21:39:28 +0000
committerAlan Conway <aconway@apache.org>2008-06-26 21:39:28 +0000
commit9e115470654bf67fbb4720ab3bfb3768b9331e55 (patch)
treeb4ba4b4829e955de74caf6c05c9874e52a1fa262 /cpp/src/tests
parenteabcd5c760c8d3b3e8f6f45a29c19148560f91cd (diff)
downloadqpid-python-9e115470654bf67fbb4720ab3bfb3768b9331e55.tar.gz
Plugin framework change: single PluginFactory creates per-target Plugin instances.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@672032 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
-rw-r--r--cpp/src/tests/Makefile.am3
-rw-r--r--cpp/src/tests/cluster.mk2
-rw-r--r--cpp/src/tests/cluster_test.cpp8
-rw-r--r--cpp/src/tests/qpid_test_plugin.h43
4 files changed, 6 insertions, 50 deletions
diff --git a/cpp/src/tests/Makefile.am b/cpp/src/tests/Makefile.am
index c8d94c18e9..c34bf03553 100644
--- a/cpp/src/tests/Makefile.am
+++ b/cpp/src/tests/Makefile.am
@@ -134,8 +134,7 @@ EXTRA_DIST += \
MessageUtils.h \
TestMessageStore.h \
MockConnectionInputHandler.h \
- TxMocks.h \
- qpid_test_plugin.h
+ TxMocks.h
check_LTLIBRARIES += libdlclose_noop.la
libdlclose_noop_la_LDFLAGS = -module -rpath $(abs_builddir)
diff --git a/cpp/src/tests/cluster.mk b/cpp/src/tests/cluster.mk
index d2961f0954..1f2413161a 100644
--- a/cpp/src/tests/cluster.mk
+++ b/cpp/src/tests/cluster.mk
@@ -15,6 +15,6 @@ EXTRA_DIST+=ais_check
check_PROGRAMS+=cluster_test
cluster_test_SOURCES=unit_test.cpp cluster_test.cpp
-cluster_test_LDADD=$(lib_client) $(lib_cluster) -lboost_unit_test_framework
+cluster_test_LDADD=$(lib_client) $(lib_cluster) $(lib_broker) -lboost_unit_test_framework
endif
diff --git a/cpp/src/tests/cluster_test.cpp b/cpp/src/tests/cluster_test.cpp
index 19dffe2ee4..b16c8f6cc0 100644
--- a/cpp/src/tests/cluster_test.cpp
+++ b/cpp/src/tests/cluster_test.cpp
@@ -157,14 +157,16 @@ struct ClusterFixture : public ptr_vector<BrokerFixture> {
void ClusterFixture::add() {
qpid::broker::Broker::Options opts;
// Assumes the cluster plugin is loaded.
- qpid::Plugin::addOptions(opts);
- const char* argv[] = { "--cluster-name=$CLUSTER" };
+ qpid::Plugin::Factory::addOptions(opts);
+ const char* argv[] = { "--cluster-name", ::getenv("USERNAME") };
// FIXME aconway 2008-06-26: fix parse() signature, should not need cast.
opts.parse(sizeof(argv)/sizeof(*argv), const_cast<char**>(argv));
push_back(new BrokerFixture(opts));
}
#if 0 // FIXME aconway 2008-06-26: TODO
+
+
QPID_AUTO_TEST_CASE(testWiringReplication) {
const size_t SIZE=3;
ClusterFixture cluster(SIZE);
@@ -175,14 +177,12 @@ QPID_AUTO_TEST_CASE(testWiringReplication) {
c0.session.exchangeDeclare("ex", arg::type="direct");
BOOST_CHECK_EQUAL("q", c0.session.queueQuery("q").getQueue());
BOOST_CHECK_EQUAL("direct", c0.session.exchangeQuery("ex").getType());
- c0.close();
// Verify all brokers get wiring update.
for (size_t i = 1; i < cluster.size(); ++i) {
Client c(cluster[i].getPort());
BOOST_CHECK_EQUAL("q", c.session.queueQuery("q").getQueue());
BOOST_CHECK_EQUAL("direct", c.session.exchangeQuery("ex").getType());
- c.close();
}
}
diff --git a/cpp/src/tests/qpid_test_plugin.h b/cpp/src/tests/qpid_test_plugin.h
deleted file mode 100644
index b2f4a8ffed..0000000000
--- a/cpp/src/tests/qpid_test_plugin.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef _qpid_test_plugin_
-#define _qpid_test_plugin_
-
-/*
- *
- * 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.
- *
- */
-
-/**
- * Convenience to include cppunit headers needed by qpid test plugins and
- * workaround for warning from superfluous main() declaration
- * in cppunit/TestPlugIn.h
- */
-
-#include <cppunit/TestCase.h>
-#include <cppunit/TextTestRunner.h>
-#include <cppunit/extensions/HelperMacros.h>
-#include <cppunit/plugin/TestPlugIn.h>
-
-// Redefine CPPUNIT_PLUGIN_IMPLEMENT_MAIN to a dummy typedef to avoid warnings.
-//
-#if defined(CPPUNIT_HAVE_UNIX_DLL_LOADER) || defined(CPPUNIT_HAVE_UNIX_SHL_LOADER)
-#undef CPPUNIT_PLUGIN_IMPLEMENT_MAIN
-#define CPPUNIT_PLUGIN_IMPLEMENT_MAIN() typedef char __CppUnitPlugInImplementMainDummyTypeDef
-#endif
-
-#endif /*!_qpid_test_plugin_*/