+ mp::FactoryFilter factory;
+ mp::RouterFleXML rflexml(xmlconf_invalid, factory);
+ }
+ catch ( mp::XMLError &e) {
+ std::cout << "XMLError: " << e.what() << "\n";
+ got_error_as_expected = true;
+ }
+ catch ( std::runtime_error &e) {
+ std::cout << "std::runtime error: " << e.what() << "\n";
+ }
+ catch ( ... ) {
+ ;
+ }
+ BOOST_CHECK(got_error_as_expected);
+}
+
+// Pass well-formed XML with explicit NS
+BOOST_AUTO_UNIT_TEST( test_router_flexml_3 )
+{
+ try
+ {
+ std::string xmlconf = "<?xml version=\"1.0\"?>\n"
+ "<y:yp2 xmlns:y=\"http://indexdata.dk/yp2/config/1\">\n"
+ " <y:start route=\"start\"/>\n"
+ " <y:filters>\n"
+ " <y:filter id=\"front_default\" type=\"frontend_net\">\n"
+ " <port>@:210</port>\n"
+ " </y:filter>\n"
+ " <y:filter id=\"log_cout\" type=\"log\">\n"
+ " <message>my msg</message>\n"
+ " </y:filter>\n"
+ " </y:filters>\n"
+ " <y:routes>\n"
+ " <y:route id=\"start\">\n"
+ " <y:filter refid=\"front_default\"/>\n"
+ " <y:filter refid=\"log_cout\"/>\n"
+ " </y:route>\n"
+ " </y:routes>\n"
+ "</y:yp2>\n";
+
+ mp::FactoryStatic factory;
+ mp::RouterFleXML rflexml(xmlconf, factory);
+ }
+ catch ( std::runtime_error &e) {
+ std::cout << "std::runtime error: " << e.what() << "\n";
+ BOOST_CHECK (false);