2 #ifndef ZYPP_TEST_WEBSERVER_H
3 #define ZYPP_TEST_WEBSERVER_H
6 #include "zypp/Pathname.h"
7 #include "zypp/base/PtrTypes.h"
11 * Starts a webserver to simulate remote transfers in
13 * \author Duncan Mac-Vicar P. <dmacvicar@suse.de>
16 * #include "WebServer.h"
18 * BOOST_AUTO_TEST_CASE(Foo)
21 * WebServer web((Pathname(TESTS_SRC_DIR) + "/datadir").c_str() );
24 * MediaSetAccess media( Url("http://localhost:9099"), "/" );
26 * // do something with the url
37 * creates a web server on \ref root and \port
39 WebServer(const zypp::Pathname &root, unsigned int port=10001);
42 * Starts the webserver worker thread
46 * Stops the worker thread
51 * returns the port we are listening to
56 * returns the base url where the webserver is listening
58 zypp::Url url() const;
61 * shows the log of last run
63 std::string log() const;
67 /** Pointer to implementation */
68 zypp::RWCOW_pointer<Impl> _pimpl;