Class RunListenerAdapter
java.lang.Object
org.apache.maven.surefire.junitplatform.RunListenerAdapter
- All Implemented Interfaces:
TestOutputReceiver<OutputReportEntry>,RunModeSetter,org.junit.platform.launcher.TestExecutionListener
final class RunListenerAdapter
extends Object
implements org.junit.platform.launcher.TestExecutionListener, TestOutputReceiver<OutputReportEntry>, RunModeSetter
- Since:
- 2.22.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClassMethodIndexerprivate static final Patternprivate final ConcurrentMap<org.junit.platform.launcher.TestIdentifier,org.junit.platform.engine.TestExecutionResult> private final TestReportListener<TestOutputReportEntry>private RunModeprivate final ConcurrentMap<String,org.junit.platform.launcher.TestIdentifier> private org.junit.platform.launcher.TestPlanprivate final ConcurrentMap<org.junit.platform.launcher.TestIdentifier,Long> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Stream<org.junit.platform.launcher.TestIdentifier>collectAllTestIdentifiersInHierarchy(org.junit.platform.launcher.TestIdentifier testIdentifier) private IntegercomputeElapsedTime(org.junit.platform.launcher.TestIdentifier testIdentifier) private SimpleReportEntrycreateReportEntry(org.junit.platform.launcher.TestIdentifier testIdentifier) private SimpleReportEntrycreateReportEntry(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult, Integer elapsedTime) private SimpleReportEntrycreateReportEntry(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult, String reason, Integer elapsedTime) private SimpleReportEntrycreateReportEntry(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult, Map<String, String> systemProperties, String reason, Integer elapsedTime) voidexecutionFinished(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult) voidexecutionSkipped(org.junit.platform.launcher.TestIdentifier testIdentifier, String reason) voidexecutionStarted(org.junit.platform.launcher.TestIdentifier testIdentifier) (package private) Map<org.junit.platform.launcher.TestIdentifier,org.junit.platform.engine.TestExecutionResult> (package private) boolean(package private) voidreset()private StringsafeGetMessage(Throwable throwable) voidsetRunMode(RunMode runMode) voidtestPlanExecutionFinished(org.junit.platform.launcher.TestPlan testPlan) voidtestPlanExecutionStarted(org.junit.platform.launcher.TestPlan testPlan) private String[]toClassMethodName(org.junit.platform.launcher.TestIdentifier testIdentifier) [0] class name - used in stacktrace parser [1] class display name [2] method signature - used in stacktrace parser [3] method display nameprivate StackTraceWritertoStackTraceWriter(String realClassName, String realMethodName, Throwable throwable) private StackTraceWritertoStackTraceWriter(String realClassName, String realMethodName, org.junit.platform.engine.TestExecutionResult testExecutionResult) voidwriteTestOutput(OutputReportEntry reportEntry) Forwards process output from the running test-case into the reporting systemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.junit.platform.launcher.TestExecutionListener
dynamicTestRegistered, reportingEntryPublished
-
Field Details
-
COMMA_PATTERN
-
classMethodIndexer
-
testStartTime
-
failures
private final ConcurrentMap<org.junit.platform.launcher.TestIdentifier,org.junit.platform.engine.TestExecutionResult> failures -
runningTestIdentifiersByUniqueId
private final ConcurrentMap<String,org.junit.platform.launcher.TestIdentifier> runningTestIdentifiersByUniqueId -
runListener
-
testPlan
private volatile org.junit.platform.launcher.TestPlan testPlan -
runMode
-
-
Constructor Details
-
RunListenerAdapter
RunListenerAdapter(TestReportListener<TestOutputReportEntry> runListener)
-
-
Method Details
-
setRunMode
- Specified by:
setRunModein interfaceRunModeSetter
-
testPlanExecutionStarted
public void testPlanExecutionStarted(org.junit.platform.launcher.TestPlan testPlan) - Specified by:
testPlanExecutionStartedin interfaceorg.junit.platform.launcher.TestExecutionListener
-
testPlanExecutionFinished
public void testPlanExecutionFinished(org.junit.platform.launcher.TestPlan testPlan) - Specified by:
testPlanExecutionFinishedin interfaceorg.junit.platform.launcher.TestExecutionListener
-
executionStarted
public void executionStarted(org.junit.platform.launcher.TestIdentifier testIdentifier) - Specified by:
executionStartedin interfaceorg.junit.platform.launcher.TestExecutionListener
-
executionFinished
public void executionFinished(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult) - Specified by:
executionFinishedin interfaceorg.junit.platform.launcher.TestExecutionListener
-
computeElapsedTime
-
collectAllTestIdentifiersInHierarchy
private Stream<org.junit.platform.launcher.TestIdentifier> collectAllTestIdentifiersInHierarchy(org.junit.platform.launcher.TestIdentifier testIdentifier) -
safeGetMessage
-
executionSkipped
public void executionSkipped(org.junit.platform.launcher.TestIdentifier testIdentifier, String reason) - Specified by:
executionSkippedin interfaceorg.junit.platform.launcher.TestExecutionListener
-
createReportEntry
-
createReportEntry
private SimpleReportEntry createReportEntry(org.junit.platform.launcher.TestIdentifier testIdentifier) -
createReportEntry
private SimpleReportEntry createReportEntry(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult, Integer elapsedTime) -
createReportEntry
private SimpleReportEntry createReportEntry(org.junit.platform.launcher.TestIdentifier testIdentifier, org.junit.platform.engine.TestExecutionResult testExecutionResult, String reason, Integer elapsedTime) -
toStackTraceWriter
private StackTraceWriter toStackTraceWriter(String realClassName, String realMethodName, org.junit.platform.engine.TestExecutionResult testExecutionResult) -
toStackTraceWriter
private StackTraceWriter toStackTraceWriter(String realClassName, String realMethodName, Throwable throwable) -
toClassMethodName
- [0] class name - used in stacktrace parser
- [1] class display name
- [2] method signature - used in stacktrace parser
- [3] method display name
- Parameters:
testIdentifier- a class or method- Returns:
- 4 elements string array
-
getFailures
Map<org.junit.platform.launcher.TestIdentifier,org.junit.platform.engine.TestExecutionResult> getFailures()- Returns:
- Map of tests that failed.
-
hasFailingTests
boolean hasFailingTests() -
reset
void reset() -
writeTestOutput
Description copied from interface:TestOutputReceiverForwards process output from the running test-case into the reporting system- Specified by:
writeTestOutputin interfaceTestOutputReceiver<OutputReportEntry>- Parameters:
reportEntry- wraps test output with descriptive information of the output
-