1 /* $Id: test_filter_sru_to_z3950.cpp,v 1.5 2007-05-09 21:23:09 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 #include <boost/test/auto_unit_test.hpp>
36 using namespace boost::unit_test;
38 namespace mp = metaproxy_1;
39 using namespace mp::util;
43 BOOST_AUTO_UNIT_TEST( test_filter_sru_to_z3950_1 )
47 mp::filter::SRUtoZ3950 f_sru_to_z3950;
54 BOOST_AUTO_UNIT_TEST( test_filter_sru_to_z3950_2 )
58 mp::RouterChain router;
60 mp::filter::SRUtoZ3950 f_sru_to_z3950;
62 router.append(f_sru_to_z3950);
64 //check_sru_to_z3950_init(router);
65 //check_sru_to_z3950_search(router,
66 // "@attrset Bib-1 @attr 1=4 the",
67 // "@attrset Bib-1 @attr 1=4 the");
76 // BOOST_AUTO_UNIT_TEST( test_filter_sru_to_z3950_3 )
82 // mp::RouterChain router;
85 // std::string xmlconf =
86 // "<?xml version='1.0'?>\n"
87 // "<filter xmlns='http://indexdata.com/metaproxy'\n"
88 // " id='qrw1' type='sru_to_z3950'>\n"
92 // //std::cout << xmlconf << std::endl;
94 // // reading and parsing XML conf
95 // xmlDocPtr doc = xmlParseMemory(xmlconf.c_str(), xmlconf.size());
97 // xmlNode *root_element = xmlDocGetRootElement(doc);
99 // // creating and configuring filter
100 // mp::filter::SRUtoZ3950 f_sru_to_z3950;
101 // f_sru_to_z3950.configure(root_element);
103 // // remeber to free XML DOM
106 // // add only filter to router
107 // router.append(f_sru_to_z3950);
110 // check_sru_to_z3950_init(router);
111 // check_sru_to_z3950_search(router,
112 // "@attrset Bib-1 @attr 1=4 the",
113 // "@attrset Bib-1 @attr 1=4 the");
117 // catch (std::exception &e) {
118 // std::cout << e.what() << "\n";
119 // BOOST_CHECK (false);
123 // BOOST_CHECK (false);
130 * indent-tabs-mode: nil
131 * c-file-style: "stroustrup"
133 * vim: shiftwidth=4 tabstop=8 expandtab