join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
HttpTest Class Reference

Class used to test the HTTP API. More...

Inheritance diagram for HttpTest:
Collaboration diagram for HttpTest:

Static Public Member Functions

static void SetUpTestCase ()
 Set up test case.
 
static void TearDownTestCase ()
 Tear down test case.
 

Protected Member Functions

void SetUp ()
 Sets up the test fixture.
 
void TearDown ()
 Tears down the test fixture.
 

Static Protected Member Functions

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 Protected Attributes

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.
 

Detailed Description

Class used to test the HTTP API.

Member Function Documentation

◆ accessHandler()

static bool HttpTest::accessHandler ( const std::string & type,
const std::string & token,
std::error_code & errc )
inlinestaticprotected

handle authentication.

Parameters
typeauthorization type.
tokensession token.
errcerror code.
Returns
true on success, false otherwise.

◆ getHandler()

static void HttpTest::getHandler ( Http::Worker * worker)
inlinestaticprotected

handle dynamic get content.

Parameters
workerworker thread context.

◆ postHandler()

static void HttpTest::postHandler ( Http::Worker * worker)
inlinestaticprotected

handle dynamic post content.

Parameters
workerworker thread context.

◆ SetUp()

void HttpTest::SetUp ( )
inlineprotected

Sets up the test fixture.

◆ SetUpTestCase()

static void HttpTest::SetUpTestCase ( )
inlinestatic

Set up test case.

◆ TearDown()

void HttpTest::TearDown ( )
inlineprotected

Tears down the test fixture.

◆ TearDownTestCase()

static void HttpTest::TearDownTestCase ( )
inlinestatic

Tear down test case.

Member Data Documentation

◆ _basePath

const std::string HttpTest::_basePath = "/tmp/www"
staticprotected

base path.

◆ _host

const std::string HttpTest::_host = "localhost"
staticprotected

server hostname.

◆ _max

const int HttpTest::_max = 20
staticprotected

server keep alive max requests.

◆ _port

const uint16_t HttpTest::_port = 5000
staticprotected

server port.

◆ _sample

const std::string HttpTest::_sample = "<html><body><h1>It works!</h1></body></html>"
staticprotected

sample.

◆ _sampleFile

const std::string HttpTest::_sampleFile = _basePath + "/" + _sampleFileName
staticprotected

sample path.

◆ _sampleFileName

const std::string HttpTest::_sampleFileName = "sample.html"
staticprotected

sample file name.

◆ _timeout

const int HttpTest::_timeout = 5
staticprotected

server keep alive timeout.

◆ _token

const std::string HttpTest::_token = "adlSaJkmBLpgnRRCjkCgQ4uaCagKHsIN"
staticprotected

session token.


The documentation for this class was generated from the following file: