ITestReporterService¶
-
public interface
ITestReporterService
¶ Used to report the status of tests. Derive from
TestReporterServiceBase
instead of this interface. The base class performs some additional checks to ensure it is used correctly. Test frameworks, such as SPT, can report the status of the testing through a test reporter. Different test reporters handle these status messages differently. For example, a test reporter might simply write the test status to the standard output, whereas another test reporter would report the test results in the IDE UI.
Methods¶
getErr¶
-
PrintStream
getErr
()¶ Gets a stream to which test errors may be written.
Returns: A stream.
getLogger¶
-
ILogger
getLogger
()¶ Gets a logger to which the test output may be logged.
Returns: A logger.
getOut¶
-
PrintStream
getOut
()¶ Gets a stream to which test output may be written.
Returns: A stream.
sessionFinished¶
-
void
sessionFinished
()¶ The test session has finished. After this method no calls to the reporter are allowed.
sessionStarted¶
-
void
sessionStarted
()¶ A test session has started. After this method only calls to
sessionFinished()
,testStarted(String)
andtestSuiteStarted(String)
are allowed.
testFailed¶
-
void
testFailed
(String name, String reason, String details)¶ The test has finished and failed. After this method only calls to
sessionFinished()
,testStarted(String)
andtestSuiteStarted(String)
are allowed.Parameters: - name – The name of the test.
- reason – The reason the test failed; or null.
- details – The details about the failed test, such as additional messages and the stack trace; or null.
testIgnored¶
-
void
testIgnored
(String name, String reason)¶ The test has finished and was ignored. After this method only calls to
sessionFinished()
,testStarted(String)
andtestSuiteStarted(String)
are allowed.Parameters: - name – The name of the test.
- reason – The reason the test was ignored; or null.
testPassed¶
-
void
testPassed
(String name)¶ The test has finished and passed. After this method only calls to
sessionFinished()
,testStarted(String)
andtestSuiteStarted(String)
are allowed.Parameters: - name – The name of the test.
testStarted¶
-
void
testStarted
(String name)¶ A test has started. After this method only calls to
testPassed(String)
,testFailed(String,String,String)
andtestIgnored(String,String)
are allowed.Parameters: - name – The name of the test.
testSuiteFinished¶
-
void
testSuiteFinished
(String name)¶ The test suite has finished. After this method only calls to
sessionFinished()
,testStarted(String)
andtestSuiteStarted(String)
are allowed.Parameters: - name – The name of the test suite.
testSuiteStarted¶
-
void
testSuiteStarted
(String name)¶ A test suite has started. After this method only calls to
testSuiteStarted(String)
,testSuiteFinished(String)
andtestStarted(String)
are allowed. In other words, test suites can be nested.Parameters: - name – The name of the test suite.