Class TestSetRunListener
java.lang.Object
org.apache.maven.plugin.surefire.report.TestSetRunListener
- All Implemented Interfaces:
ConsoleLogger,ConsoleOutputReceiver,RunListener
public class TestSetRunListener
extends Object
implements RunListener, ConsoleOutputReceiver, ConsoleLogger
Reports data for a single test set.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final ConsoleOutputReportEventListenerprivate final TestSetStatsprivate RunModeprivate final StatelessReportEventListener<WrappedReportEntry,TestSetStats> private final StatisticsReporterprivate final Queue<TestMethodStats> -
Constructor Summary
ConstructorsConstructorDescriptionTestSetRunListener(StatelessTestsetInfoConsoleReportEventListener<WrappedReportEntry, TestSetStats> consoleReporter, StatelessTestsetInfoFileReportEventListener<WrappedReportEntry, TestSetStats> fileReporter, StatelessReportEventListener<WrappedReportEntry, TestSetStats> simpleXMLReporter, ConsoleOutputReportEventListener consoleOutputReceiver, StatisticsReporter statisticsReporter, boolean trimStackTrace, boolean isPlainFormat, boolean briefOrPlainFormat) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidvoidclose()voidvoidvoidSimply delegates toerror( toString( t, message ) ).voidSimply delegates to methoderror(null, Throwable).voidprivate static Utf8RecodingDeferredFileOutputStreaminitDeferred(String channel) booleanbooleanbooleanbooleanprivate static intlineBoundSymbolWidth(String message) Marks the listener with run mode, e.g.voidtestAssumptionFailure(ReportEntry report) Event fired when a test assumption failure was encountered.voidtestError(ReportEntry reportEntry) Event fired when a test ended with an error (non anticipated problem)voidEvent fired skipping an execution of remaining test-set in other fork(s); or does nothing if no forks.voidtestFailed(ReportEntry reportEntry) Event fired when a test ended with a failure (anticipated problem)voidtestSetCompleted(TestSetReportEntry report) Indicates end of a given test-setvoidtestSetStarting(TestSetReportEntry report) Indicates the start of a given test-setvoidtestSkipped(ReportEntry reportEntry) Event fired when a test is skippedvoidtestStarting(ReportEntry report) Event fired when a test is about to startvoidtestSucceeded(ReportEntry reportEntry) Event fired when a test ended successfullyprivate static StringtrimTrailingNewLine(String message) voidprivate WrappedReportEntrywrap(ReportEntry other, ReportEntryType reportEntryType) private WrappedReportEntrywrapTestSet(TestSetReportEntry other) voidwriteTestOutput(String output, boolean newLine, boolean stdout) Forwards process output from the running test-case into the reporting system
-
Field Details
-
testMethodStats
-
detailsForThis
-
consoleOutputReceiver
-
briefOrPlainFormat
private final boolean briefOrPlainFormat -
simpleXMLReporter
-
consoleReporter
private final StatelessTestsetInfoConsoleReportEventListener<WrappedReportEntry,TestSetStats> consoleReporter -
fileReporter
private final StatelessTestsetInfoFileReportEventListener<WrappedReportEntry,TestSetStats> fileReporter -
statisticsReporter
-
testStdOut
-
testStdErr
-
runMode
-
-
Constructor Details
-
TestSetRunListener
public TestSetRunListener(StatelessTestsetInfoConsoleReportEventListener<WrappedReportEntry, TestSetStats> consoleReporter, StatelessTestsetInfoFileReportEventListener<WrappedReportEntry, TestSetStats> fileReporter, StatelessReportEventListener<WrappedReportEntry, TestSetStats> simpleXMLReporter, ConsoleOutputReportEventListener consoleOutputReceiver, StatisticsReporter statisticsReporter, boolean trimStackTrace, boolean isPlainFormat, boolean briefOrPlainFormat)
-
-
Method Details
-
isDebugEnabled
public boolean isDebugEnabled()- Specified by:
isDebugEnabledin interfaceConsoleLogger
-
debug
- Specified by:
debugin interfaceConsoleLogger
-
isInfoEnabled
public boolean isInfoEnabled()- Specified by:
isInfoEnabledin interfaceConsoleLogger
-
info
- Specified by:
infoin interfaceConsoleLogger
-
isWarnEnabled
public boolean isWarnEnabled()- Specified by:
isWarnEnabledin interfaceConsoleLogger
-
warning
- Specified by:
warningin interfaceConsoleLogger
-
isErrorEnabled
public boolean isErrorEnabled()- Specified by:
isErrorEnabledin interfaceConsoleLogger
-
error
- Specified by:
errorin interfaceConsoleLogger- Parameters:
message- message to log
-
error
Description copied from interface:ConsoleLoggerSimply delegates toerror( toString( t, message ) ).- Specified by:
errorin interfaceConsoleLogger- Parameters:
message- message to logt- exception, message and trace to log
-
error
Description copied from interface:ConsoleLoggerSimply delegates to methoderror(null, Throwable).- Specified by:
errorin interfaceConsoleLogger- Parameters:
t- exception, message and trace to log
-
writeTestOutput
Description copied from interface:ConsoleOutputReceiverForwards process output from the running test-case into the reporting system- Specified by:
writeTestOutputin interfaceConsoleOutputReceiver- Parameters:
output- stdout/sterr output from running testsnewLine- print on new linestdout- Indicates if this is stdout
-
testSetStarting
Description copied from interface:RunListenerIndicates the start of a given test-set- Specified by:
testSetStartingin interfaceRunListener- Parameters:
report- the report entry describing the testset
-
clearCapture
private void clearCapture() -
testSetCompleted
Description copied from interface:RunListenerIndicates end of a given test-set- Specified by:
testSetCompletedin interfaceRunListener- Parameters:
report- the report entry describing the testset
-
testStarting
Description copied from interface:RunListenerEvent fired when a test is about to start- Specified by:
testStartingin interfaceRunListener- Parameters:
report- The report entry to log for
-
testSucceeded
Description copied from interface:RunListenerEvent fired when a test ended successfully- Specified by:
testSucceededin interfaceRunListener- Parameters:
reportEntry- The report entry to log for
-
testError
Description copied from interface:RunListenerEvent fired when a test ended with an error (non anticipated problem)- Specified by:
testErrorin interfaceRunListener- Parameters:
reportEntry- The report entry to log for
-
testFailed
Description copied from interface:RunListenerEvent fired when a test ended with a failure (anticipated problem)- Specified by:
testFailedin interfaceRunListener- Parameters:
reportEntry- The report entry to log for
-
testSkipped
Description copied from interface:RunListenerEvent fired when a test is skipped- Specified by:
testSkippedin interfaceRunListener- Parameters:
reportEntry- The report entry to log for
-
testExecutionSkippedByUser
public void testExecutionSkippedByUser()Description copied from interface:RunListenerEvent fired skipping an execution of remaining test-set in other fork(s); or does nothing if no forks. The method is called bySurefireProvider.(The event is fired after the Nth test failed to signal skipping the rest of test-set.)
- Specified by:
testExecutionSkippedByUserin interfaceRunListener
-
markAs
Description copied from interface:RunListenerMarks the listener with run mode, e.g. normal run or re-run.- Specified by:
markAsin interfaceRunListener- Parameters:
currentRunMode- set current run- Returns:
- previous run mode; never returns null
-
testAssumptionFailure
Description copied from interface:RunListenerEvent fired when a test assumption failure was encountered. An assumption failure indicates that the test is not relevant- Specified by:
testAssumptionFailurein interfaceRunListener- Parameters:
report- The report entry to log for
-
wrap
-
wrapTestSet
-
close
public void close() -
addTestMethodStats
private void addTestMethodStats() -
getTestMethodStats
-
trimTrailingNewLine
-
lineBoundSymbolWidth
-
initDeferred
-