1 /* This file is part of Metaproxy.
2 Copyright (C) 2005-2013 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"
21 #include <metaproxy/util.hpp>
22 #include "sru_util.hpp"
23 #include <metaproxy/router_chain.hpp>
24 #include <metaproxy/package.hpp>
29 #define BOOST_AUTO_TEST_MAIN
30 #define BOOST_TEST_DYN_LINK
31 #include <boost/test/auto_unit_test.hpp>
33 using namespace boost::unit_test;
35 namespace mp = metaproxy_1;
36 using namespace mp::util;
40 BOOST_AUTO_TEST_CASE( test_filter_sru_to_z3950_1 )
44 mp::filter::SRUtoZ3950 f_sru_to_z3950;
51 BOOST_AUTO_TEST_CASE( test_filter_sru_to_z3950_2 )
55 mp::RouterChain router;
57 mp::filter::SRUtoZ3950 f_sru_to_z3950;
59 router.append(f_sru_to_z3950);
61 //check_sru_to_z3950_init(router);
62 //check_sru_to_z3950_search(router,
63 // "@attrset Bib-1 @attr 1=4 the",
64 // "@attrset Bib-1 @attr 1=4 the");
73 // BOOST_AUTO_TEST_CASE( test_filter_sru_to_z3950_3 )
79 // mp::RouterChain router;
82 // std::string xmlconf =
83 // "<?xml version='1.0'?>\n"
84 // "<filter xmlns='http://indexdata.com/metaproxy'\n"
85 // " id='qrw1' type='sru_to_z3950'>\n"
89 // //std::cout << xmlconf << std::endl;
91 // // reading and parsing XML conf
92 // xmlDocPtr doc = xmlParseMemory(xmlconf.c_str(), xmlconf.size());
94 // xmlNode *root_element = xmlDocGetRootElement(doc);
96 // // creating and configuring filter
97 // mp::filter::SRUtoZ3950 f_sru_to_z3950;
98 // f_sru_to_z3950.configure(root_element);
100 // // remeber to free XML DOM
103 // // add only filter to router
104 // router.append(f_sru_to_z3950);
107 // check_sru_to_z3950_init(router);
108 // check_sru_to_z3950_search(router,
109 // "@attrset Bib-1 @attr 1=4 the",
110 // "@attrset Bib-1 @attr 1=4 the");
114 // catch (std::exception &e) {
115 // std::cout << e.what() << "\n";
116 // BOOST_CHECK (false);
120 // BOOST_CHECK (false);
127 * c-file-style: "Stroustrup"
128 * indent-tabs-mode: nil
130 * vim: shiftwidth=4 tabstop=8 expandtab