19
19
* under the License.
22
import java.util.Collection;
25
* Contract between the different implementations of the Surefire reporters
27
* @version $Id: Reporter.java 510866 2007-02-23 08:13:49Z brett $
23
* Persists reports somewhere
25
* An instance of a reporter is not guaranteed to be thread-safe and concurrent test frameworks
26
* must request an instance of a reporter per-thread from the ReporterFactory.
29
28
public interface Reporter
31
void writeMessage( String message );
33
void writeFooter( String footer );
36
void runStarting( int testCount );
42
void runAborted( ReportEntry report );
31
* Indicates the start of a given test-set
33
* @param report the report entry describing the testset
34
* @throws org.apache.maven.surefire.report.ReporterException
35
* When reporting fails
45
37
void testSetStarting( ReportEntry report )
46
38
throws ReporterException;
41
* Indicates end of a given test-set
43
* @param report the report entry describing the testset
44
* @throws org.apache.maven.surefire.report.ReporterException
45
* When reporting fails
48
47
void testSetCompleted( ReportEntry report )
49
48
throws ReporterException;
51
void testSetAborted( ReportEntry report );
56
53
* Event fired when a test is about to start
55
* @param report The report entry to log for
60
57
void testStarting( ReportEntry report );
63
60
* Event fired when a test ended successfully
62
* @param report The report entry to log for
67
64
void testSucceeded( ReportEntry report );
67
void testSkipped( ReportEntry report );
70
70
* Event fired when a test ended with an error (non anticipated problem)
72
* @param report The report entry to log for
73
73
* @param stdOut standard output from the test case
74
74
* @param stdErr error output from the test case
79
79
* Event fired when a test ended with a failure (anticipated problem)
81
* @param report The report entry to log for
82
82
* @param stdOut standard output from the test case
83
83
* @param stdErr error output from the test case
85
85
void testFailed( ReportEntry report, String stdOut, String stdErr );
87
void testSkipped( ReportEntry report );
88
* Writes a message that will be displayed in all free-text format reporters.
89
* These messages will be output regardless, as opposed to #writeDetailMessage,
90
* which is controlled by reportFormat.
92
* @param message The message to write.
94
void writeMessage( String message );
96
void writeMessage( byte[] b, int off, int len );
99
* Restores the instance of the reporter, making the instance re-usable for a subsequent run in the
93
* Get the number of errors
100
* Get the number of failures
104
int getNumFailures();
107
* Get the number of tests
114
* Get the number of tests skipped
121
* Gives the source(s) that causes the error(s).
123
* @return The source(s).
125
Collection getErrorSources();
128
* Gives the source(s) that causes the failures(s).
130
* @return The source(s).
132
Collection getFailureSources();