added scaffolding for a Z3950 present record transform filter.
[metaproxy-moved-to-github.git] / src / test_filter_record_transform.cpp
1 /* $Id: test_filter_record_transform.cpp,v 1.1 2006-10-03 14:04:22 marc Exp $
2    Copyright (c) 2005-2006, Index Data.
3
4    See the LICENSE file for details
5  */
6
7 #include "config.hpp"
8 #include "filter_record_transform.hpp"
9 //#include "util.hpp"
10 //#include "sru_util.hpp"
11 #include "router_chain.hpp"
12 #include "session.hpp"
13 #include "package.hpp"
14
15 //#include <iostream>
16 //#include <stdexcept>
17
18 #define BOOST_AUTO_TEST_MAIN
19 #include <boost/test/auto_unit_test.hpp>
20
21 using namespace boost::unit_test;
22
23 namespace mp = metaproxy_1;
24 //using namespace mp::util;
25
26
27
28 BOOST_AUTO_UNIT_TEST( test_filter_record_transform_1 )
29 {
30     try 
31     {
32         mp::filter::RecordTransform f_rec_trans;
33     }
34     catch ( ... ) {
35         BOOST_CHECK (false);
36     }
37 }
38
39 BOOST_AUTO_UNIT_TEST( test_filter_record_transform_2 )
40 {
41     try 
42     {
43         mp::RouterChain router;
44         
45         mp::filter::RecordTransform f_rec_trans;
46         
47         router.append(f_rec_trans);
48
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");
53
54     }
55     catch ( ... ) {
56         BOOST_CHECK (false);
57     }
58 }
59
60
61 // BOOST_AUTO_UNIT_TEST( test_filter_record_transform_3 )
62 // {
63     
64
65 //     try 
66 //     {
67 //         mp::RouterChain router;
68         
69
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"
74 //             "</filter>\n"
75 //             ;
76          
77 //         //std::cout << xmlconf  << std::endl;
78
79 //         // reading and parsing XML conf
80 //         xmlDocPtr doc = xmlParseMemory(xmlconf.c_str(), xmlconf.size());
81 //         BOOST_CHECK(doc);
82 //         xmlNode *root_element = xmlDocGetRootElement(doc);
83
84 //         // creating and configuring filter
85 //         mp::filter::RecordTransform f_rec_trans;
86 //         f_rec_trans.configure(root_element);
87         
88 //         // remeber to free XML DOM
89 //         xmlFreeDoc(doc);
90         
91 //         // add only filter to router
92 //         router.append(f_rec_trans);
93
94 //         // start testing
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");
99
100 //     }
101
102 //     catch (std::exception &e) {
103 //         std::cout << e.what() << "\n";
104 //         BOOST_CHECK (false);
105 //     }
106
107 //     catch ( ... ) {
108 //         BOOST_CHECK (false);
109 //     }
110 // }
111
112 /*
113  * Local variables:
114  * c-basic-offset: 4
115  * indent-tabs-mode: nil
116  * c-file-style: "stroustrup"
117  * End:
118  * vim: shiftwidth=4 tabstop=8 expandtab
119  */