1 /* This file is part of Metaproxy.
2 Copyright (C) 2005-2009 Index Data
4 Metaproxy is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
9 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #include "filter_sru_to_z3950.hpp"
22 #include "sru_util.hpp"
23 #include "router_chain.hpp"
24 #include "session.hpp"
25 #include "package.hpp"
30 #define BOOST_AUTO_TEST_MAIN
31 #define BOOST_TEST_DYN_LINK
32 #include <boost/test/auto_unit_test.hpp>
34 using namespace boost::unit_test;
36 namespace mp = metaproxy_1;
37 using namespace mp::util;
41 BOOST_AUTO_TEST_CASE( test_filter_sru_to_z3950_1 )
45 mp::filter::SRUtoZ3950 f_sru_to_z3950;
52 BOOST_AUTO_TEST_CASE( test_filter_sru_to_z3950_2 )
56 mp::RouterChain router;
58 mp::filter::SRUtoZ3950 f_sru_to_z3950;
60 router.append(f_sru_to_z3950);
62 //check_sru_to_z3950_init(router);
63 //check_sru_to_z3950_search(router,
64 // "@attrset Bib-1 @attr 1=4 the",
65 // "@attrset Bib-1 @attr 1=4 the");
74 // BOOST_AUTO_TEST_CASE( test_filter_sru_to_z3950_3 )
80 // mp::RouterChain router;
83 // std::string xmlconf =
84 // "<?xml version='1.0'?>\n"
85 // "<filter xmlns='http://indexdata.com/metaproxy'\n"
86 // " id='qrw1' type='sru_to_z3950'>\n"
90 // //std::cout << xmlconf << std::endl;
92 // // reading and parsing XML conf
93 // xmlDocPtr doc = xmlParseMemory(xmlconf.c_str(), xmlconf.size());
95 // xmlNode *root_element = xmlDocGetRootElement(doc);
97 // // creating and configuring filter
98 // mp::filter::SRUtoZ3950 f_sru_to_z3950;
99 // f_sru_to_z3950.configure(root_element);
101 // // remeber to free XML DOM
104 // // add only filter to router
105 // router.append(f_sru_to_z3950);
108 // check_sru_to_z3950_init(router);
109 // check_sru_to_z3950_search(router,
110 // "@attrset Bib-1 @attr 1=4 the",
111 // "@attrset Bib-1 @attr 1=4 the");
115 // catch (std::exception &e) {
116 // std::cout << e.what() << "\n";
117 // BOOST_CHECK (false);
121 // BOOST_CHECK (false);
128 * c-file-style: "Stroustrup"
129 * indent-tabs-mode: nil
131 * vim: shiftwidth=4 tabstop=8 expandtab