1 /* $Id: test_filter_sru_to_z3950.cpp,v 1.6 2007-11-02 17:47:41 adam Exp $
2 Copyright (c) 2005-2007, Index Data.
4 This file is part of Metaproxy.
6 Metaproxy is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with Metaproxy; see the file LICENSE. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #include "filter_sru_to_z3950.hpp"
25 #include "sru_util.hpp"
26 #include "router_chain.hpp"
27 #include "session.hpp"
28 #include "package.hpp"
33 #define BOOST_AUTO_TEST_MAIN
34 #define BOOST_TEST_DYN_LINK
35 #include <boost/test/auto_unit_test.hpp>
37 using namespace boost::unit_test;
39 namespace mp = metaproxy_1;
40 using namespace mp::util;
44 BOOST_AUTO_TEST_CASE( test_filter_sru_to_z3950_1 )
48 mp::filter::SRUtoZ3950 f_sru_to_z3950;
55 BOOST_AUTO_TEST_CASE( test_filter_sru_to_z3950_2 )
59 mp::RouterChain router;
61 mp::filter::SRUtoZ3950 f_sru_to_z3950;
63 router.append(f_sru_to_z3950);
65 //check_sru_to_z3950_init(router);
66 //check_sru_to_z3950_search(router,
67 // "@attrset Bib-1 @attr 1=4 the",
68 // "@attrset Bib-1 @attr 1=4 the");
77 // BOOST_AUTO_TEST_CASE( test_filter_sru_to_z3950_3 )
83 // mp::RouterChain router;
86 // std::string xmlconf =
87 // "<?xml version='1.0'?>\n"
88 // "<filter xmlns='http://indexdata.com/metaproxy'\n"
89 // " id='qrw1' type='sru_to_z3950'>\n"
93 // //std::cout << xmlconf << std::endl;
95 // // reading and parsing XML conf
96 // xmlDocPtr doc = xmlParseMemory(xmlconf.c_str(), xmlconf.size());
98 // xmlNode *root_element = xmlDocGetRootElement(doc);
100 // // creating and configuring filter
101 // mp::filter::SRUtoZ3950 f_sru_to_z3950;
102 // f_sru_to_z3950.configure(root_element);
104 // // remeber to free XML DOM
107 // // add only filter to router
108 // router.append(f_sru_to_z3950);
111 // check_sru_to_z3950_init(router);
112 // check_sru_to_z3950_search(router,
113 // "@attrset Bib-1 @attr 1=4 the",
114 // "@attrset Bib-1 @attr 1=4 the");
118 // catch (std::exception &e) {
119 // std::cout << e.what() << "\n";
120 // BOOST_CHECK (false);
124 // BOOST_CHECK (false);
131 * indent-tabs-mode: nil
132 * c-file-style: "stroustrup"
134 * vim: shiftwidth=4 tabstop=8 expandtab