View Javadoc
1   package org.apache.maven.surefire.api.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  import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
23  
24  /**
25   * This architecture has two sides (forked JVM, plugin JVM) implementing the same interface {@link TestReportListener}:
26   * <pre>
27   * 1. <b>publisher</b> - surefire fork JVM: {@link org.apache.maven.surefire.api.booter.ForkingRunListener}
28   *    registered in {@link  org.apache.maven.surefire.api.provider.SurefireProvider}
29   * 2. <b>consumer</b> - plugin JVM: {@code TestSetRunListener} registered in the {@code ForkClient}
30   * </pre>
31   * Both implementations of {@link TestReportListener}, i.e.
32   * {@link org.apache.maven.surefire.api.booter.ForkingRunListener} and {@code TestSetRunListener}
33   * are decorators. They are used as delegators in interface adapters, see the implementations of
34   * JUnit's {@code RunListener RunListener-s}.
35   * <br>
36   * The serialization of data in {@link TestReportListener} ensures that the ReportEntries are transferred
37   * from the fork to the plugin.
38   * <br>
39   * Note: The adapters in the module <i>surefire-junit47</i> are temporal and will be removed after we have fixed
40   * the SUREFIRE-1860 and XML reporter in SUREFIRE-1643. The adapters are a workaround of a real fix in both Jira issues.
41   *
42   * @param <T> usually {@link TestOutputReportEntry} or {@link OutputReportEntry}
43   */
44  public interface TestReportListener<T extends OutputReportEntry>
45      extends RunListener, TestOutputReceiver<T>, ConsoleLogger
46  {
47  }