Top Description Constructors Methods
org.junit.platform.reporting.legacy

public final Class LegacyReportingUtils

extends Object
Class Inheritance
Annotations
@API
status:MAINTAINED
since:1.6
Static Imports
org.apiguardian.api.API.Status.MAINTAINED

Utility methods for dealing with legacy reporting infrastructure, such as reporting systems built on the Ant-based XML reporting format for JUnit 4.

This class was formerly from junit-platform-launcher in the org.junit.platform.launcher.listeners package.

Since
1.0.3

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static String
getClassName(TestPlan
the test plan that contains the TestIdentifier; never null
testPlan
,
TestIdentifier
the identifier to determine the class name for; never null
testIdentifier
)

Get the class name for the supplied TestIdentifier using the supplied TestPlan.

private static @Nullable ClassSource
private static @Nullable TestIdentifier
getParent(TestPlan testPlan, TestIdentifier testIdentifier)

private static String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

LegacyReportingUtilsback to summary
private LegacyReportingUtils()

Method Detail

getClassNameback to summary
public static String getClassName(TestPlan testPlan, TestIdentifier testIdentifier)

Get the class name for the supplied TestIdentifier using the supplied TestPlan.

This implementation attempts to find the closest test identifier with a ClassSource by traversing the hierarchy upwards towards the root starting with the supplied test identifier. In case no such source is found, it falls back to using the parent's legacy reporting name.

Parameters
testPlan:TestPlan

the test plan that contains the TestIdentifier; never null

testIdentifier:TestIdentifier

the identifier to determine the class name for; never null

See Also
TestIdentifier#getLegacyReportingName
getClassSourceback to summary
private static @Nullable ClassSource getClassSource(TestIdentifier current)
getParentback to summary
private static @Nullable TestIdentifier getParent(TestPlan testPlan, TestIdentifier testIdentifier)
getParentLegacyReportingNameback to summary
private static String getParentLegacyReportingName(TestPlan testPlan, TestIdentifier testIdentifier)