View Javadoc

1   package org.apache.maven.surefire.report;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *     http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  /**
23   * Used by providers to report results.
24   * Using this interface integrates the providers together into a common reporting infrastructure.
25   * <p/>
26   * An instance of a reporter is not guaranteed to be thread-safe and concurrent test frameworks
27   * must request an instance of a reporter per-thread from the ReporterFactory.
28   */
29  public interface RunListener
30  {
31      /**
32       * Indicates the start of a given test-set
33       *
34       * @param report the report entry describing the testset
35       * @throws ReporterException When reporting fails
36       */
37      void testSetStarting( ReportEntry report )
38          throws ReporterException;
39  
40      /**
41       * Indicates end of a given test-set
42       *
43       * @param report the report entry describing the testset
44       * @throws ReporterException When reporting fails
45       */
46      void testSetCompleted( ReportEntry report )
47          throws ReporterException;
48  
49      // Tests
50  
51      /**
52       * Event fired when a test is about to start
53       *
54       * @param report The report entry to log for
55       */
56      void testStarting( ReportEntry report );
57  
58      /**
59       * Event fired when a test ended successfully
60       *
61       * @param report The report entry to log for
62       */
63      void testSucceeded( ReportEntry report );
64  
65      /**
66       * Event fired when a test assumption failure was encountered.
67       * An assumption failure indicates that the test is not relevant
68       *
69       * @param report The report entry to log for
70       */
71      void testAssumptionFailure( ReportEntry report );
72  
73  
74      /**
75       * Event fired when a test ended with an error (non anticipated problem)
76       *
77       * @param report The report entry to log for
78       */
79      void testError( ReportEntry report );
80  
81      /**
82       * Event fired when a test ended with a failure (anticipated problem)
83       *
84       * @param report The report entry to log for
85       */
86      void testFailed( ReportEntry report );
87  
88  
89      void testSkipped( ReportEntry report );
90  }