~ubuntu-branches/ubuntu/precise/surefire/precise

« back to all changes in this revision

Viewing changes to surefire-api/src/main/java/org/apache/maven/surefire/report/Reporter.java

  • Committer: Bazaar Package Importer
  • Author(s): Miguel Landaeta
  • Date: 2011-10-10 20:42:16 UTC
  • mfrom: (2.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20111010204216-cemva69wkagf4fay
Tags: 2.10-1
* Team upload.
* New upstream release.
* Refresh and remove unneccesary patches.
* Add Build-Depends on libsurefire-java and
  libmaven-common-artifact-filters-java.
* Drop outdated Maven artifact surefire-junit.
* Provide new Maven artifacts: surefire-junit3, maven-surefire-common,
  common-junit3, common-junit4, surefire-junit47 and surefire-testng-utils.
* Fix clean target to allow "two in a row" builds.
* Update Vcs-Browser field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 * under the License.
20
20
 */
21
21
 
22
 
import java.util.Collection;
23
 
 
24
22
/**
25
 
 * Contract between the different implementations of the Surefire reporters
26
 
 *
27
 
 * @version $Id: Reporter.java 510866 2007-02-23 08:13:49Z brett $
 
23
 * Persists reports somewhere
 
24
 * <p/>
 
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.
28
27
 */
29
28
public interface Reporter
30
29
{
31
 
    void writeMessage( String message );
32
 
 
33
 
    void writeFooter( String footer );
34
 
 
35
 
    // The entire run
36
 
    void runStarting( int testCount );
37
 
 
38
 
    void runCompleted();
39
 
 
40
 
    void runStopped();
41
 
 
42
 
    void runAborted( ReportEntry report );
43
 
 
44
 
    // Test Sets
 
30
    /**
 
31
     * Indicates the start of a given test-set
 
32
     *
 
33
     * @param report the report entry describing the testset
 
34
     * @throws org.apache.maven.surefire.report.ReporterException
 
35
     *          When reporting fails
 
36
     */
45
37
    void testSetStarting( ReportEntry report )
46
38
        throws ReporterException;
47
39
 
 
40
    /**
 
41
     * Indicates end of a given test-set
 
42
     *
 
43
     * @param report the report entry describing the testset
 
44
     * @throws org.apache.maven.surefire.report.ReporterException
 
45
     *          When reporting fails
 
46
     */
48
47
    void testSetCompleted( ReportEntry report )
49
48
        throws ReporterException;
50
49
 
51
 
    void testSetAborted( ReportEntry report );
52
 
 
53
50
    // Tests
54
51
 
55
52
    /**
56
53
     * Event fired when a test is about to start
57
54
     *
58
 
     * @param report
 
55
     * @param report The report entry to log for
59
56
     */
60
57
    void testStarting( ReportEntry report );
61
58
 
62
59
    /**
63
60
     * Event fired when a test ended successfully
64
61
     *
65
 
     * @param report
 
62
     * @param report The report entry to log for
66
63
     */
67
64
    void testSucceeded( ReportEntry report );
68
65
 
 
66
 
 
67
    void testSkipped( ReportEntry report );
 
68
 
69
69
    /**
70
70
     * Event fired when a test ended with an error (non anticipated problem)
71
71
     *
72
 
     * @param report
 
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
75
75
     */
78
78
    /**
79
79
     * Event fired when a test ended with a failure (anticipated problem)
80
80
     *
81
 
     * @param report
 
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
84
84
     */
85
85
    void testFailed( ReportEntry report, String stdOut, String stdErr );
86
86
 
87
 
    void testSkipped( ReportEntry report );
88
 
 
89
 
    // Counters
 
87
    /**
 
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.
 
91
     *
 
92
     * @param message The message to write.
 
93
     */
 
94
    void writeMessage( String message );
 
95
 
 
96
    void writeMessage( byte[] b, int off, int len );
 
97
 
 
98
    /**
 
99
     * Restores the instance of the reporter, making the instance re-usable for a subsequent run in the
 
100
     * same thread.
 
101
     */
90
102
    void reset();
91
 
 
92
 
    /**
93
 
     * Get the number of errors
94
 
     *
95
 
     * @return
96
 
     */
97
 
    int getNumErrors();
98
 
 
99
 
    /**
100
 
     * Get the number of failures
101
 
     *
102
 
     * @return
103
 
     */
104
 
    int getNumFailures();
105
 
 
106
 
    /**
107
 
     * Get the number of tests
108
 
     *
109
 
     * @return
110
 
     */
111
 
    int getNumTests();
112
 
 
113
 
    /**
114
 
     * Get the number of tests skipped
115
 
     *
116
 
     * @return
117
 
     */
118
 
    int getNumSkipped();
119
 
 
120
 
    /**
121
 
     * Gives the source(s) that causes the error(s).
122
 
     *
123
 
     * @return The source(s).
124
 
     */
125
 
    Collection getErrorSources();
126
 
 
127
 
    /**
128
 
     * Gives the source(s) that causes the failures(s).
129
 
     *
130
 
     * @return The source(s).
131
 
     */
132
 
    Collection getFailureSources();
133
103
}