filter factory in working shape, see example in test_filer_factory.cpp
[metaproxy-moved-to-github.git] / src / test_router_flexml.cpp
1 /* $Id: test_router_flexml.cpp,v 1.2 2005-10-29 22:23:36 marc Exp $
2    Copyright (c) 2005, Index Data.
3
4 %LICENSE%
5  */
6
7 #include "config.hpp"
8 #include <iostream>
9 #include <stdexcept>
10
11 #include "filter.hpp"
12 #include "router_flexml.hpp"
13
14 #define BOOST_AUTO_TEST_MAIN
15 #include <boost/test/auto_unit_test.hpp>
16
17 using namespace boost::unit_test;
18
19 class TFilter: public yp2::filter::Base {
20 public:
21     void process(yp2::Package & package) const {};
22     const std::string type() const {
23         return "TFilter";
24     };
25 };
26     
27
28 BOOST_AUTO_TEST_CASE( test_router_flexml_1 )
29 {
30     try{
31         TFilter filter;
32
33         std::string xmlconf = "<?xml version=\"1.0\"?>"
34             "<yp2 xmlns=\"http://indexdata.dk/yp2/config/1\">"
35             "<start route=\"start\"/>"
36             "<filters>"
37             "<filter id=\"front_default\" type=\"frontend-net\">"
38             "<port>210</port>"
39             "</filter>"
40             "<filter id=\"log_cout\" type=\"log\">"
41             "<logfile>mylog.log</logfile>"
42             "</filter>"
43             "</filters>"
44             "<routes>"  
45             "<route id=\"start\">"
46             "<filter refid=\"front_default\"/>"
47             "<filter refid=\"log_cout\"/>"
48             "</route>"
49             "</routes>"
50             "</yp2>";
51         
52         yp2::RouterFleXML rflexml(xmlconf);
53         
54
55         BOOST_CHECK (true);
56
57         //BOOST_CHECK_EQUAL(filter.name(), std::string("filter1"));
58         
59     }
60     catch ( ... ) {
61         BOOST_CHECK (false);
62     }
63 }
64
65 /*
66  * Local variables:
67  * c-basic-offset: 4
68  * indent-tabs-mode: nil
69  * c-file-style: "stroustrup"
70  * End:
71  * vim: shiftwidth=4 tabstop=8 expandtab
72  */