Class ForkingRunListener
- java.lang.Object
-
- org.apache.maven.surefire.api.booter.ForkingRunListener
-
- All Implemented Interfaces:
org.apache.maven.plugin.surefire.log.api.ConsoleLogger,RunListener,TestOutputReceiver<TestOutputReportEntry>,TestReportListener<TestOutputReportEntry>
public class ForkingRunListener extends java.lang.Object implements TestReportListener<TestOutputReportEntry>
Encodes the full output of the test run to the "target".
This class and the ForkClient contain the full definition of the "wire-level" protocol used by the forked process. The protocol is *not* part of any public api and may change without further notice.
This class is thread-safe.
The synchronization in the underlying (target instance) is used to preserve thread safety of the target stream. To perform multiple writes/prints for a single request, they must synchronize on "target" variable in this class.- Author:
- Kristian Rosenvold
-
-
Constructor Summary
Constructors Constructor Description ForkingRunListener(MasterProcessChannelEncoder target, boolean trim)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebug(java.lang.String message)voiderror(java.lang.String message)voiderror(java.lang.String message, java.lang.Throwable t)voiderror(java.lang.Throwable t)voidinfo(java.lang.String message)booleanisDebugEnabled()booleanisErrorEnabled()booleanisInfoEnabled()booleanisWarnEnabled()voidtestAssumptionFailure(ReportEntry report)Event fired when a test assumption failure was encountered.voidtestError(ReportEntry report)Event fired when a test ended with an error (non anticipated problem)voidtestExecutionSkippedByUser()Event fired skipping an execution of remaining test-set in other fork(s); or does nothing if no forks.voidtestFailed(ReportEntry report)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 report)Event fired when a test is skippedvoidtestStarting(ReportEntry report)Event fired when a test is about to startvoidtestSucceeded(ReportEntry report)Event fired when a test ended successfullyvoidwarning(java.lang.String message)voidwriteTestOutput(TestOutputReportEntry reportEntry)Forwards process output from the running test-case into the reporting system
-
-
-
Constructor Detail
-
ForkingRunListener
public ForkingRunListener(MasterProcessChannelEncoder target, boolean trim)
-
-
Method Detail
-
testSetStarting
public void testSetStarting(TestSetReportEntry report)
Description copied from interface:RunListenerIndicates the start of a given test-set- Specified by:
testSetStartingin interfaceRunListener- Parameters:
report- the report entry describing the testset
-
testSetCompleted
public void testSetCompleted(TestSetReportEntry report)
Description copied from interface:RunListenerIndicates end of a given test-set- Specified by:
testSetCompletedin interfaceRunListener- Parameters:
report- the report entry describing the testset
-
testStarting
public void testStarting(ReportEntry report)
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
public void testSucceeded(ReportEntry report)
Description copied from interface:RunListenerEvent fired when a test ended successfully- Specified by:
testSucceededin interfaceRunListener- Parameters:
report- The report entry to log for
-
testAssumptionFailure
public void testAssumptionFailure(ReportEntry report)
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
-
testError
public void testError(ReportEntry report)
Description copied from interface:RunListenerEvent fired when a test ended with an error (non anticipated problem)- Specified by:
testErrorin interfaceRunListener- Parameters:
report- The report entry to log for
-
testFailed
public void testFailed(ReportEntry report)
Description copied from interface:RunListenerEvent fired when a test ended with a failure (anticipated problem)- Specified by:
testFailedin interfaceRunListener- Parameters:
report- The report entry to log for
-
testSkipped
public void testSkipped(ReportEntry report)
Description copied from interface:RunListenerEvent fired when a test is skipped- Specified by:
testSkippedin interfaceRunListener- Parameters:
report- 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
-
writeTestOutput
public void writeTestOutput(TestOutputReportEntry reportEntry)
Description copied from interface:TestOutputReceiverForwards process output from the running test-case into the reporting system- Specified by:
writeTestOutputin interfaceTestOutputReceiver<TestOutputReportEntry>- Parameters:
reportEntry- wraps test output with descriptive information of the output
-
isDebugEnabled
public boolean isDebugEnabled()
- Specified by:
isDebugEnabledin interfaceorg.apache.maven.plugin.surefire.log.api.ConsoleLogger
-
debug
public void debug(java.lang.String message)
- Specified by:
debugin interfaceorg.apache.maven.plugin.surefire.log.api.ConsoleLogger
-
isInfoEnabled
public boolean isInfoEnabled()
- Specified by:
isInfoEnabledin interfaceorg.apache.maven.plugin.surefire.log.api.ConsoleLogger
-
info
public void info(java.lang.String message)
- Specified by:
infoin interfaceorg.apache.maven.plugin.surefire.log.api.ConsoleLogger
-
isWarnEnabled
public boolean isWarnEnabled()
- Specified by:
isWarnEnabledin interfaceorg.apache.maven.plugin.surefire.log.api.ConsoleLogger
-
warning
public void warning(java.lang.String message)
- Specified by:
warningin interfaceorg.apache.maven.plugin.surefire.log.api.ConsoleLogger
-
isErrorEnabled
public boolean isErrorEnabled()
- Specified by:
isErrorEnabledin interfaceorg.apache.maven.plugin.surefire.log.api.ConsoleLogger
-
error
public void error(java.lang.String message)
- Specified by:
errorin interfaceorg.apache.maven.plugin.surefire.log.api.ConsoleLogger
-
error
public void error(java.lang.String message, java.lang.Throwable t)- Specified by:
errorin interfaceorg.apache.maven.plugin.surefire.log.api.ConsoleLogger
-
error
public void error(java.lang.Throwable t)
- Specified by:
errorin interfaceorg.apache.maven.plugin.surefire.log.api.ConsoleLogger
-
-