Class JUnit4RunListener
java.lang.Object
org.junit.runner.notification.RunListener
org.apache.maven.surefire.common.junit4.JUnit4RunListener
- All Implemented Interfaces:
TestOutputReceiver<OutputReportEntry>
,RunModeSetter
public class JUnit4RunListener
extends org.junit.runner.notification.RunListener
implements TestOutputReceiver<OutputReportEntry>, RunModeSetter
RunListener for JUnit4, delegates to our own RunListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ClassMethodIndexer
protected final TestReportListener
<TestOutputReportEntry> -
Constructor Summary
ConstructorsConstructorDescriptionConstructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected SimpleReportEntry
createReportEntry
(org.junit.runner.Description description) protected StackTraceWriter
createStackTraceWriter
(org.junit.runner.notification.Failure failure) final ConsoleLogger
protected final RunMode
static void
rethrowAnyTestMechanismFailures
(org.junit.runner.Result run) void
setRunMode
(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
(OutputReportEntry reportEntry) Methods inherited from class org.junit.runner.notification.RunListener
testRunFinished, testRunStarted
-
Field Details
-
classMethodIndexer
-
reporter
-
-
Constructor Details
-
JUnit4RunListener
Constructor.- Parameters:
reporter
- the reporter to log testing events to
-
-
Method Details
-
getConsoleLogger
-
setRunMode
- Specified by:
setRunMode
in interfaceRunModeSetter
-
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) -
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
-
createReportEntry
-
rethrowAnyTestMechanismFailures
public static void rethrowAnyTestMechanismFailures(org.junit.runner.Result run) throws TestSetFailedException - Throws:
TestSetFailedException
-
writeTestOutput
- Specified by:
writeTestOutput
in interfaceTestOutputReceiver<OutputReportEntry>
-