From 85189f2d04df4cfc8b16ee78187fb89d00dfe3ff Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 20 Feb 2008 15:07:51 +0000 Subject: [PATCH] The configure method takes test_only flag so we can avoid doing "real" work in tests and test of configuration in general. --- src/ex_filter_frontend_net.cpp | 6 +- src/ex_router_flexml.cpp | 4 +- src/filter.cpp | 4 +- src/filter.hpp | 4 +- src/filter_auth_simple.cpp | 4 +- src/filter_auth_simple.hpp | 4 +- src/filter_cql_to_rpn.cpp | 6 +- src/filter_cql_to_rpn.hpp | 4 +- src/filter_frontend_net.cpp | 103 +++++++++++++++++++++------------- src/filter_frontend_net.hpp | 8 +-- src/filter_http_file.cpp | 4 +- src/filter_http_file.hpp | 4 +- src/filter_load_balance.cpp | 4 +- src/filter_load_balance.hpp | 4 +- src/filter_log.cpp | 4 +- src/filter_log.hpp | 4 +- src/filter_multi.cpp | 4 +- src/filter_multi.hpp | 4 +- src/filter_query_rewrite.cpp | 4 +- src/filter_query_rewrite.hpp | 4 +- src/filter_record_transform.cpp | 4 +- src/filter_record_transform.hpp | 4 +- src/filter_session_shared.cpp | 4 +- src/filter_session_shared.hpp | 4 +- src/filter_sru_to_z3950.cpp | 4 +- src/filter_sru_to_z3950.hpp | 4 +- src/filter_template.cpp | 6 +- src/filter_template.hpp | 4 +- src/filter_virt_db.cpp | 6 +- src/filter_virt_db.hpp | 4 +- src/filter_z3950_client.cpp | 6 +- src/filter_z3950_client.hpp | 4 +- src/filter_zeerex_explain.cpp | 4 +- src/filter_zeerex_explain.hpp | 4 +- src/metaproxy_prog.cpp | 5 +- src/router_flexml.cpp | 46 +++++++++------ src/router_flexml.hpp | 8 ++- src/test_filter2.cpp | 10 ++-- src/test_filter_frontend_net.cpp | 8 +-- src/test_filter_query_rewrite.cpp | 4 +- src/test_filter_record_transform.cpp | 4 +- src/test_router_flexml.cpp | 10 ++-- 42 files changed, 192 insertions(+), 152 deletions(-) diff --git a/src/ex_filter_frontend_net.cpp b/src/ex_filter_frontend_net.cpp index f832472..9c66b37 100644 --- a/src/ex_filter_frontend_net.cpp +++ b/src/ex_filter_frontend_net.cpp @@ -1,4 +1,4 @@ -/* $Id: ex_filter_frontend_net.cpp,v 1.31 2008-02-20 10:51:11 adam Exp $ +/* $Id: ex_filter_frontend_net.cpp,v 1.32 2008-02-20 15:07:51 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -106,11 +106,11 @@ int main(int argc, char **argv) // put frontend filter in router mp::filter::FrontendNet filter_front; - filter_front.ports() = ports; + filter_front.set_ports(ports); // 0=no time, >0 timeout in seconds if (duration != -1) - filter_front.listen_duration() = duration; + filter_front.set_listen_duration(duration); router.append(filter_front); diff --git a/src/ex_router_flexml.cpp b/src/ex_router_flexml.cpp index e318c15..b8ec894 100644 --- a/src/ex_router_flexml.cpp +++ b/src/ex_router_flexml.cpp @@ -1,4 +1,4 @@ -/* $Id: ex_router_flexml.cpp,v 1.12 2008-02-20 10:51:11 adam Exp $ +/* $Id: ex_router_flexml.cpp,v 1.13 2008-02-20 15:07:51 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -77,7 +77,7 @@ int main(int argc, char **argv) if (doc) { mp::FactoryStatic factory; - mp::RouterFleXML router(doc, factory); + mp::RouterFleXML router(doc, factory, false); mp::Package pack; diff --git a/src/filter.cpp b/src/filter.cpp index 4cef1ae..9e2a463 100644 --- a/src/filter.cpp +++ b/src/filter.cpp @@ -1,4 +1,4 @@ -/* $Id: filter.cpp,v 1.10 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter.cpp,v 1.11 2008-02-20 15:07:51 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -26,7 +26,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA namespace mp = metaproxy_1; -void mp::filter::Base::configure(const xmlNode * ptr) +void mp::filter::Base::configure(const xmlNode * ptr, bool test_only) { mp::xml::check_empty(ptr); } diff --git a/src/filter.hpp b/src/filter.hpp index 352670e..672d560 100644 --- a/src/filter.hpp +++ b/src/filter.hpp @@ -1,4 +1,4 @@ -/* $Id: filter.hpp,v 1.20 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter.hpp,v 1.21 2008-02-20 15:07:51 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -40,7 +40,7 @@ namespace metaproxy_1 { virtual void process(Package & package) const = 0; /// configuration during filter load - virtual void configure(const xmlNode * ptr); + virtual void configure(const xmlNode * ptr, bool test_only); }; class FilterException : public std::runtime_error { diff --git a/src/filter_auth_simple.cpp b/src/filter_auth_simple.cpp index f48dd15..d394777 100644 --- a/src/filter_auth_simple.cpp +++ b/src/filter_auth_simple.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_auth_simple.cpp,v 1.24 2007-05-23 14:24:10 adam Exp $ +/* $Id: filter_auth_simple.cpp,v 1.25 2008-02-20 15:07:51 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -76,7 +76,7 @@ static void die(std::string s) { throw mp::filter::FilterException(s); } // Read XML config.. Put config info in m_p. -void mp::filter::AuthSimple::configure(const xmlNode * ptr) +void mp::filter::AuthSimple::configure(const xmlNode * ptr, bool test_only) { std::string userRegisterName; std::string targetRegisterName; diff --git a/src/filter_auth_simple.hpp b/src/filter_auth_simple.hpp index 11c55bd..9f95849 100644 --- a/src/filter_auth_simple.hpp +++ b/src/filter_auth_simple.hpp @@ -1,4 +1,4 @@ -/* $Id: filter_auth_simple.hpp,v 1.9 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_auth_simple.hpp,v 1.10 2008-02-20 15:07:51 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -34,7 +34,7 @@ namespace metaproxy_1 { public: AuthSimple(); ~AuthSimple(); - void configure(const xmlNode * ptr); + void configure(const xmlNode * ptr, bool test_only); void process(metaproxy_1::Package & package) const; private: void config_userRegister(std::string filename); diff --git a/src/filter_cql_to_rpn.cpp b/src/filter_cql_to_rpn.cpp index fe54450..245944e 100644 --- a/src/filter_cql_to_rpn.cpp +++ b/src/filter_cql_to_rpn.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_cql_to_rpn.cpp,v 1.7 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_cql_to_rpn.cpp,v 1.8 2008-02-20 15:07:51 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -18,7 +18,7 @@ along with Metaproxy; see the file LICENSE. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: filter_cql_to_rpn.cpp,v 1.7 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_cql_to_rpn.cpp,v 1.8 2008-02-20 15:07:51 adam Exp $ Copyright (c) 2005-2007, Index Data. See the LICENSE file for details @@ -68,7 +68,7 @@ yf::CQLtoRPN::~CQLtoRPN() { // must have a destructor because of boost::scoped_ptr } -void yf::CQLtoRPN::configure(const xmlNode *xmlnode) +void yf::CQLtoRPN::configure(const xmlNode *xmlnode, bool test_only) { m_p->configure(xmlnode); } diff --git a/src/filter_cql_to_rpn.hpp b/src/filter_cql_to_rpn.hpp index bb279d6..06bc581 100644 --- a/src/filter_cql_to_rpn.hpp +++ b/src/filter_cql_to_rpn.hpp @@ -1,4 +1,4 @@ -/* $Id: filter_cql_to_rpn.hpp,v 1.4 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_cql_to_rpn.hpp,v 1.5 2008-02-20 15:07:51 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -36,7 +36,7 @@ namespace metaproxy_1 { CQLtoRPN(); ~CQLtoRPN(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr); + void configure(const xmlNode * ptr, bool test_only); private: }; } diff --git a/src/filter_frontend_net.cpp b/src/filter_frontend_net.cpp index 1b87267..22a3a9d 100644 --- a/src/filter_frontend_net.cpp +++ b/src/filter_frontend_net.cpp @@ -1,5 +1,5 @@ -/* $Id: filter_frontend_net.cpp,v 1.25 2008-01-21 16:15:00 adam Exp $ - Copyright (c) 2005-2007, Index Data. +/* $Id: filter_frontend_net.cpp,v 1.26 2008-02-20 15:07:51 adam Exp $ + Copyright (c) 2005-2008, Index Data. This file is part of Metaproxy. @@ -37,6 +37,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA namespace mp = metaproxy_1; namespace metaproxy_1 { + class My_Timer_Thread; + class ZAssocServer; namespace filter { class FrontendNet::Rep { friend class FrontendNet; @@ -44,6 +46,9 @@ namespace metaproxy_1 { std::vector m_ports; int m_listen_duration; int m_session_timeout; + yazpp_1::SocketManager mySocketManager; + + ZAssocServer **az; }; } class My_Timer_Thread : public yazpp_1::ISocketObserver { @@ -95,10 +100,9 @@ namespace metaproxy_1 { class ZAssocServer : public yazpp_1::Z_Assoc { public: ~ZAssocServer(); - ZAssocServer(yazpp_1::IPDU_Observable *PDU_Observable, - mp::ThreadPoolSocketObserver *m_thread_pool_observer, - const mp::Package *package, - int timeout); + ZAssocServer(yazpp_1::IPDU_Observable *PDU_Observable, int timeout); + void set_package(const mp::Package *package); + void set_thread_pool(ThreadPoolSocketObserver *m_thread_pool_observer); private: yazpp_1::IPDU_Observer* sessionNotify( yazpp_1::IPDU_Observable *the_PDU_Observable, @@ -233,14 +237,21 @@ void mp::ZAssocChild::connectNotify() } mp::ZAssocServer::ZAssocServer(yazpp_1::IPDU_Observable *PDU_Observable, - mp::ThreadPoolSocketObserver *thread_pool_observer, - const mp::Package *package, int timeout) : Z_Assoc(PDU_Observable), m_session_timeout(timeout) { - m_thread_pool_observer = thread_pool_observer; + m_package = 0; +} + + +void mp::ZAssocServer::set_package(const mp::Package *package) +{ m_package = package; +} +void mp::ZAssocServer::set_thread_pool(ThreadPoolSocketObserver *observer) +{ + m_thread_pool_observer = observer; } yazpp_1::IPDU_Observer *mp::ZAssocServer::sessionNotify(yazpp_1::IPDU_Observable @@ -278,10 +289,18 @@ mp::filter::FrontendNet::FrontendNet() : m_p(new Rep) m_p->m_no_threads = 5; m_p->m_listen_duration = 0; m_p->m_session_timeout = 300; // 5 minutes + m_p->az = 0; } mp::filter::FrontendNet::~FrontendNet() { + if (m_p->az) + { + size_t i; + for (i = 0; im_ports.size(); i++) + delete m_p->az[i]; + delete [] m_p->az; + } } bool mp::My_Timer_Thread::timeout() @@ -306,44 +325,31 @@ void mp::My_Timer_Thread::socketNotify(int event) void mp::filter::FrontendNet::process(Package &package) const { - if (m_p->m_ports.size() == 0) + if (m_p->az == 0) return; - - yazpp_1::SocketManager mySocketManager; - + size_t i; My_Timer_Thread *tt = 0; - if (m_p->m_listen_duration) - tt = new My_Timer_Thread(&mySocketManager, m_p->m_listen_duration); - - ThreadPoolSocketObserver threadPool(&mySocketManager, m_p->m_no_threads); - mp::ZAssocServer **az = new mp::ZAssocServer *[m_p->m_ports.size()]; + if (m_p->m_listen_duration) + tt = new My_Timer_Thread(&m_p->mySocketManager, + m_p->m_listen_duration); + + ThreadPoolSocketObserver tp(&m_p->mySocketManager, m_p->m_no_threads); - // Create mp::ZAssocServer for each port - size_t i; for (i = 0; im_ports.size(); i++) { - // create a PDU assoc object (one per mp::ZAssocServer) - yazpp_1::PDU_Assoc *as = new yazpp_1::PDU_Assoc(&mySocketManager); - - // create ZAssoc with PDU Assoc - az[i] = new mp::ZAssocServer(as, &threadPool, &package, - m_p->m_session_timeout); - az[i]->server(m_p->m_ports[i].c_str()); + m_p->az[i]->set_package(&package); + m_p->az[i]->set_thread_pool(&tp); } - while (mySocketManager.processEvent() > 0) + while (m_p->mySocketManager.processEvent() > 0) { if (tt && tt->timeout()) break; } - for (i = 0; im_ports.size(); i++) - delete az[i]; - - delete [] az; delete tt; } -void mp::filter::FrontendNet::configure(const xmlNode * ptr) +void mp::filter::FrontendNet::configure(const xmlNode * ptr, bool test_only) { if (!ptr || !ptr->children) { @@ -385,17 +391,38 @@ void mp::filter::FrontendNet::configure(const xmlNode * ptr) ptr->name)); } } - m_p->m_ports = ports; + if (test_only) + return; + set_ports(ports); } -std::vector &mp::filter::FrontendNet::ports() +void mp::filter::FrontendNet::set_ports(std::vector &ports) { - return m_p->m_ports; + m_p->m_ports = ports; + + m_p->az = new mp::ZAssocServer *[m_p->m_ports.size()]; + + // Create mp::ZAssocServer for each port + size_t i; + for (i = 0; im_ports.size(); i++) + { + // create a PDU assoc object (one per mp::ZAssocServer) + yazpp_1::PDU_Assoc *as = new yazpp_1::PDU_Assoc(&m_p->mySocketManager); + + // create ZAssoc with PDU Assoc + m_p->az[i] = new mp::ZAssocServer(as, + m_p->m_session_timeout); + if (m_p->az[i]->server(m_p->m_ports[i].c_str())) + { + throw mp::filter::FilterException("Unable to bind to address " + + std::string(m_p->m_ports[i])); + } + } } -int &mp::filter::FrontendNet::listen_duration() +void mp::filter::FrontendNet::set_listen_duration(int d) { - return m_p->m_listen_duration; + m_p->m_listen_duration = d; } static mp::filter::Base* filter_creator() diff --git a/src/filter_frontend_net.hpp b/src/filter_frontend_net.hpp index e26b0ac..8245d03 100644 --- a/src/filter_frontend_net.hpp +++ b/src/filter_frontend_net.hpp @@ -1,4 +1,4 @@ -/* $Id: filter_frontend_net.hpp,v 1.16 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_frontend_net.hpp,v 1.17 2008-02-20 15:07:51 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -38,12 +38,12 @@ namespace metaproxy_1 { FrontendNet(); ~FrontendNet(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr); + void configure(const xmlNode * ptr, bool test_only); public: /// set ports - std::vector &ports(); + void set_ports(std::vector &ports); // set liten duraction (number of seconcds to listen) - int &listen_duration(); + void set_listen_duration(int d); }; } } diff --git a/src/filter_http_file.cpp b/src/filter_http_file.cpp index e0b132c..5f60385 100644 --- a/src/filter_http_file.cpp +++ b/src/filter_http_file.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_http_file.cpp,v 1.9 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_http_file.cpp,v 1.10 2008-02-20 15:07:51 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -215,7 +215,7 @@ void yf::HttpFile::process(mp::Package &package) const package.move(); } -void mp::filter::HttpFile::configure(const xmlNode * ptr) +void mp::filter::HttpFile::configure(const xmlNode * ptr, bool test_only) { for (ptr = ptr->children; ptr; ptr = ptr->next) { diff --git a/src/filter_http_file.hpp b/src/filter_http_file.hpp index 416ee7d..8fcee4c 100644 --- a/src/filter_http_file.hpp +++ b/src/filter_http_file.hpp @@ -1,4 +1,4 @@ -/* $Id: filter_http_file.hpp,v 1.7 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_http_file.hpp,v 1.8 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -37,7 +37,7 @@ namespace metaproxy_1 { HttpFile(); ~HttpFile(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr); + void configure(const xmlNode * ptr, bool test_only); }; } } diff --git a/src/filter_load_balance.cpp b/src/filter_load_balance.cpp index ea1a8ba..c91791b 100644 --- a/src/filter_load_balance.cpp +++ b/src/filter_load_balance.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_load_balance.cpp,v 1.9 2008-01-29 16:51:12 adam Exp $ +/* $Id: filter_load_balance.cpp,v 1.10 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -102,7 +102,7 @@ yf::LoadBalance::~LoadBalance() { // must have a destructor because of boost::scoped_ptr } -void yf::LoadBalance::configure(const xmlNode *xmlnode) +void yf::LoadBalance::configure(const xmlNode *xmlnode, bool test_only) { m_p->configure(xmlnode); } diff --git a/src/filter_load_balance.hpp b/src/filter_load_balance.hpp index afe1df0..371dc38 100644 --- a/src/filter_load_balance.hpp +++ b/src/filter_load_balance.hpp @@ -1,4 +1,4 @@ -/* $Id: filter_load_balance.hpp,v 1.3 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_load_balance.hpp,v 1.4 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -36,7 +36,7 @@ namespace metaproxy_1 { LoadBalance(); ~LoadBalance(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr); + void configure(const xmlNode * ptr, bool test_only); }; } } diff --git a/src/filter_log.cpp b/src/filter_log.cpp index a93c7cd..74e86db 100644 --- a/src/filter_log.cpp +++ b/src/filter_log.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_log.cpp,v 1.32 2007-05-24 14:07:12 adam Exp $ +/* $Id: filter_log.cpp,v 1.33 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -106,7 +106,7 @@ yf::Log::~Log() { // must have a destructor because of boost::scoped_ptr } -void yf::Log::configure(const xmlNode *xmlnode) +void yf::Log::configure(const xmlNode *xmlnode, bool test_only) { m_p->configure(xmlnode); } diff --git a/src/filter_log.hpp b/src/filter_log.hpp index ab37f4f..a52b2d3 100644 --- a/src/filter_log.hpp +++ b/src/filter_log.hpp @@ -1,4 +1,4 @@ -/* $Id: filter_log.hpp,v 1.19 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_log.hpp,v 1.20 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -35,7 +35,7 @@ namespace metaproxy_1 { Log(const std::string &x); ~Log(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr); + void configure(const xmlNode * ptr, bool test_only); //class LFile; private: class Impl; diff --git a/src/filter_multi.cpp b/src/filter_multi.cpp index fdfbe89..caa5949 100644 --- a/src/filter_multi.cpp +++ b/src/filter_multi.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_multi.cpp,v 1.30 2008-01-19 09:02:11 adam Exp $ +/* $Id: filter_multi.cpp,v 1.31 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -1173,7 +1173,7 @@ void yf::Multi::process(mp::Package &package) const m_p->release_frontend(package); } -void mp::filter::Multi::configure(const xmlNode * ptr) +void mp::filter::Multi::configure(const xmlNode * ptr, bool test_only) { for (ptr = ptr->children; ptr; ptr = ptr->next) { diff --git a/src/filter_multi.hpp b/src/filter_multi.hpp index c5cdd24..4118c1f 100644 --- a/src/filter_multi.hpp +++ b/src/filter_multi.hpp @@ -1,4 +1,4 @@ -/* $Id: filter_multi.hpp,v 1.8 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_multi.hpp,v 1.9 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -49,7 +49,7 @@ namespace metaproxy_1 { ~Multi(); Multi(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr); + void configure(const xmlNode * ptr, bool test_only); void add_map_host2hosts(std::string host, std::list hosts, std::string route); diff --git a/src/filter_query_rewrite.cpp b/src/filter_query_rewrite.cpp index eafd895..4d832b5 100644 --- a/src/filter_query_rewrite.cpp +++ b/src/filter_query_rewrite.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_query_rewrite.cpp,v 1.11 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_query_rewrite.cpp,v 1.12 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -75,7 +75,7 @@ void yf::QueryRewrite::process(mp::Package &package) const m_p->process(package); } -void mp::filter::QueryRewrite::configure(const xmlNode *ptr) +void mp::filter::QueryRewrite::configure(const xmlNode *ptr, bool test_only) { m_p->configure(ptr); } diff --git a/src/filter_query_rewrite.hpp b/src/filter_query_rewrite.hpp index 2475264..44936e9 100644 --- a/src/filter_query_rewrite.hpp +++ b/src/filter_query_rewrite.hpp @@ -1,4 +1,4 @@ -/* $Id: filter_query_rewrite.hpp,v 1.7 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_query_rewrite.hpp,v 1.8 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -36,7 +36,7 @@ namespace metaproxy_1 { QueryRewrite(); ~QueryRewrite(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr); + void configure(const xmlNode * ptr, bool test_only); }; } } diff --git a/src/filter_record_transform.cpp b/src/filter_record_transform.cpp index 7449ab5..d268b7d 100644 --- a/src/filter_record_transform.cpp +++ b/src/filter_record_transform.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_record_transform.cpp,v 1.13 2007-12-16 22:22:49 adam Exp $ +/* $Id: filter_record_transform.cpp,v 1.14 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -63,7 +63,7 @@ yf::RecordTransform::~RecordTransform() { // must have a destructor because of boost::scoped_ptr } -void yf::RecordTransform::configure(const xmlNode *xmlnode) +void yf::RecordTransform::configure(const xmlNode *xmlnode, bool test_only) { m_p->configure(xmlnode); } diff --git a/src/filter_record_transform.hpp b/src/filter_record_transform.hpp index ca0d3d2..5132b0e 100644 --- a/src/filter_record_transform.hpp +++ b/src/filter_record_transform.hpp @@ -1,4 +1,4 @@ -/* $Id: filter_record_transform.hpp,v 1.3 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_record_transform.hpp,v 1.4 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -36,7 +36,7 @@ namespace metaproxy_1 { RecordTransform(); ~RecordTransform(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr); + void configure(const xmlNode * ptr, bool test_only); }; } } diff --git a/src/filter_session_shared.cpp b/src/filter_session_shared.cpp index c4d8a8c..bada836 100644 --- a/src/filter_session_shared.cpp +++ b/src/filter_session_shared.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_session_shared.cpp,v 1.19 2008-01-21 15:23:11 adam Exp $ +/* $Id: filter_session_shared.cpp,v 1.20 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -1035,7 +1035,7 @@ void yf::SessionShared::process(mp::Package &package) const m_p->release_frontend(package); } -void yf::SessionShared::configure(const xmlNode *ptr) +void yf::SessionShared::configure(const xmlNode *ptr, bool test_only) { for (ptr = ptr->children; ptr; ptr = ptr->next) { diff --git a/src/filter_session_shared.hpp b/src/filter_session_shared.hpp index ba34991..5847eea 100644 --- a/src/filter_session_shared.hpp +++ b/src/filter_session_shared.hpp @@ -1,4 +1,4 @@ -/* $Id: filter_session_shared.hpp,v 1.10 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_session_shared.hpp,v 1.11 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -55,7 +55,7 @@ namespace metaproxy_1 { ~SessionShared(); SessionShared(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr); + void configure(const xmlNode * ptr, bool test_only); private: boost::scoped_ptr m_p; }; diff --git a/src/filter_sru_to_z3950.cpp b/src/filter_sru_to_z3950.cpp index db79ad7..b06c636 100644 --- a/src/filter_sru_to_z3950.cpp +++ b/src/filter_sru_to_z3950.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_sru_to_z3950.cpp,v 1.37 2008-01-29 21:25:46 adam Exp $ +/* $Id: filter_sru_to_z3950.cpp,v 1.38 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -107,7 +107,7 @@ yf::SRUtoZ3950::~SRUtoZ3950() { // must have a destructor because of boost::scoped_ptr } -void yf::SRUtoZ3950::configure(const xmlNode *xmlnode) +void yf::SRUtoZ3950::configure(const xmlNode *xmlnode, bool test_only) { m_p->configure(xmlnode); } diff --git a/src/filter_sru_to_z3950.hpp b/src/filter_sru_to_z3950.hpp index 7f090e7..d982ddc 100644 --- a/src/filter_sru_to_z3950.hpp +++ b/src/filter_sru_to_z3950.hpp @@ -1,4 +1,4 @@ -/* $Id: filter_sru_to_z3950.hpp,v 1.5 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_sru_to_z3950.hpp,v 1.6 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -35,7 +35,7 @@ namespace metaproxy_1 { public: SRUtoZ3950(); ~SRUtoZ3950(); - void configure(const xmlNode *xmlnode); + void configure(const xmlNode *xmlnode, bool test_only); void process(metaproxy_1::Package & package) const; }; } diff --git a/src/filter_template.cpp b/src/filter_template.cpp index e384287..e1de246 100644 --- a/src/filter_template.cpp +++ b/src/filter_template.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_template.cpp,v 1.11 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_template.cpp,v 1.12 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -18,7 +18,7 @@ along with Metaproxy; see the file LICENSE. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: filter_template.cpp,v 1.11 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_template.cpp,v 1.12 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. See the LICENSE file for details @@ -61,7 +61,7 @@ yf::Template::~Template() { // must have a destructor because of boost::scoped_ptr } -void yf::Template::configure(const xmlNode *xmlnode) +void yf::Template::configure(const xmlNode *xmlnode, bool test_only) { m_p->configure(xmlnode); } diff --git a/src/filter_template.hpp b/src/filter_template.hpp index d1f6531..8b14158 100644 --- a/src/filter_template.hpp +++ b/src/filter_template.hpp @@ -1,4 +1,4 @@ -/* $Id: filter_template.hpp,v 1.9 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_template.hpp,v 1.10 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -36,7 +36,7 @@ namespace metaproxy_1 { Template(); ~Template(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr); + void configure(const xmlNode * ptr, bool test_only); }; } } diff --git a/src/filter_virt_db.cpp b/src/filter_virt_db.cpp index b671793..bd142a0 100644 --- a/src/filter_virt_db.cpp +++ b/src/filter_virt_db.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_virt_db.cpp,v 1.53 2007-11-26 21:45:08 adam Exp $ +/* $Id: filter_virt_db.cpp,v 1.54 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -18,7 +18,7 @@ along with Metaproxy; see the file LICENSE. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: filter_virt_db.cpp,v 1.53 2007-11-26 21:45:08 adam Exp $ +/* $Id: filter_virt_db.cpp,v 1.54 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. See the LICENSE file for details @@ -790,7 +790,7 @@ void yf::VirtualDB::process(mp::Package &package) const } -void mp::filter::VirtualDB::configure(const xmlNode * ptr) +void mp::filter::VirtualDB::configure(const xmlNode * ptr, bool test_only) { for (ptr = ptr->children; ptr; ptr = ptr->next) { diff --git a/src/filter_virt_db.hpp b/src/filter_virt_db.hpp index 3602bb1..52aea07 100644 --- a/src/filter_virt_db.hpp +++ b/src/filter_virt_db.hpp @@ -1,4 +1,4 @@ -/* $Id: filter_virt_db.hpp,v 1.19 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_virt_db.hpp,v 1.20 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -43,7 +43,7 @@ namespace metaproxy_1 { ~VirtualDB(); VirtualDB(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr); + void configure(const xmlNode * ptr, bool test_only); void add_map_db2targets(std::string db, std::list targets, std::string route); diff --git a/src/filter_z3950_client.cpp b/src/filter_z3950_client.cpp index 0e79cfe..9cbea57 100644 --- a/src/filter_z3950_client.cpp +++ b/src/filter_z3950_client.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_z3950_client.cpp,v 1.31 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_z3950_client.cpp,v 1.32 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -18,7 +18,7 @@ along with Metaproxy; see the file LICENSE. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: filter_z3950_client.cpp,v 1.31 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_z3950_client.cpp,v 1.32 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. See the LICENSE file for details @@ -400,7 +400,7 @@ void yf::Z3950Client::process(Package &package) const m_p->release_assoc(package); } -void yf::Z3950Client::configure(const xmlNode *ptr) +void yf::Z3950Client::configure(const xmlNode *ptr, bool test_only) { for (ptr = ptr->children; ptr; ptr = ptr->next) { diff --git a/src/filter_z3950_client.hpp b/src/filter_z3950_client.hpp index 006b402..f4f77ce 100644 --- a/src/filter_z3950_client.hpp +++ b/src/filter_z3950_client.hpp @@ -1,4 +1,4 @@ -/* $Id: filter_z3950_client.hpp,v 1.12 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_z3950_client.hpp,v 1.13 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -35,7 +35,7 @@ namespace metaproxy_1 { ~Z3950Client(); Z3950Client(); void process(metaproxy_1::Package & package) const; - void configure(const xmlNode * ptr); + void configure(const xmlNode * ptr, bool test_only); private: boost::scoped_ptr m_p; }; diff --git a/src/filter_zeerex_explain.cpp b/src/filter_zeerex_explain.cpp index 3bd3fbe..6744f33 100644 --- a/src/filter_zeerex_explain.cpp +++ b/src/filter_zeerex_explain.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_zeerex_explain.cpp,v 1.6 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_zeerex_explain.cpp,v 1.7 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -65,7 +65,7 @@ yf::ZeeRexExplain::~ZeeRexExplain() { // must have a destructor because of boost::scoped_ptr } -void yf::ZeeRexExplain::configure(const xmlNode *xmlnode) +void yf::ZeeRexExplain::configure(const xmlNode *xmlnode, bool test_only) { m_p->configure(xmlnode); } diff --git a/src/filter_zeerex_explain.hpp b/src/filter_zeerex_explain.hpp index 206c578..e035a3f 100644 --- a/src/filter_zeerex_explain.hpp +++ b/src/filter_zeerex_explain.hpp @@ -1,4 +1,4 @@ -/* $Id: filter_zeerex_explain.hpp,v 1.3 2007-05-09 21:23:09 adam Exp $ +/* $Id: filter_zeerex_explain.hpp,v 1.4 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -35,7 +35,7 @@ namespace metaproxy_1 { public: ZeeRexExplain(); ~ZeeRexExplain(); - void configure(const xmlNode *xmlnode); + void configure(const xmlNode *xmlnode, bool test_only); void process(metaproxy_1::Package & package) const; }; } diff --git a/src/metaproxy_prog.cpp b/src/metaproxy_prog.cpp index 29f4697..6b5d437 100644 --- a/src/metaproxy_prog.cpp +++ b/src/metaproxy_prog.cpp @@ -1,4 +1,4 @@ -/* $Id: metaproxy_prog.cpp,v 1.13 2008-02-20 12:39:35 adam Exp $ +/* $Id: metaproxy_prog.cpp,v 1.14 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2008, Index Data. This file is part of Metaproxy. @@ -80,6 +80,7 @@ int main(int argc, char **argv) break; case 'l': yaz_log_init_file(arg); + yaz_log(YLOG_LOG, "Metaproxy " VERSION " started"); break; case 'p': pidfile = arg; @@ -119,7 +120,7 @@ int main(int argc, char **argv) std::cerr << "processing XInclude directive\n"; } mp::FactoryStatic factory; - mp::RouterFleXML router(doc, factory); + mp::RouterFleXML router(doc, factory, false); yaz_daemon("metaproxy", mode, handler, &router, pidfile, uid); } diff --git a/src/router_flexml.cpp b/src/router_flexml.cpp index 1ed6ce8..f8307e9 100644 --- a/src/router_flexml.cpp +++ b/src/router_flexml.cpp @@ -1,4 +1,4 @@ -/* $Id: router_flexml.cpp,v 1.22 2007-05-09 21:23:09 adam Exp $ +/* $Id: router_flexml.cpp,v 1.23 2008-02-20 15:07:52 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -49,7 +49,7 @@ namespace metaproxy_1 { friend class RouterFleXML::Pos; Rep(); - void base(xmlDocPtr doc, mp::FactoryFilter &factory); + void base(xmlDocPtr doc, mp::FactoryFilter &factory, bool test_only); typedef std::map > @@ -63,10 +63,12 @@ namespace metaproxy_1 { std::string m_dl_path; - void parse_xml_config_dom(xmlDocPtr doc); + void parse_xml_config_dom(xmlDocPtr doc, bool test_only); - void parse_xml_filters(xmlDocPtr doc, const xmlNode *node); - void parse_xml_routes(xmlDocPtr doc, const xmlNode *node); + void parse_xml_filters(xmlDocPtr doc, const xmlNode *node, + bool test_only); + void parse_xml_routes(xmlDocPtr doc, const xmlNode *node, + bool test_only); bool m_xinclude; private: @@ -87,7 +89,8 @@ namespace metaproxy_1 { } void mp::RouterFleXML::Rep::parse_xml_filters(xmlDocPtr doc, - const xmlNode *node) + const xmlNode *node, + bool test_only) { unsigned int filter_nr = 0; while(node && mp::xml::check_element_mp(node, "filter")) @@ -122,7 +125,7 @@ void mp::RouterFleXML::Rep::parse_xml_filters(xmlDocPtr doc, } mp::filter::Base* filter_base = m_factory->create(type_value); - filter_base->configure(node); + filter_base->configure(node, test_only); if (m_id_filter_map.find(id_value) != m_id_filter_map.end()) throw mp::XMLError("Filter " + id_value + " already defined"); @@ -135,7 +138,8 @@ void mp::RouterFleXML::Rep::parse_xml_filters(xmlDocPtr doc, } void mp::RouterFleXML::Rep::parse_xml_routes(xmlDocPtr doc, - const xmlNode *node) + const xmlNode *node, + bool test_only) { mp::xml::check_element_mp(node, "route"); @@ -213,7 +217,7 @@ void mp::RouterFleXML::Rep::parse_xml_routes(xmlDocPtr doc, } mp::filter::Base* filter_base = m_factory->create(type_value); - filter_base->configure(node3); + filter_base->configure(node3, test_only); route.m_list.push_back( boost::shared_ptr(filter_base)); @@ -232,7 +236,8 @@ void mp::RouterFleXML::Rep::parse_xml_routes(xmlDocPtr doc, } } -void mp::RouterFleXML::Rep::parse_xml_config_dom(xmlDocPtr doc) +void mp::RouterFleXML::Rep::parse_xml_config_dom(xmlDocPtr doc, + bool test_only) { if (!doc) throw mp::XMLError("Empty XML Document"); @@ -273,14 +278,16 @@ void mp::RouterFleXML::Rep::parse_xml_config_dom(xmlDocPtr doc) if (mp::xml::is_element_mp(node, "filters")) { parse_xml_filters(doc, mp::xml::jump_to_children(node, - XML_ELEMENT_NODE)); + XML_ELEMENT_NODE), + test_only); node = mp::xml::jump_to_next(node, XML_ELEMENT_NODE); } // process node which is expected third element node mp::xml::check_element_mp(node, "routes"); - parse_xml_routes(doc, mp::xml::jump_to_children(node, XML_ELEMENT_NODE)); + parse_xml_routes(doc, mp::xml::jump_to_children(node, XML_ELEMENT_NODE), + test_only); node = mp::xml::jump_to_next(node, XML_ELEMENT_NODE); if (node) @@ -294,20 +301,23 @@ mp::RouterFleXML::Rep::Rep() : m_xinclude(false) { } -void mp::RouterFleXML::Rep::base(xmlDocPtr doc, mp::FactoryFilter &factory) +void mp::RouterFleXML::Rep::base(xmlDocPtr doc, mp::FactoryFilter &factory, + bool test_only) { m_factory = &factory; - parse_xml_config_dom(doc); + parse_xml_config_dom(doc, test_only); m_start_route = "start"; } -mp::RouterFleXML::RouterFleXML(xmlDocPtr doc, mp::FactoryFilter &factory) +mp::RouterFleXML::RouterFleXML(xmlDocPtr doc, mp::FactoryFilter &factory, + bool test_only) : m_p(new Rep) { - m_p->base(doc, factory); + m_p->base(doc, factory, test_only); } -mp::RouterFleXML::RouterFleXML(std::string xmlconf, mp::FactoryFilter &factory) +mp::RouterFleXML::RouterFleXML(std::string xmlconf, mp::FactoryFilter &factory, + bool test_only) : m_p(new Rep) { LIBXML_TEST_VERSION; @@ -318,7 +328,7 @@ mp::RouterFleXML::RouterFleXML(std::string xmlconf, mp::FactoryFilter &factory) throw mp::XMLError("xmlParseMemory failed"); else { - m_p->base(doc, factory); + m_p->base(doc, factory, test_only); xmlFreeDoc(doc); } } diff --git a/src/router_flexml.hpp b/src/router_flexml.hpp index 9b779ef..7c0c1cc 100644 --- a/src/router_flexml.hpp +++ b/src/router_flexml.hpp @@ -1,4 +1,4 @@ -/* $Id: router_flexml.hpp,v 1.17 2007-05-09 21:23:09 adam Exp $ +/* $Id: router_flexml.hpp,v 1.18 2008-02-20 15:07:53 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -38,8 +38,10 @@ namespace metaproxy_1 class Route; class Pos; public: - RouterFleXML(std::string xmlconf, metaproxy_1::FactoryFilter &factory); - RouterFleXML(xmlDocPtr doc, metaproxy_1::FactoryFilter &factory); + RouterFleXML(std::string xmlconf, metaproxy_1::FactoryFilter &factory, + bool test_only); + RouterFleXML(xmlDocPtr doc, metaproxy_1::FactoryFilter &factory, + bool test_only); ~RouterFleXML(); diff --git a/src/test_filter2.cpp b/src/test_filter2.cpp index c8847f5..b0130f0 100644 --- a/src/test_filter2.cpp +++ b/src/test_filter2.cpp @@ -1,4 +1,4 @@ -/* $Id: test_filter2.cpp,v 1.24 2007-11-02 17:30:04 adam Exp $ +/* $Id: test_filter2.cpp,v 1.25 2008-02-20 15:07:53 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -43,7 +43,7 @@ public: void process(mp::Package & package) const { package.move(); }; - void configure(const xmlNode* ptr = 0); + void configure(const xmlNode* ptr, bool test_only); int get_constant() const { return m_constant; }; private: const xmlNode *m_ptr; @@ -51,10 +51,10 @@ private: }; -void FilterConstant::configure(const xmlNode* ptr) +void FilterConstant::configure(const xmlNode* ptr, bool test_only) { m_ptr = ptr; - + BOOST_CHECK_EQUAL (ptr->type, XML_ELEMENT_NODE); BOOST_CHECK_EQUAL(std::string((const char *) ptr->name), "filter"); @@ -172,7 +172,7 @@ BOOST_AUTO_TEST_CASE( testfilter2_2 ) { xmlNodePtr root_element = xmlDocGetRootElement(doc); - base->configure(root_element); + base->configure(root_element, true); xmlFreeDoc(doc); } diff --git a/src/test_filter_frontend_net.cpp b/src/test_filter_frontend_net.cpp index 74f2c42..f616941 100644 --- a/src/test_filter_frontend_net.cpp +++ b/src/test_filter_frontend_net.cpp @@ -1,4 +1,4 @@ -/* $Id: test_filter_frontend_net.cpp,v 1.19 2007-11-02 17:47:41 adam Exp $ +/* $Id: test_filter_frontend_net.cpp,v 1.20 2008-02-20 15:07:53 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -18,7 +18,7 @@ along with Metaproxy; see the file LICENSE. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: test_filter_frontend_net.cpp,v 1.19 2007-11-02 17:47:41 adam Exp $ +/* $Id: test_filter_frontend_net.cpp,v 1.20 2008-02-20 15:07:53 adam Exp $ Copyright (c) 2005-2007, Index Data. See the LICENSE file for details @@ -131,8 +131,8 @@ BOOST_AUTO_TEST_CASE( test_filter_frontend_net_3 ) std::vector ports; ports.insert(ports.begin(), "unix:socket"); - filter_front.ports() = ports; - filter_front.listen_duration() = 1; // listen a short time only + filter_front.set_ports(ports); + filter_front.set_listen_duration(1); // listen a short time only router.append(filter_front); // put in a backend diff --git a/src/test_filter_query_rewrite.cpp b/src/test_filter_query_rewrite.cpp index 042a270..06f8c0e 100644 --- a/src/test_filter_query_rewrite.cpp +++ b/src/test_filter_query_rewrite.cpp @@ -1,4 +1,4 @@ -/* $Id: test_filter_query_rewrite.cpp,v 1.14 2007-11-02 17:47:41 adam Exp $ +/* $Id: test_filter_query_rewrite.cpp,v 1.15 2008-02-20 15:07:53 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -217,7 +217,7 @@ BOOST_AUTO_TEST_CASE( test_filter_query_rewrite3 ) // creating and configuring filter mp::filter::QueryRewrite f_query_rewrite; - f_query_rewrite.configure(root_element); + f_query_rewrite.configure(root_element, true); // remeber to free XML DOM xmlFreeDoc(doc); diff --git a/src/test_filter_record_transform.cpp b/src/test_filter_record_transform.cpp index bcbab1d..8751b30 100644 --- a/src/test_filter_record_transform.cpp +++ b/src/test_filter_record_transform.cpp @@ -1,4 +1,4 @@ -/* $Id: test_filter_record_transform.cpp,v 1.7 2007-11-02 17:47:41 adam Exp $ +/* $Id: test_filter_record_transform.cpp,v 1.8 2008-02-20 15:07:53 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE( test_filter_record_transform_3 ) // creating and configuring filter mp::filter::RecordTransform f_rec_trans; - f_rec_trans.configure(root_element); + f_rec_trans.configure(root_element, true); // remeber to free XML DOM xmlFreeDoc(doc); diff --git a/src/test_router_flexml.cpp b/src/test_router_flexml.cpp index b0daf77..f761339 100644 --- a/src/test_router_flexml.cpp +++ b/src/test_router_flexml.cpp @@ -1,4 +1,4 @@ -/* $Id: test_router_flexml.cpp,v 1.21 2007-11-02 17:47:41 adam Exp $ +/* $Id: test_router_flexml.cpp,v 1.22 2008-02-20 15:07:53 adam Exp $ Copyright (c) 2005-2007, Index Data. This file is part of Metaproxy. @@ -83,7 +83,7 @@ BOOST_AUTO_TEST_CASE( test_router_flexml_1 ) mp::FactoryStatic factory; factory.add_creator("tfilter", filter_creator); - mp::RouterFleXML rflexml(xmlconf, factory); + mp::RouterFleXML rflexml(xmlconf, factory, true); BOOST_CHECK_EQUAL(tfilter_ref, 2); } catch ( std::runtime_error &e) { @@ -110,7 +110,7 @@ BOOST_AUTO_TEST_CASE( test_router_flexml_2 ) " @:210\n"; mp::FactoryFilter factory; - mp::RouterFleXML rflexml(xmlconf_invalid, factory); + mp::RouterFleXML rflexml(xmlconf_invalid, factory, true); } catch ( mp::XMLError &e) { std::cout << "XMLError: " << e.what() << "\n"; @@ -151,7 +151,7 @@ BOOST_AUTO_TEST_CASE( test_router_flexml_3 ) "\n"; mp::FactoryStatic factory; - mp::RouterFleXML rflexml(xmlconf, factory); + mp::RouterFleXML rflexml(xmlconf, factory, true); } catch ( std::runtime_error &e) { std::cout << "std::runtime error: " << e.what() << "\n"; @@ -186,7 +186,7 @@ BOOST_AUTO_TEST_CASE( test_router_flexml_4 ) mp::FactoryStatic factory; factory.add_creator("tfilter", filter_creator); - mp::RouterFleXML rflexml(xmlconf, factory); + mp::RouterFleXML rflexml(xmlconf, factory, true); } catch ( mp::FactoryFilter::NotFound &e) { std::cout << "mp::FactoryFilter::NotFound: " << e.what() << "\n"; -- 1.7.10.4