RobotTestingFramework  2.0.1
Robot Testing Framework
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
robottestingframework::WebProgressListenerImpl Class Reference

Singleton class WebProgressListenerImpl listens to any messages reported by the tests during the test run, formates them sends them to the web clients. More...

#include <robottestingframework/impl/WebProgressListener_impl.h>

Public Types

enum  TestStatus {
  TestStatus::NotRun = 0,
  TestStatus::Running = 1,
  TestStatus::Failed = 2,
  TestStatus::Success = 3
}
 

Public Member Functions

virtual ~WebProgressListenerImpl ()
 WebProgressListenerImpl destructor. More...
 
virtual void addReport (const Test *test, TestMessage msg)
 This is called to report any arbitrary message from tests. More...
 
virtual void addError (const Test *test, TestMessage msg)
 This is called when an error occurred during test run. More...
 
virtual void addFailure (const Test *test, TestMessage msg)
 This is called when a failure occurred during test run. More...
 
virtual void startTest (const Test *test)
 This is called when a Test is started. More...
 
virtual void endTest (const Test *test)
 This is called when a Test is finished. More...
 
virtual void startTestSuite (const Test *test)
 This is called when a TestSuite is started. More...
 
virtual void endTestSuite (const Test *test)
 This is called when a TestSuite is finished. More...
 
virtual void startTestRunner ()
 This is called when the TestRunner is started. More...
 
virtual void endTestRunner ()
 This is called when the TestRunner is finished. More...
 

Static Public Member Functions

static WebProgressListenerImplcreate (unsigned int port=8080, bool verbose=false)
 create Creates an instance of WebProgressListenerImpl class More...
 

Public Attributes

struct mg_server * server
 
std::mutex critical
 
bool shouldStop
 
std::string result
 
std::string suite_name
 
std::size_t suite_size
 
std::vector< TestStatustestStatus
 

Private Member Functions

 WebProgressListenerImpl (WebProgressListenerImpl const &)=delete
 
void operator= (WebProgressListenerImpl const &)=delete
 
 WebProgressListenerImpl (unsigned int port, bool verbose)
 
std::string encode (const std::string &data)
 

Static Private Member Functions

static void update (void *param)
 
static int handler (struct mg_connection *conn, enum mg_event ev)
 

Private Attributes

std::thread * updater
 
bool verbose
 
unsigned int port
 

Detailed Description

Singleton class WebProgressListenerImpl listens to any messages reported by the tests during the test run, formates them sends them to the web clients.

Definition at line 41 of file WebProgressListener_impl.h.

Member Enumeration Documentation

◆ TestStatus

Enumerator
NotRun 
Running 
Failed 
Success 

Definition at line 123 of file WebProgressListener_impl.h.

Constructor & Destructor Documentation

◆ ~WebProgressListenerImpl()

virtual robottestingframework::WebProgressListenerImpl::~WebProgressListenerImpl ( )
virtual

◆ WebProgressListenerImpl() [1/2]

robottestingframework::WebProgressListenerImpl::WebProgressListenerImpl ( WebProgressListenerImpl const &  )
privatedelete

◆ WebProgressListenerImpl() [2/2]

robottestingframework::WebProgressListenerImpl::WebProgressListenerImpl ( unsigned int  port,
bool  verbose 
)
private

Member Function Documentation

◆ addError()

virtual void robottestingframework::WebProgressListenerImpl::addError ( const Test test,
TestMessage  msg 
)
virtual

This is called when an error occurred during test run.

Parameters
testpointer to the corresponding test
msgcorrespoinding error message

◆ addFailure()

virtual void robottestingframework::WebProgressListenerImpl::addFailure ( const Test test,
TestMessage  msg 
)
virtual

This is called when a failure occurred during test run.

Parameters
testpointer to the corresponding test
msgcorrespoinding failure message

◆ addReport()

virtual void robottestingframework::WebProgressListenerImpl::addReport ( const Test test,
TestMessage  msg 
)
virtual

This is called to report any arbitrary message from tests.

Parameters
testpointer to the corresponding test
msgcorrespoinding error message

◆ create()

static WebProgressListenerImpl& robottestingframework::WebProgressListenerImpl::create ( unsigned int  port = 8080,
bool  verbose = false 
)
static

create Creates an instance of WebProgressListenerImpl class

Parameters
portthe server port number. default is 8080
verboseenables the verbose mode. If true, the source file and the line number where the messages are issued by the tests will be written to the standard output. The verbose mode is disabled by default.

◆ encode()

std::string robottestingframework::WebProgressListenerImpl::encode ( const std::string &  data)
private

◆ endTest()

virtual void robottestingframework::WebProgressListenerImpl::endTest ( const Test test)
virtual

This is called when a Test is finished.

Parameters
testpointer to the corresponding test

◆ endTestRunner()

virtual void robottestingframework::WebProgressListenerImpl::endTestRunner ( )
virtual

This is called when the TestRunner is finished.

◆ endTestSuite()

virtual void robottestingframework::WebProgressListenerImpl::endTestSuite ( const Test test)
virtual

This is called when a TestSuite is finished.

Parameters
testpointer to the corresponding test

◆ handler()

static int robottestingframework::WebProgressListenerImpl::handler ( struct mg_connection *  conn,
enum mg_event  ev 
)
staticprivate

◆ operator=()

void robottestingframework::WebProgressListenerImpl::operator= ( WebProgressListenerImpl const &  )
privatedelete

◆ startTest()

virtual void robottestingframework::WebProgressListenerImpl::startTest ( const Test test)
virtual

This is called when a Test is started.

Parameters
testpointer to the corresponding test

◆ startTestRunner()

virtual void robottestingframework::WebProgressListenerImpl::startTestRunner ( )
virtual

This is called when the TestRunner is started.

◆ startTestSuite()

virtual void robottestingframework::WebProgressListenerImpl::startTestSuite ( const Test test)
virtual

This is called when a TestSuite is started.

Parameters
testpointer to the corresponding test

◆ update()

static void robottestingframework::WebProgressListenerImpl::update ( void *  param)
staticprivate

Member Data Documentation

◆ critical

std::mutex robottestingframework::WebProgressListenerImpl::critical

Definition at line 117 of file WebProgressListener_impl.h.

◆ port

unsigned int robottestingframework::WebProgressListenerImpl::port
private

Definition at line 147 of file WebProgressListener_impl.h.

◆ result

std::string robottestingframework::WebProgressListenerImpl::result

Definition at line 119 of file WebProgressListener_impl.h.

◆ server

struct mg_server* robottestingframework::WebProgressListenerImpl::server

Definition at line 116 of file WebProgressListener_impl.h.

◆ shouldStop

bool robottestingframework::WebProgressListenerImpl::shouldStop

Definition at line 118 of file WebProgressListener_impl.h.

◆ suite_name

std::string robottestingframework::WebProgressListenerImpl::suite_name

Definition at line 120 of file WebProgressListener_impl.h.

◆ suite_size

std::size_t robottestingframework::WebProgressListenerImpl::suite_size

Definition at line 121 of file WebProgressListener_impl.h.

◆ testStatus

std::vector<TestStatus> robottestingframework::WebProgressListenerImpl::testStatus

Definition at line 131 of file WebProgressListener_impl.h.

◆ updater

std::thread* robottestingframework::WebProgressListenerImpl::updater
private

Definition at line 145 of file WebProgressListener_impl.h.

◆ verbose

bool robottestingframework::WebProgressListenerImpl::verbose
private

Definition at line 146 of file WebProgressListener_impl.h.


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