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

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

#include <cpunit_TestRunnerDecorator.hpp>

Inheritance diagram for cpunit::TestRunnerDecorator:
cpunit::TestRunner cpunit::RunAllTestRunner cpunit::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 cpunit_TestRunnerDecorator.hpp.


Constructor & Destructor Documentation

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

Creates an empty decorator.

See also:
inner_run

Definition at line 39 of file cpunit_TestRunnerDecorator.cpp.

cpunit::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 cpunit_TestRunnerDecorator.cpp.

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

Definition at line 53 of file cpunit_TestRunnerDecorator.cpp.


Member Function Documentation

cpunit::ExecutionReport cpunit::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 cpunit_TestRunnerDecorator.cpp.

TestRunnerDecorator& cpunit::TestRunnerDecorator::operator= ( const TestRunnerDecorator ) [private]
void cpunit::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 cpunit_TestRunnerDecorator.cpp.


Member Data Documentation

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

Holds the next object in the call chain.

Definition at line 58 of file cpunit_TestRunnerDecorator.hpp.


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