1 /* $Id: test_filter_sru_to_z3950.cpp,v 1.2 2006-09-28 11:56:54 marc Exp $
2 Copyright (c) 2005-2006, Index Data.
4 See the LICENSE file for details
8 #include "filter_sru_to_z3950.hpp"
10 #include "sru_util.hpp"
11 #include "router_chain.hpp"
12 #include "session.hpp"
13 #include "package.hpp"
18 #define BOOST_AUTO_TEST_MAIN
19 #include <boost/test/auto_unit_test.hpp>
21 using namespace boost::unit_test;
23 namespace mp = metaproxy_1;
24 using namespace mp::util;
28 BOOST_AUTO_UNIT_TEST( test_filter_sru_to_z3950_1 )
32 mp::filter::SRUtoZ3950 f_sru_to_z3950;
39 BOOST_AUTO_UNIT_TEST( test_filter_sru_to_z3950_2 )
43 mp::RouterChain router;
45 mp::filter::SRUtoZ3950 f_sru_to_z3950;
47 router.append(f_sru_to_z3950);
49 //check_sru_to_z3950_init(router);
50 //check_sru_to_z3950_search(router,
51 // "@attrset Bib-1 @attr 1=4 the",
52 // "@attrset Bib-1 @attr 1=4 the");
61 // BOOST_AUTO_UNIT_TEST( test_filter_sru_to_z3950_3 )
67 // mp::RouterChain router;
70 // std::string xmlconf =
71 // "<?xml version='1.0'?>\n"
72 // "<filter xmlns='http://indexdata.dk/yp2/config/1'\n"
73 // " id='qrw1' type='sru_to_z3950'>\n"
77 // //std::cout << xmlconf << std::endl;
79 // // reading and parsing XML conf
80 // xmlDocPtr doc = xmlParseMemory(xmlconf.c_str(), xmlconf.size());
82 // xmlNode *root_element = xmlDocGetRootElement(doc);
84 // // creating and configuring filter
85 // mp::filter::SRUtoZ3950 f_sru_to_z3950;
86 // f_sru_to_z3950.configure(root_element);
88 // // remeber to free XML DOM
91 // // add only filter to router
92 // router.append(f_sru_to_z3950);
95 // check_sru_to_z3950_init(router);
96 // check_sru_to_z3950_search(router,
97 // "@attrset Bib-1 @attr 1=4 the",
98 // "@attrset Bib-1 @attr 1=4 the");
102 // catch (std::exception &e) {
103 // std::cout << e.what() << "\n";
104 // BOOST_CHECK (false);
108 // BOOST_CHECK (false);
115 * indent-tabs-mode: nil
116 * c-file-style: "stroustrup"
118 * vim: shiftwidth=4 tabstop=8 expandtab