Fixed bug #1589: tests does not compile for libboost 1.34.1.
[metaproxy-moved-to-github.git] / src / test_filter_sru_to_z3950.cpp
1 /* $Id: test_filter_sru_to_z3950.cpp,v 1.6 2007-11-02 17:47:41 adam Exp $
2    Copyright (c) 2005-2007, Index Data.
3
4 This file is part of Metaproxy.
5
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
9 version.
10
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
14 for more details.
15
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
19 02111-1307, USA.
20  */
21
22 #include "config.hpp"
23 #include "filter_sru_to_z3950.hpp"
24 #include "util.hpp"
25 #include "sru_util.hpp"
26 #include "router_chain.hpp"
27 #include "session.hpp"
28 #include "package.hpp"
29
30 #include <iostream>
31 #include <stdexcept>
32
33 #define BOOST_AUTO_TEST_MAIN
34 #define BOOST_TEST_DYN_LINK
35 #include <boost/test/auto_unit_test.hpp>
36
37 using namespace boost::unit_test;
38
39 namespace mp = metaproxy_1;
40 using namespace mp::util;
41
42
43
44 BOOST_AUTO_TEST_CASE( test_filter_sru_to_z3950_1 )
45 {
46     try 
47     {
48         mp::filter::SRUtoZ3950 f_sru_to_z3950;
49     }
50     catch ( ... ) {
51         BOOST_CHECK (false);
52     }
53 }
54
55 BOOST_AUTO_TEST_CASE( test_filter_sru_to_z3950_2 )
56 {
57     try 
58     {
59         mp::RouterChain router;
60         
61         mp::filter::SRUtoZ3950 f_sru_to_z3950;
62         
63         router.append(f_sru_to_z3950);
64
65         //check_sru_to_z3950_init(router);
66         //check_sru_to_z3950_search(router, 
67         //                           "@attrset Bib-1 @attr 1=4 the", 
68         //                           "@attrset Bib-1 @attr 1=4 the");
69
70     }
71     catch ( ... ) {
72         BOOST_CHECK (false);
73     }
74 }
75
76
77 // BOOST_AUTO_TEST_CASE( test_filter_sru_to_z3950_3 )
78 // {
79     
80
81 //     try 
82 //     {
83 //         mp::RouterChain router;
84         
85
86 //         std::string xmlconf = 
87 //             "<?xml version='1.0'?>\n"
88 //             "<filter xmlns='http://indexdata.com/metaproxy'\n"
89 //             "        id='qrw1' type='sru_to_z3950'>\n"
90 //             "</filter>\n"
91 //             ;
92          
93 //         //std::cout << xmlconf  << std::endl;
94
95 //         // reading and parsing XML conf
96 //         xmlDocPtr doc = xmlParseMemory(xmlconf.c_str(), xmlconf.size());
97 //         BOOST_CHECK(doc);
98 //         xmlNode *root_element = xmlDocGetRootElement(doc);
99
100 //         // creating and configuring filter
101 //         mp::filter::SRUtoZ3950 f_sru_to_z3950;
102 //         f_sru_to_z3950.configure(root_element);
103         
104 //         // remeber to free XML DOM
105 //         xmlFreeDoc(doc);
106         
107 //         // add only filter to router
108 //         router.append(f_sru_to_z3950);
109
110 //         // start testing
111 //         check_sru_to_z3950_init(router);
112 //         check_sru_to_z3950_search(router, 
113 //                                    "@attrset Bib-1 @attr 1=4 the", 
114 //                                    "@attrset Bib-1 @attr 1=4 the");
115
116 //     }
117
118 //     catch (std::exception &e) {
119 //         std::cout << e.what() << "\n";
120 //         BOOST_CHECK (false);
121 //     }
122
123 //     catch ( ... ) {
124 //         BOOST_CHECK (false);
125 //     }
126 // }
127
128 /*
129  * Local variables:
130  * c-basic-offset: 4
131  * indent-tabs-mode: nil
132  * c-file-style: "stroustrup"
133  * End:
134  * vim: shiftwidth=4 tabstop=8 expandtab
135  */