1 /* $Id: test_filter_record_transform.cpp,v 1.5 2007-01-25 14:05:54 adam Exp $
2 Copyright (c) 2005-2007, Index Data.
4 See the LICENSE file for details
8 #include "filter_record_transform.hpp"
10 //#include "sru_util.hpp"
11 #include "router_chain.hpp"
12 #include "session.hpp"
13 #include "package.hpp"
16 //#include <stdexcept>
18 #define BOOST_AUTO_TEST_MAIN
19 #include <boost/test/auto_unit_test.hpp>
24 using namespace boost::unit_test;
26 namespace mp = metaproxy_1;
27 //using namespace mp::util;
31 BOOST_AUTO_UNIT_TEST( test_filter_record_transform_1 )
35 mp::filter::RecordTransform f_rec_trans;
42 BOOST_AUTO_UNIT_TEST( test_filter_record_transform_2 )
46 mp::RouterChain router;
48 mp::filter::RecordTransform f_rec_trans;
50 router.append(f_rec_trans);
52 //check_sru_to_z3950_init(router);
53 //check_sru_to_z3950_search(router,
54 // "@attrset Bib-1 @attr 1=4 the",
55 // "@attrset Bib-1 @attr 1=4 the");
64 BOOST_AUTO_UNIT_TEST( test_filter_record_transform_3 )
70 mp::RouterChain router;
74 "<?xml version='1.0'?>\n"
75 "<filter xmlns='http://indexdata.com/metaproxy'\n"
76 " id='rec_trans_1' type='record_transform'>\n"
81 "<backend syntax=\"usmarc\""
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::RecordTransform f_rec_trans;
98 f_rec_trans.configure(root_element);
100 // remeber to free XML DOM
103 // add only filter to router
104 router.append(f_rec_trans);
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";
127 * indent-tabs-mode: nil
128 * c-file-style: "stroustrup"
130 * vim: shiftwidth=4 tabstop=8 expandtab