Class TestSetRunListener
- java.lang.Object
-
- org.apache.maven.plugin.surefire.report.TestSetRunListener
-
- All Implemented Interfaces:
ConsoleLogger
,ConsoleOutputReceiver
,RunListener
public class TestSetRunListener extends java.lang.Object implements RunListener, ConsoleOutputReceiver, ConsoleLogger
Reports data for a single test set.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
briefOrPlainFormat
private ConsoleOutputReportEventListener
consoleOutputReceiver
private StatelessTestsetInfoConsoleReportEventListener<WrappedReportEntry,TestSetStats>
consoleReporter
private TestSetStats
detailsForThis
private StatelessTestsetInfoFileReportEventListener<WrappedReportEntry,TestSetStats>
fileReporter
private RunMode
runMode
private StatelessReportEventListener<WrappedReportEntry,TestSetStats>
simpleXMLReporter
private StatisticsReporter
statisticsReporter
private java.util.Queue<TestMethodStats>
testMethodStats
private Utf8RecodingDeferredFileOutputStream
testStdErr
private Utf8RecodingDeferredFileOutputStream
testStdOut
-
Constructor Summary
Constructors Constructor Description TestSetRunListener(StatelessTestsetInfoConsoleReportEventListener<WrappedReportEntry,TestSetStats> consoleReporter, StatelessTestsetInfoFileReportEventListener<WrappedReportEntry,TestSetStats> fileReporter, StatelessReportEventListener<WrappedReportEntry,TestSetStats> simpleXMLReporter, ConsoleOutputReportEventListener consoleOutputReceiver, StatisticsReporter statisticsReporter, boolean trimStackTrace, boolean isPlainFormat, boolean briefOrPlainFormat)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addTestMethodStats()
private void
clearCapture()
void
close()
void
debug(java.lang.String message)
void
error(java.lang.String message)
void
error(java.lang.String message, java.lang.Throwable t)
Simply delegates toerror( toString( t, message ) )
.void
error(java.lang.Throwable t)
Simply delegates to methoderror(null, Throwable)
.java.util.Queue<TestMethodStats>
getTestMethodStats()
void
info(java.lang.String message)
private static Utf8RecodingDeferredFileOutputStream
initDeferred(java.lang.String channel)
boolean
isDebugEnabled()
boolean
isErrorEnabled()
boolean
isInfoEnabled()
boolean
isWarnEnabled()
private static int
lineBoundSymbolWidth(java.lang.String message)
RunMode
markAs(RunMode currentRunMode)
Marks the listener with run mode, e.g.void
testAssumptionFailure(ReportEntry report)
Event fired when a test assumption failure was encountered.void
testError(ReportEntry reportEntry)
Event fired when a test ended with an error (non anticipated problem)void
testExecutionSkippedByUser()
Event fired skipping an execution of remaining test-set in other fork(s); or does nothing if no forks.void
testFailed(ReportEntry reportEntry)
Event fired when a test ended with a failure (anticipated problem)void
testSetCompleted(TestSetReportEntry report)
Indicates end of a given test-setvoid
testSetStarting(TestSetReportEntry report)
Indicates the start of a given test-setvoid
testSkipped(ReportEntry reportEntry)
Event fired when a test is skippedvoid
testStarting(ReportEntry report)
Event fired when a test is about to startvoid
testSucceeded(ReportEntry reportEntry)
Event fired when a test ended successfullyprivate static java.lang.String
trimTrailingNewLine(java.lang.String message)
void
warning(java.lang.String message)
private WrappedReportEntry
wrap(ReportEntry other, ReportEntryType reportEntryType)
private WrappedReportEntry
wrapTestSet(TestSetReportEntry other)
void
writeTestOutput(java.lang.String output, boolean newLine, boolean stdout)
Forwards process output from the running test-case into the reporting system
-
-
-
Field Detail
-
testMethodStats
private final java.util.Queue<TestMethodStats> testMethodStats
-
detailsForThis
private final TestSetStats detailsForThis
-
consoleOutputReceiver
private final ConsoleOutputReportEventListener consoleOutputReceiver
-
briefOrPlainFormat
private final boolean briefOrPlainFormat
-
simpleXMLReporter
private final StatelessReportEventListener<WrappedReportEntry,TestSetStats> simpleXMLReporter
-
consoleReporter
private final StatelessTestsetInfoConsoleReportEventListener<WrappedReportEntry,TestSetStats> consoleReporter
-
fileReporter
private final StatelessTestsetInfoFileReportEventListener<WrappedReportEntry,TestSetStats> fileReporter
-
statisticsReporter
private final StatisticsReporter statisticsReporter
-
testStdOut
private Utf8RecodingDeferredFileOutputStream testStdOut
-
testStdErr
private Utf8RecodingDeferredFileOutputStream testStdErr
-
runMode
private volatile RunMode runMode
-
-
Constructor Detail
-
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 Detail
-
isDebugEnabled
public boolean isDebugEnabled()
- Specified by:
isDebugEnabled
in interfaceConsoleLogger
-
debug
public void debug(java.lang.String message)
- Specified by:
debug
in interfaceConsoleLogger
-
isInfoEnabled
public boolean isInfoEnabled()
- Specified by:
isInfoEnabled
in interfaceConsoleLogger
-
info
public void info(java.lang.String message)
- Specified by:
info
in interfaceConsoleLogger
-
isWarnEnabled
public boolean isWarnEnabled()
- Specified by:
isWarnEnabled
in interfaceConsoleLogger
-
warning
public void warning(java.lang.String message)
- Specified by:
warning
in interfaceConsoleLogger
-
isErrorEnabled
public boolean isErrorEnabled()
- Specified by:
isErrorEnabled
in interfaceConsoleLogger
-
error
public void error(java.lang.String message)
- Specified by:
error
in interfaceConsoleLogger
- Parameters:
message
- message to log
-
error
public void error(java.lang.String message, java.lang.Throwable t)
Description copied from interface:ConsoleLogger
Simply delegates toerror( toString( t, message ) )
.- Specified by:
error
in interfaceConsoleLogger
- Parameters:
message
- message to logt
- exception, message and trace to log
-
error
public void error(java.lang.Throwable t)
Description copied from interface:ConsoleLogger
Simply delegates to methoderror(null, Throwable)
.- Specified by:
error
in interfaceConsoleLogger
- Parameters:
t
- exception, message and trace to log
-
writeTestOutput
public void writeTestOutput(java.lang.String output, boolean newLine, boolean stdout)
Description copied from interface:ConsoleOutputReceiver
Forwards process output from the running test-case into the reporting system- Specified by:
writeTestOutput
in interfaceConsoleOutputReceiver
- Parameters:
output
- stdout/sterr output from running testsnewLine
- print on new linestdout
- Indicates if this is stdout
-
testSetStarting
public void testSetStarting(TestSetReportEntry report)
Description copied from interface:RunListener
Indicates the start of a given test-set- Specified by:
testSetStarting
in interfaceRunListener
- Parameters:
report
- the report entry describing the testset
-
clearCapture
private void clearCapture()
-
testSetCompleted
public void testSetCompleted(TestSetReportEntry report)
Description copied from interface:RunListener
Indicates end of a given test-set- Specified by:
testSetCompleted
in interfaceRunListener
- Parameters:
report
- the report entry describing the testset
-
testStarting
public void testStarting(ReportEntry report)
Description copied from interface:RunListener
Event fired when a test is about to start- Specified by:
testStarting
in interfaceRunListener
- Parameters:
report
- The report entry to log for
-
testSucceeded
public void testSucceeded(ReportEntry reportEntry)
Description copied from interface:RunListener
Event fired when a test ended successfully- Specified by:
testSucceeded
in interfaceRunListener
- Parameters:
reportEntry
- The report entry to log for
-
testError
public void testError(ReportEntry reportEntry)
Description copied from interface:RunListener
Event fired when a test ended with an error (non anticipated problem)- Specified by:
testError
in interfaceRunListener
- Parameters:
reportEntry
- The report entry to log for
-
testFailed
public void testFailed(ReportEntry reportEntry)
Description copied from interface:RunListener
Event fired when a test ended with a failure (anticipated problem)- Specified by:
testFailed
in interfaceRunListener
- Parameters:
reportEntry
- The report entry to log for
-
testSkipped
public void testSkipped(ReportEntry reportEntry)
Description copied from interface:RunListener
Event fired when a test is skipped- Specified by:
testSkipped
in interfaceRunListener
- Parameters:
reportEntry
- The report entry to log for
-
testExecutionSkippedByUser
public void testExecutionSkippedByUser()
Description copied from interface:RunListener
Event 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:
testExecutionSkippedByUser
in interfaceRunListener
-
markAs
public RunMode markAs(RunMode currentRunMode)
Description copied from interface:RunListener
Marks the listener with run mode, e.g. normal run or re-run.- Specified by:
markAs
in interfaceRunListener
- Parameters:
currentRunMode
- set current run- Returns:
- previous run mode; never returns null
-
testAssumptionFailure
public void testAssumptionFailure(ReportEntry report)
Description copied from interface:RunListener
Event fired when a test assumption failure was encountered. An assumption failure indicates that the test is not relevant- Specified by:
testAssumptionFailure
in interfaceRunListener
- Parameters:
report
- The report entry to log for
-
wrap
private WrappedReportEntry wrap(ReportEntry other, ReportEntryType reportEntryType)
-
wrapTestSet
private WrappedReportEntry wrapTestSet(TestSetReportEntry other)
-
close
public void close()
-
addTestMethodStats
private void addTestMethodStats()
-
getTestMethodStats
public java.util.Queue<TestMethodStats> getTestMethodStats()
-
trimTrailingNewLine
private static java.lang.String trimTrailingNewLine(java.lang.String message)
-
lineBoundSymbolWidth
private static int lineBoundSymbolWidth(java.lang.String message)
-
initDeferred
private static Utf8RecodingDeferredFileOutputStream initDeferred(java.lang.String channel)
-
-