diff options
-rw-r--r-- | gentoobrowse/src/Jamfile.jam | 1 | ||||
-rw-r--r-- | gentoobrowse/src/test.cpp | 27 |
2 files changed, 27 insertions, 1 deletions
diff --git a/gentoobrowse/src/Jamfile.jam b/gentoobrowse/src/Jamfile.jam index 8cfc295..f480770 100644 --- a/gentoobrowse/src/Jamfile.jam +++ b/gentoobrowse/src/Jamfile.jam @@ -86,6 +86,7 @@ run <slicer>yes <library>boost_filesystem <library>tidy + <library>../..//libxmlpp <library>icespider-testing <library>boost_unit_test_framework : gentoobrowse-test ; diff --git a/gentoobrowse/src/test.cpp b/gentoobrowse/src/test.cpp index d593ea1..44fa32e 100644 --- a/gentoobrowse/src/test.cpp +++ b/gentoobrowse/src/test.cpp @@ -6,6 +6,7 @@ #include <boost/filesystem/operations.hpp> #include <testRequest.h> #include <tidy.h> +#include <libxml++/parsers/domparser.h> using namespace IceSpider; @@ -24,7 +25,7 @@ class ChromiumRequest : public TestRequest { hdr["Accept-Language"] = "en-GB,en;q=0.8"; } - void standardAssertions(const char * name) + virtual void standardAssertions(const char * name) { auto h = getResponseHeaders(); BOOST_REQUIRE_EQUAL(h["Status"], "200 OK"); @@ -47,6 +48,23 @@ class ChromiumRequest : public TestRequest { } }; +class ChromiumRequestXml : public ChromiumRequest { + public: + ChromiumRequestXml(const Core * c, HttpMethod m, const std::string & p) : + ChromiumRequest(c, m, p) + { + hdr["Accept"] = "application/xml"; + } + + virtual void standardAssertions(const char *) + { + auto h = getResponseHeaders(); + BOOST_REQUIRE_EQUAL(h["Status"], "200 OK"); + xmlpp::DomParser p; + p.parse_stream(this->output); + } +}; + BOOST_AUTO_TEST_CASE( cd ) { boost::filesystem::current_path(rootDir.parent_path()); @@ -131,5 +149,12 @@ BOOST_AUTO_TEST_CASE( search_default ) request.standardAssertions(typeid(this).name()); } +BOOST_AUTO_TEST_CASE( search_sitemap ) +{ + ChromiumRequestXml request(this, HttpMethod::GET, "/sitemap.xml"); + process(&request); + request.standardAssertions(typeid(this).name()); +} + BOOST_AUTO_TEST_SUITE_END(); |