VICI  0.11.815
Visual Chart Interpreter
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
VICI::cdi::Tester Class Reference

Responsible for managing the testing. More...

#include <vici/testmgr.h>

Public Member Functions

void configure (csr testName)
 specify the name of the test as in the configuration file More...
 
csr getTestName ()
 Get the name of the test. More...
 
virtual ~Tester ()
 Destructor.
 
cfi::logstreamlog ()
 Get a reference to the logging stream used for the testing. More...
 
void addTestCase (csr name, csr scenario, TestCaseFactory *tcf)
 Add a test case factory. More...
 
void runTestCase (csr scenarioName, csr testCaseName, ScenarioResults *)
 Run a specific test case.
 
void getTestCases (csr scenarioName, std::set< std::string > &testCases)
 Get the test case names for a scenario.
 
void addScenario (csr scenario, ScenarioFactory *sf)
 Add a scenario factory. More...
 
void setTest (TestFactory *t)
 Set the main test object factory. More...
 
AbstractTestgetTest ()
 Get the test object. More...
 
AbstractScenariogetScenario ()
 Get the current scenario object. More...
 
virtual void runTests ()
 Run all the tests.
 
bool summary ()
 Print a summary of the testing to the log stream. More...
 

Static Public Member Functions

static Testerinstance ()
 Get a reference to the Tester. More...
 

Protected Member Functions

 Tester ()
 Protected Constructor.
 
void title ()
 Print title for the test.
 
void installDefaults ()
 Install default test and scenario objects.
 
void testScenario (csr scenario, ScenarioFactory *scn)
 Do testing of a scenario. More...
 

Protected Attributes

std::string nameOfTest
 Identifier for test in the configuration file.
 
std::string logName
 Identifier for the log.
 
bool failed
 Flag to hold overall testing result.
 
std::map< std::string,
std::map< std::string,
TestCaseFactory * > > 
tests
 Factories for test cases indexed by name and scenario name.
 
std::map< std::string,
ScenarioFactory * > 
scenarios
 Factories for scenarios indexed by scenario name.
 
std::map< std::string,
ScenarioResults * > 
results
 Results for scenario tests indexed by scenario name.
 
TestFactorytheTest
 Factor for the overall test.
 
AbstractTestabsTest
 Pointer to the abstract test object. Only valid during the test run.
 
AbstractScenarioabsScenario
 Pointer to the abstract scenario object. Only valid during the test run.
 

Detailed Description

Responsible for managing the testing.

A singleton that manages the testing, accumlates the test results and provides a report.

Member Function Documentation

void Tester::addScenario ( csr  scenario,
ScenarioFactory sf 
)

Add a scenario factory.

Parameters
scenarioThe name of the scenario
sfThe factory for the scenario
void Tester::addTestCase ( csr  name,
csr  scenario,
TestCaseFactory tcf 
)

Add a test case factory.

Parameters
nameThe name of the test case.
scenarioThe name of the enclosing scenario.
tcfThe factory for the test case.
void Tester::configure ( csr  testName)

specify the name of the test as in the configuration file

Parameters
testNameThe name of the test in the config file.
AbstractScenario* VICI::cdi::Tester::getScenario ( )
inline

Get the current scenario object.

Returns
The current scenario object
AbstractTest* VICI::cdi::Tester::getTest ( )
inline

Get the test object.

Returns
The test object
csr VICI::cdi::Tester::getTestName ( )
inline

Get the name of the test.

Returns
the name of test
Tester & Tester::instance ( )
static

Get a reference to the Tester.

Returns
A reference to the Tester singleton object.
logstream & Tester::log ( )

Get a reference to the logging stream used for the testing.

Returns
A reference to the logging stream
void VICI::cdi::Tester::setTest ( TestFactory t)
inline

Set the main test object factory.

Parameters
tThe factory for the test object.
bool Tester::summary ( )

Print a summary of the testing to the log stream.

Returns
true if the testing found no unexpected errors
void Tester::testScenario ( csr  scenario,
ScenarioFactory scn 
)
protected

Do testing of a scenario.

Parameters
scenarioThe name of the scenario.
scnThe factory for creating the scenario object

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