TestRunner
is the definition for a process that executes a Test
.
It is the internal mechianism for the execution of a Test
. Any
Test
has to refer to its TestRunner
.
Since TestRunner
extends Process it is possible to add
all listeners for Process
to a TestRunner
.
Example for adding a Listener to the execution of a TestCase:
var testCase:TestCase = new MyTestCase();
var testRunner:TestRunner = testCase.getTestRunner();
// add a listener to log the events of the test
testRunner.addListener(new LoggerTestListener());
// start the execution of the testcase
testCase.run();
TestRunner
is part of the unit testing MVC construct. TestRunner
acts as controller, TestResult acts as model and all listeners act
as view. TestResult
can be accessed by .
The seperation of Test
& TestRunner
is to save the developer
of a TestCase
that contains all its execution details (can lead to
many reserved fields that might be used by the unit-test developer. In this way
only two fields ((@link Test#getTestRunner} & Test#run) are reserved.
public function getTestResult(Void):TestResult
Returns the TestResult
to the Test
executed by the TestRunner
.
The returned TestResult
may not be complete. This is the case
if the test has not been executed or has not finished yet.
TestResult for the Test
that contains all informations
public function getCurrentTestCase(Void):TestCaseResult
Returns the current executing TestCaseResult
.
It is necessary to get the TestCaseResult
for the TestCase
that just gets executed because there can be more than one TestCase
available within a TestResult
.
TestResult
to the current executing TestCase
public function getCurrentTestCaseMethodInfo(Void):TestCaseMethodInfo
Returns the current executing TestCaseMethodInfo
.
It is necessary to get the TestCaseMethodInfo
for the method
that just gets executed because there can be more than one methods available
within a TestCaseResult
.
informations about the current executing method