public class JUnit4RunListener
extends org.junit.runner.notification.RunListener
Modifier and Type | Field and Description |
---|---|
private java.lang.ThreadLocal<java.lang.Boolean> |
failureFlag
This flag is set after a failure has occurred so that a
RunListener.testSucceeded(org.apache.maven.surefire.report.ReportEntry) event is not fired. |
protected RunListener |
reporter |
Constructor and Description |
---|
JUnit4RunListener(RunListener reporter)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected SimpleReportEntry |
createReportEntry(org.junit.runner.Description description) |
protected StackTraceWriter |
createStackTraceWriter(org.junit.runner.notification.Failure failure) |
protected java.lang.String |
extractDescriptionClassName(org.junit.runner.Description description) |
protected java.lang.String |
extractDescriptionMethodName(org.junit.runner.Description description) |
private java.lang.String |
getClassName(org.junit.runner.Description description) |
private static boolean |
isInsaneJunitNullString(java.lang.String value) |
static void |
rethrowAnyTestMechanismFailures(org.junit.runner.Result run) |
void |
testAssumptionFailure(org.junit.runner.notification.Failure failure) |
void |
testExecutionSkippedByUser()
Delegates to
RunListener.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.
|
protected final RunListener reporter
private final java.lang.ThreadLocal<java.lang.Boolean> failureFlag
RunListener.testSucceeded(org.apache.maven.surefire.report.ReportEntry)
event is not fired.
This is necessary because JUnit4 always fires a RunListener.testRunFinished(org.junit.runner.Result)
event-- even if there was a failure.public JUnit4RunListener(RunListener reporter)
reporter
- the reporter to log testing events topublic void testIgnored(org.junit.runner.Description description) throws java.lang.Exception
testIgnored
in class org.junit.runner.notification.RunListener
java.lang.Exception
RunListener.testIgnored(org.junit.runner.Description)
public void testStarted(org.junit.runner.Description description) throws java.lang.Exception
testStarted
in class org.junit.runner.notification.RunListener
java.lang.Exception
RunListener.testStarted(org.junit.runner.Description)
public void testFailure(org.junit.runner.notification.Failure failure) throws java.lang.Exception
testFailure
in class org.junit.runner.notification.RunListener
java.lang.Exception
RunListener.testFailure(org.junit.runner.notification.Failure)
public void testAssumptionFailure(org.junit.runner.notification.Failure failure)
testAssumptionFailure
in class org.junit.runner.notification.RunListener
public void testFinished(org.junit.runner.Description description) throws java.lang.Exception
testFinished
in class org.junit.runner.notification.RunListener
java.lang.Exception
RunListener.testFinished(org.junit.runner.Description)
public void testExecutionSkippedByUser()
RunListener.testExecutionSkippedByUser()
.private java.lang.String getClassName(org.junit.runner.Description description)
protected StackTraceWriter createStackTraceWriter(org.junit.runner.notification.Failure failure)
protected SimpleReportEntry createReportEntry(org.junit.runner.Description description)
protected java.lang.String extractDescriptionClassName(org.junit.runner.Description description)
protected java.lang.String extractDescriptionMethodName(org.junit.runner.Description description)
public static void rethrowAnyTestMechanismFailures(org.junit.runner.Result run) throws TestSetFailedException
TestSetFailedException
private static boolean isInsaneJunitNullString(java.lang.String value)