17 #ifndef __TESTS_DISK_PROFILE_SERVER_HPP__ 18 #define __TESTS_DISK_PROFILE_SERVER_HPP__ 22 #include <gmock/gmock.h> 51 self().
id +
"/profiles");
59 void initialize()
override 61 route(
"/profiles",
None(), &Self::profiles);
77 server->process->self(),
78 [=]() -> std::shared_ptr<TestDiskProfileServer> {
return server; });
87 std::unique_ptr<TestDiskProfileServerProcess>
process;
100 #endif // __TESTS_DISK_PROFILE_SERVER_HPP__ ProcessBase(const std::string &id="")
TestDiskProfileServerProcess()
Definition: disk_profile_server.hpp:42
void route(const std::string &name, const Option< std::string > &help, const HttpRequestHandler &handler, const RouteOptions &options=RouteOptions())
Sets up a handler for HTTP requests with the specified name.
UPID spawn(ProcessBase *process, bool manage=false)
Spawn a new process.
void terminate(const UPID &pid, bool inject=true)
Sends a TerminateEvent to the given process.
process::http::URL url()
Definition: disk_profile_server.hpp:45
void dispatch(const PID< T > &pid, void(T::*method)())
Definition: dispatch.hpp:174
~TestDiskProfileServer()
Definition: disk_profile_server.hpp:81
bool wait(const UPID &pid, const Duration &duration=Seconds(-1))
Wait for the process to exit for no more than the specified seconds.
Definition: disk_profile_server.hpp:38
Definition: attributes.hpp:24
Definition: executor.hpp:48
network::inet::Address address()
Returns the socket address associated with this instance of the library.
Definition: disk_profile_server.hpp:66
std::unique_ptr< TestDiskProfileServerProcess > process
Definition: disk_profile_server.hpp:87
Definition: process.hpp:505
static process::Future< std::shared_ptr< TestDiskProfileServer > > create()
Definition: disk_profile_server.hpp:69
MOCK_METHOD1(profiles, process::Future< process::http::Response >(const process::http::Request &))