Updated footer comment
[metaproxy-moved-to-github.git] / src / test_filter_sru_to_z3950.cpp
1 /* This file is part of Metaproxy.
2    Copyright (C) 2005-2008 Index Data
3
4 Metaproxy is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8
9 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17 */
18
19 #include "config.hpp"
20 #include "filter_sru_to_z3950.hpp"
21 #include "util.hpp"
22 #include "sru_util.hpp"
23 #include "router_chain.hpp"
24 #include "session.hpp"
25 #include "package.hpp"
26
27 #include <iostream>
28 #include <stdexcept>
29
30 #define BOOST_AUTO_TEST_MAIN
31 #define BOOST_TEST_DYN_LINK
32 #include <boost/test/auto_unit_test.hpp>
33
34 using namespace boost::unit_test;
35
36 namespace mp = metaproxy_1;
37 using namespace mp::util;
38
39
40
41 BOOST_AUTO_TEST_CASE( test_filter_sru_to_z3950_1 )
42 {
43     try 
44     {
45         mp::filter::SRUtoZ3950 f_sru_to_z3950;
46     }
47     catch ( ... ) {
48         BOOST_CHECK (false);
49     }
50 }
51
52 BOOST_AUTO_TEST_CASE( test_filter_sru_to_z3950_2 )
53 {
54     try 
55     {
56         mp::RouterChain router;
57         
58         mp::filter::SRUtoZ3950 f_sru_to_z3950;
59         
60         router.append(f_sru_to_z3950);
61
62         //check_sru_to_z3950_init(router);
63         //check_sru_to_z3950_search(router, 
64         //                           "@attrset Bib-1 @attr 1=4 the", 
65         //                           "@attrset Bib-1 @attr 1=4 the");
66
67     }
68     catch ( ... ) {
69         BOOST_CHECK (false);
70     }
71 }
72
73
74 // BOOST_AUTO_TEST_CASE( test_filter_sru_to_z3950_3 )
75 // {
76     
77
78 //     try 
79 //     {
80 //         mp::RouterChain router;
81         
82
83 //         std::string xmlconf = 
84 //             "<?xml version='1.0'?>\n"
85 //             "<filter xmlns='http://indexdata.com/metaproxy'\n"
86 //             "        id='qrw1' type='sru_to_z3950'>\n"
87 //             "</filter>\n"
88 //             ;
89          
90 //         //std::cout << xmlconf  << std::endl;
91
92 //         // reading and parsing XML conf
93 //         xmlDocPtr doc = xmlParseMemory(xmlconf.c_str(), xmlconf.size());
94 //         BOOST_CHECK(doc);
95 //         xmlNode *root_element = xmlDocGetRootElement(doc);
96
97 //         // creating and configuring filter
98 //         mp::filter::SRUtoZ3950 f_sru_to_z3950;
99 //         f_sru_to_z3950.configure(root_element);
100         
101 //         // remeber to free XML DOM
102 //         xmlFreeDoc(doc);
103         
104 //         // add only filter to router
105 //         router.append(f_sru_to_z3950);
106
107 //         // start testing
108 //         check_sru_to_z3950_init(router);
109 //         check_sru_to_z3950_search(router, 
110 //                                    "@attrset Bib-1 @attr 1=4 the", 
111 //                                    "@attrset Bib-1 @attr 1=4 the");
112
113 //     }
114
115 //     catch (std::exception &e) {
116 //         std::cout << e.what() << "\n";
117 //         BOOST_CHECK (false);
118 //     }
119
120 //     catch ( ... ) {
121 //         BOOST_CHECK (false);
122 //     }
123 // }
124
125 /*
126  * Local variables:
127  * c-basic-offset: 4
128  * c-file-style: "Stroustrup"
129  * indent-tabs-mode: nil
130  * End:
131  * vim: shiftwidth=4 tabstop=8 expandtab
132  */
133