Class VerboseTreePrintingListener
- java.lang.Object
-
- org.junit.platform.console.output.VerboseTreePrintingListener
-
- All Implemented Interfaces:
DetailsPrintingListener,TestExecutionListener
@API(status=INTERNAL, since="1.14") public class VerboseTreePrintingListener extends java.lang.Object implements DetailsPrintingListener- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private ColorPalettecolorPaletteprivate longexecutionStartedMillisprivate java.util.Deque<java.lang.Long>framesprivate java.io.PrintWriteroutprivate Themethemeprivate java.lang.String[]verticals-
Fields inherited from interface org.junit.platform.console.output.DetailsPrintingListener
LINE_START_PATTERN
-
-
Constructor Summary
Constructors Constructor Description VerboseTreePrintingListener(java.io.PrintWriter out, ColorPalette colorPalette, int maxContainerNestingLevel, Theme theme)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddynamicTestRegistered(TestIdentifier testIdentifier)Called when a new, dynamicTestIdentifierhas been registered.voidexecutionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult)Called when the execution of a leaf or subtree of theTestPlanhas finished, regardless of the outcome.voidexecutionSkipped(TestIdentifier testIdentifier, java.lang.String reason)Called when the execution of a leaf or subtree of theTestPlanhas been skipped.voidexecutionStarted(TestIdentifier testIdentifier)Called when the execution of a leaf or subtree of theTestPlanis about to be started.voidfileEntryPublished(TestIdentifier testIdentifier, FileEntry file)Called when a file or directory has been published for the suppliedTestIdentifier.voidlistTests(TestPlan testPlan)private voidprintDetail(Style style, java.lang.String detail, java.lang.String format, java.lang.Object... args)Print single detail with a potential multi-line message.private voidprintDetails(TestIdentifier testIdentifier)Print static information about the test identifier.private voidprintf(Style style, java.lang.String message, java.lang.Object... args)private voidprintNumberOfTests(TestPlan testPlan, java.lang.String prefix)private voidprintVerticals(java.lang.String tile)voidreportingEntryPublished(TestIdentifier testIdentifier, ReportEntry entry)Called when additional test reporting data has been published for the suppliedTestIdentifier.voidtestPlanExecutionFinished(TestPlan testPlan)Called when the execution of theTestPlanhas finished, after all tests have been executed.voidtestPlanExecutionStarted(TestPlan testPlan)Called when the execution of theTestPlanhas started, before any test has been executed.private java.lang.Stringverticals()private java.lang.Stringverticals(int index)
-
-
-
Field Detail
-
out
private final java.io.PrintWriter out
-
theme
private final Theme theme
-
colorPalette
private final ColorPalette colorPalette
-
frames
private final java.util.Deque<java.lang.Long> frames
-
verticals
private final java.lang.String[] verticals
-
executionStartedMillis
private long executionStartedMillis
-
-
Constructor Detail
-
VerboseTreePrintingListener
public VerboseTreePrintingListener(java.io.PrintWriter out, ColorPalette colorPalette, int maxContainerNestingLevel, Theme theme)
-
-
Method Detail
-
testPlanExecutionStarted
public void testPlanExecutionStarted(TestPlan testPlan)
Description copied from interface:TestExecutionListenerCalled when the execution of theTestPlanhas started, before any test has been executed.Called from the same thread as
TestExecutionListener.testPlanExecutionFinished(TestPlan).- Specified by:
testPlanExecutionStartedin interfaceTestExecutionListener- Parameters:
testPlan- describes the tree of tests about to be executed
-
testPlanExecutionFinished
public void testPlanExecutionFinished(TestPlan testPlan)
Description copied from interface:TestExecutionListenerCalled when the execution of theTestPlanhas finished, after all tests have been executed.Called from the same thread as
TestExecutionListener.testPlanExecutionStarted(TestPlan).- Specified by:
testPlanExecutionFinishedin interfaceTestExecutionListener- Parameters:
testPlan- describes the tree of tests that have been executed
-
printNumberOfTests
private void printNumberOfTests(TestPlan testPlan, java.lang.String prefix)
-
executionStarted
public void executionStarted(TestIdentifier testIdentifier)
Description copied from interface:TestExecutionListenerCalled when the execution of a leaf or subtree of theTestPlanis about to be started.The
TestIdentifiermay represent a test or a container.This method will only be called if the test or container has not been skipped.
This method will be called for a container
TestIdentifierbefore starting or skipping any of its children.- Specified by:
executionStartedin interfaceTestExecutionListener- Parameters:
testIdentifier- the identifier of the started test or container
-
executionFinished
public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult)
Description copied from interface:TestExecutionListenerCalled when the execution of a leaf or subtree of theTestPlanhas finished, regardless of the outcome.The
TestIdentifiermay represent a test or a container.This method will only be called if the test or container has not been skipped.
This method will be called for a container
TestIdentifierafter all of its children have been skipped or have finished.The
TestExecutionResultdescribes the result of the execution for the suppliedTestIdentifier. The result does not include or aggregate the results of its children. For example, a container with a failing test will be reported asSUCCESSFULeven if one or more of its children are reported asFAILED.- Specified by:
executionFinishedin interfaceTestExecutionListener- Parameters:
testIdentifier- the identifier of the finished test or containertestExecutionResult- the (unaggregated) result of the execution for the suppliedTestIdentifier- See Also:
TestExecutionResult
-
executionSkipped
public void executionSkipped(TestIdentifier testIdentifier, java.lang.String reason)
Description copied from interface:TestExecutionListenerCalled when the execution of a leaf or subtree of theTestPlanhas been skipped.The
TestIdentifiermay represent a test or a container. In the case of a container, no listener methods will be called for any of its descendants.A skipped test or subtree of tests will never be reported as started or finished.
- Specified by:
executionSkippedin interfaceTestExecutionListener- Parameters:
testIdentifier- the identifier of the skipped test or containerreason- a human-readable message describing why the execution has been skipped
-
dynamicTestRegistered
public void dynamicTestRegistered(TestIdentifier testIdentifier)
Description copied from interface:TestExecutionListenerCalled when a new, dynamicTestIdentifierhas been registered.A dynamic test is a test that is not known a-priori and therefore not contained in the original
TestPlan.- Specified by:
dynamicTestRegisteredin interfaceTestExecutionListener- Parameters:
testIdentifier- the identifier of the newly registered test or container
-
reportingEntryPublished
public void reportingEntryPublished(TestIdentifier testIdentifier, ReportEntry entry)
Description copied from interface:TestExecutionListenerCalled when additional test reporting data has been published for the suppliedTestIdentifier.Can be called at any time during the execution of a test plan.
- Specified by:
reportingEntryPublishedin interfaceTestExecutionListener- Parameters:
testIdentifier- describes the test or container to which the entry pertainsentry- the publishedReportEntry
-
fileEntryPublished
public void fileEntryPublished(TestIdentifier testIdentifier, FileEntry file)
Description copied from interface:TestExecutionListenerCalled when a file or directory has been published for the suppliedTestIdentifier.Can be called at any time during the execution of a test plan.
- Specified by:
fileEntryPublishedin interfaceTestExecutionListener- Parameters:
testIdentifier- describes the test or container to which the entry pertainsfile- the publishedFileEntry
-
printDetails
private void printDetails(TestIdentifier testIdentifier)
Print static information about the test identifier.
-
verticals
private java.lang.String verticals()
-
verticals
private java.lang.String verticals(int index)
-
printVerticals
private void printVerticals(java.lang.String tile)
-
printf
private void printf(Style style, java.lang.String message, java.lang.Object... args)
-
printDetail
private void printDetail(Style style, java.lang.String detail, java.lang.String format, java.lang.Object... args)
Print single detail with a potential multi-line message.
-
listTests
public void listTests(TestPlan testPlan)
- Specified by:
listTestsin interfaceDetailsPrintingListener
-
-