Class JUnit4RunListener
java.lang.Object
org.junit.runner.notification.RunListener
org.apache.maven.surefire.common.junit4.JUnit4RunListener
- All Implemented Interfaces:
org.apache.maven.surefire.api.report.TestOutputReceiver<org.apache.maven.surefire.api.report.OutputReportEntry>
,org.apache.maven.surefire.report.RunModeSetter
public class JUnit4RunListener
extends org.junit.runner.notification.RunListener
implements org.apache.maven.surefire.api.report.TestOutputReceiver<org.apache.maven.surefire.api.report.OutputReportEntry>, org.apache.maven.surefire.report.RunModeSetter
RunListener for JUnit4, delegates to our own RunListener
-
Nested Class Summary
Nested classes/interfaces inherited from class org.junit.runner.notification.RunListener
org.junit.runner.notification.RunListener.ThreadSafe
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.maven.surefire.report.ClassMethodIndexer
protected final org.apache.maven.surefire.api.report.TestReportListener
<org.apache.maven.surefire.api.report.TestOutputReportEntry> -
Constructor Summary
ConstructorsConstructorDescriptionJUnit4RunListener
(org.apache.maven.surefire.api.report.TestReportListener<org.apache.maven.surefire.api.report.TestOutputReportEntry> reporter) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.maven.surefire.api.report.SimpleReportEntry
createReportEntry
(org.junit.runner.Description description) protected org.apache.maven.surefire.api.report.StackTraceWriter
createStackTraceWriter
(org.junit.runner.notification.Failure failure) final org.apache.maven.plugin.surefire.log.api.ConsoleLogger
protected final org.apache.maven.surefire.api.report.RunMode
static void
rethrowAnyTestMechanismFailures
(org.junit.runner.Result run) void
setRunMode
(org.apache.maven.surefire.api.report.RunMode runMode) void
testAssumptionFailure
(org.junit.runner.notification.Failure failure) void
Delegates toRunListener.testExecutionSkippedByUser()
.void
testFailure
(org.junit.runner.notification.Failure failure) Called when a specific test has failed.void
testFinished
(org.junit.runner.Description description) Called after a specific test has finished.void
testIgnored
(org.junit.runner.Description description) Called when a specific test has been skipped (for whatever reason).void
testStarted
(org.junit.runner.Description description) Called when a specific test has started.void
writeTestOutput
(org.apache.maven.surefire.api.report.OutputReportEntry reportEntry) Methods inherited from class org.junit.runner.notification.RunListener
testRunFinished, testRunStarted, testSuiteFinished, testSuiteStarted
-
Field Details
-
classMethodIndexer
protected final org.apache.maven.surefire.report.ClassMethodIndexer classMethodIndexer -
reporter
protected final org.apache.maven.surefire.api.report.TestReportListener<org.apache.maven.surefire.api.report.TestOutputReportEntry> reporter
-
-
Constructor Details
-
JUnit4RunListener
public JUnit4RunListener(org.apache.maven.surefire.api.report.TestReportListener<org.apache.maven.surefire.api.report.TestOutputReportEntry> reporter) Constructor.- Parameters:
reporter
- the reporter to log testing events to
-
-
Method Details
-
getConsoleLogger
public final org.apache.maven.plugin.surefire.log.api.ConsoleLogger getConsoleLogger() -
setRunMode
public void setRunMode(org.apache.maven.surefire.api.report.RunMode runMode) - Specified by:
setRunMode
in interfaceorg.apache.maven.surefire.report.RunModeSetter
-
getRunMode
protected final org.apache.maven.surefire.api.report.RunMode getRunMode() -
testIgnored
Called when a specific test has been skipped (for whatever reason).- Overrides:
testIgnored
in classorg.junit.runner.notification.RunListener
- Throws:
Exception
- See Also:
-
testStarted
Called when a specific test has started.- Overrides:
testStarted
in classorg.junit.runner.notification.RunListener
- Throws:
Exception
- See Also:
-
testFailure
Called when a specific test has failed.- Overrides:
testFailure
in classorg.junit.runner.notification.RunListener
- Throws:
Exception
- See Also:
-
testAssumptionFailure
public void testAssumptionFailure(org.junit.runner.notification.Failure failure) - Overrides:
testAssumptionFailure
in classorg.junit.runner.notification.RunListener
-
testFinished
Called after a specific test has finished.- Overrides:
testFinished
in classorg.junit.runner.notification.RunListener
- Throws:
Exception
- See Also:
-
testExecutionSkippedByUser
public void testExecutionSkippedByUser()Delegates toRunListener.testExecutionSkippedByUser()
. -
createStackTraceWriter
protected org.apache.maven.surefire.api.report.StackTraceWriter createStackTraceWriter(org.junit.runner.notification.Failure failure) -
createReportEntry
protected org.apache.maven.surefire.api.report.SimpleReportEntry createReportEntry(org.junit.runner.Description description) -
rethrowAnyTestMechanismFailures
public static void rethrowAnyTestMechanismFailures(org.junit.runner.Result run) throws org.apache.maven.surefire.api.testset.TestSetFailedException - Throws:
org.apache.maven.surefire.api.testset.TestSetFailedException
-
writeTestOutput
public void writeTestOutput(org.apache.maven.surefire.api.report.OutputReportEntry reportEntry) - Specified by:
writeTestOutput
in interfaceorg.apache.maven.surefire.api.report.TestOutputReceiver<org.apache.maven.surefire.api.report.OutputReportEntry>
-