Class NonConcurrentRunListener
java.lang.Object
org.junit.runner.notification.RunListener
org.apache.maven.surefire.common.junit4.JUnit4RunListener
org.apache.maven.surefire.junitcore.NonConcurrentRunListener
- All Implemented Interfaces:
ConsoleOutputReceiver
A class to be used when there is no JUnit parallelism (methods or/and class). This allow to workaround JUnit
limitation a la Junit4 provider. Specifically, we can redirect properly the output even if we don't have class
demarcation in JUnit. It works when if there is a JVM instance per test run, i.e. with forkMode=always or perthread.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.junit.runner.notification.RunListener
org.junit.runner.notification.RunListener.ThreadSafe -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.junit.runner.Descriptionprivate org.junit.runner.DescriptionFields inherited from class org.apache.maven.surefire.common.junit4.JUnit4RunListener
reporter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SimpleReportEntrycreateReportEntry(org.junit.runner.Description description) private TestSetReportEntrycreateReportEntryForTestSet(org.junit.runner.Description description, Map<String, String> systemProps) private TestSetReportEntrycreateTestSetReportEntryFinished(org.junit.runner.Description description) private TestSetReportEntrycreateTestSetReportEntryStarted(org.junit.runner.Description description) private booleandescribesNewTestSet(org.junit.runner.Description description) private voidfinishLastTestSetIfNecessary(org.junit.runner.Description description) voidtestAssumptionFailure(org.junit.runner.notification.Failure failure) voidtestFailure(org.junit.runner.notification.Failure failure) Called when a specific test has failed.voidtestFinished(org.junit.runner.Description description) Called after a specific test has finished.voidtestIgnored(org.junit.runner.Description description) Called when a specific test has been skipped (for whatever reason).voidtestRunFinished(org.junit.runner.Result result) voidtestRunStarted(org.junit.runner.Description description) voidtestStarted(org.junit.runner.Description description) Called when a specific test has started.voidwriteTestOutput(String output, boolean newLine, boolean stdout) Forwards process output from the running test-case into the reporting systemMethods inherited from class org.apache.maven.surefire.common.junit4.JUnit4RunListener
createStackTraceWriter, rethrowAnyTestMechanismFailures, testExecutionSkippedByUserMethods inherited from class org.junit.runner.notification.RunListener
testSuiteFinished, testSuiteStarted
-
Field Details
-
currentTestSetDescription
private org.junit.runner.Description currentTestSetDescription -
lastFinishedDescription
private org.junit.runner.Description lastFinishedDescription
-
-
Constructor Details
-
NonConcurrentRunListener
- Throws:
TestSetFailedException
-
-
Method Details
-
writeTestOutput
Description copied from interface:ConsoleOutputReceiverForwards process output from the running test-case into the reporting system- Specified by:
writeTestOutputin interfaceConsoleOutputReceiver- Parameters:
output- stdout/sterr output from running testsnewLine- print on new linestdout- Indicates if this is stdout
-
createReportEntry
- Overrides:
createReportEntryin classJUnit4RunListener
-
createReportEntryForTestSet
private TestSetReportEntry createReportEntryForTestSet(org.junit.runner.Description description, Map<String, String> systemProps) -
createTestSetReportEntryStarted
private TestSetReportEntry createTestSetReportEntryStarted(org.junit.runner.Description description) -
createTestSetReportEntryFinished
private TestSetReportEntry createTestSetReportEntryFinished(org.junit.runner.Description description) -
testStarted
Description copied from class:JUnit4RunListenerCalled when a specific test has started.- Overrides:
testStartedin classJUnit4RunListener- Throws:
Exception- See Also:
-
RunListener.testStarted(org.junit.runner.Description)
-
finishLastTestSetIfNecessary
private void finishLastTestSetIfNecessary(org.junit.runner.Description description) -
describesNewTestSet
private boolean describesNewTestSet(org.junit.runner.Description description) -
testFinished
Description copied from class:JUnit4RunListenerCalled after a specific test has finished.- Overrides:
testFinishedin classJUnit4RunListener- Throws:
Exception- See Also:
-
RunListener.testFinished(org.junit.runner.Description)
-
testIgnored
Description copied from class:JUnit4RunListenerCalled when a specific test has been skipped (for whatever reason).- Overrides:
testIgnoredin classJUnit4RunListener- Throws:
Exception- See Also:
-
RunListener.testIgnored(org.junit.runner.Description)
-
testFailure
Description copied from class:JUnit4RunListenerCalled when a specific test has failed.- Overrides:
testFailurein classJUnit4RunListener- Throws:
Exception- See Also:
-
RunListener.testFailure(org.junit.runner.notification.Failure)
-
testAssumptionFailure
public void testAssumptionFailure(org.junit.runner.notification.Failure failure) - Overrides:
testAssumptionFailurein classJUnit4RunListener
-
testRunStarted
- Overrides:
testRunStartedin classorg.junit.runner.notification.RunListener- Throws:
Exception
-
testRunFinished
- Overrides:
testRunFinishedin classorg.junit.runner.notification.RunListener- Throws:
Exception
-