CPUnit 0.7 (beta)
The REAL C++ port of JUnit.
unittest::TestRunnerDecorator Class Reference

This class implements functionality enabling objects to be part of the test runner chain. More...

#include <unittest_TestRunnerDecorator.hpp>

Inheritance diagram for unittest::TestRunnerDecorator:
unittest::TestRunner unittest::RunAllTestRunner unittest::TimeGuardRunner

List of all members.

Public Member Functions

 TestRunnerDecorator ()
 Creates an empty decorator.
 TestRunnerDecorator (const TestRunner *_inner)
virtual ~TestRunnerDecorator ()
void set_inner (const TestRunner *_inner)
 Sets a new inner object in the call chain.
ExecutionReport inner_run (TestUnit tu) const
 Primarily meant to be called from sub-classes.

Private Member Functions

 TestRunnerDecorator (const TestRunnerDecorator &)
TestRunnerDecoratoroperator= (const TestRunnerDecorator &)

Private Attributes

std::auto_ptr< const TestRunnerinner
 Holds the next object in the call chain.

Detailed Description

This class implements functionality enabling objects to be part of the test runner chain.

Subclass this class and implement the TestRunner.run method declared in TestRunner. The implementation must call TestRunnerDecorator.inner_run to invoke the next object in the chain. Implement your own functionality before and after (or around) this call as you like, and insert an object of the class at the appropriate place in TestExecutionFacade.get_test_runner.

See also:
RunAllTestRunner for an example implementation.

Definition at line 55 of file unittest_TestRunnerDecorator.hpp.


Constructor & Destructor Documentation

unittest::TestRunnerDecorator::TestRunnerDecorator ( const TestRunnerDecorator ) [private]
unittest::TestRunnerDecorator::TestRunnerDecorator ( )

Creates an empty decorator.

See also:
inner_run

Definition at line 39 of file unittest_TestRunnerDecorator.cpp.

unittest::TestRunnerDecorator::TestRunnerDecorator ( const TestRunner _inner)
Parameters:
_innerThe next object in the call chain. The decorator takes control of the passed TestRunner and will call delete on the pointer in its destructor.

Definition at line 48 of file unittest_TestRunnerDecorator.cpp.

unittest::TestRunnerDecorator::~TestRunnerDecorator ( ) [virtual]

Definition at line 53 of file unittest_TestRunnerDecorator.cpp.


Member Function Documentation

unittest::ExecutionReport unittest::TestRunnerDecorator::inner_run ( TestUnit  tu) const

Primarily meant to be called from sub-classes.

Calls TestRunner.run on the next object in the call chain.

Exceptions:
WrongSetupExceptionif the inner object is not set.

Definition at line 77 of file unittest_TestRunnerDecorator.cpp.

TestRunnerDecorator& unittest::TestRunnerDecorator::operator= ( const TestRunnerDecorator ) [private]
void unittest::TestRunnerDecorator::set_inner ( const TestRunner _inner)

Sets a new inner object in the call chain.

Notice that the entire chain below this object will be replaced by the passed TestRunner.

Parameters:
_innerThe new test sub-chain below this object.
Exceptions:
WrongSetupExceptionif the passed inner object is NULL.

Definition at line 64 of file unittest_TestRunnerDecorator.cpp.


Member Data Documentation

std::auto_ptr<const TestRunner> unittest::TestRunnerDecorator::inner [private]

Holds the next object in the call chain.

Definition at line 58 of file unittest_TestRunnerDecorator.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines