Class used to test the HTTP API.
More...
|
| void | SetUp () |
| | Sets up the test fixture.
|
| |
| void | TearDown () |
| | Tears down the test fixture.
|
| |
|
| static bool | accessHandler (const std::string &type, const std::string &token, std::error_code &errc) |
| | handle authentication.
|
| |
| static void | getHandler (Http::Worker *worker) |
| | handle dynamic get content.
|
| |
| static void | postHandler (Http::Worker *worker) |
| | handle dynamic post content.
|
| |
|
| static const std::string | _basePath = "/tmp/www" |
| | base path.
|
| |
| static const std::string | _sample = "<html><body><h1>It works!</h1></body></html>" |
| | sample.
|
| |
| static const std::string | _sampleFileName = "sample.html" |
| | sample file name.
|
| |
| static const std::string | _sampleFile = _basePath + "/" + _sampleFileName |
| | sample path.
|
| |
| static const std::string | _token = "adlSaJkmBLpgnRRCjkCgQ4uaCagKHsIN" |
| | session token.
|
| |
| static const std::string | _host = "localhost" |
| | server hostname.
|
| |
| static const uint16_t | _port = 5000 |
| | server port.
|
| |
| static const int | _timeout = 5 |
| | server keep alive timeout.
|
| |
| static const int | _max = 20 |
| | server keep alive max requests.
|
| |
Class used to test the HTTP API.
◆ accessHandler()
| static bool HttpTest::accessHandler |
( |
const std::string & | type, |
|
|
const std::string & | token, |
|
|
std::error_code & | errc ) |
|
inlinestaticprotected |
handle authentication.
- Parameters
-
| type | authorization type. |
| token | session token. |
| errc | error code. |
- Returns
- true on success, false otherwise.
◆ getHandler()
| static void HttpTest::getHandler |
( |
Http::Worker * | worker | ) |
|
|
inlinestaticprotected |
handle dynamic get content.
- Parameters
-
| worker | worker thread context. |
◆ postHandler()
| static void HttpTest::postHandler |
( |
Http::Worker * | worker | ) |
|
|
inlinestaticprotected |
handle dynamic post content.
- Parameters
-
| worker | worker thread context. |
◆ SetUp()
Sets up the test fixture.
◆ SetUpTestCase()
| static void HttpTest::SetUpTestCase |
( |
| ) |
|
|
inlinestatic |
◆ TearDown()
| void HttpTest::TearDown |
( |
| ) |
|
|
inlineprotected |
Tears down the test fixture.
◆ TearDownTestCase()
| static void HttpTest::TearDownTestCase |
( |
| ) |
|
|
inlinestatic |
◆ _basePath
| const std::string HttpTest::_basePath = "/tmp/www" |
|
staticprotected |
◆ _host
| const std::string HttpTest::_host = "localhost" |
|
staticprotected |
◆ _max
| const int HttpTest::_max = 20 |
|
staticprotected |
server keep alive max requests.
◆ _port
| const uint16_t HttpTest::_port = 5000 |
|
staticprotected |
◆ _sample
| const std::string HttpTest::_sample = "<html><body><h1>It works!</h1></body></html>" |
|
staticprotected |
◆ _sampleFile
◆ _sampleFileName
| const std::string HttpTest::_sampleFileName = "sample.html" |
|
staticprotected |
◆ _timeout
| const int HttpTest::_timeout = 5 |
|
staticprotected |
server keep alive timeout.
◆ _token
| const std::string HttpTest::_token = "adlSaJkmBLpgnRRCjkCgQ4uaCagKHsIN" |
|
staticprotected |
The documentation for this class was generated from the following file: