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