- All Implemented Interfaces:
Serializable
TestPlan
.- Since:
- 1.0
- See Also:
TestPlan
, Serialized Form
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static TestIdentifier
from(TestDescriptor testDescriptor)
Factory for creating a newTestIdentifier
from aTestDescriptor
.Get the display name of the represented test or container.Get the name of this identifier in a format that is suitable for legacy reporting infrastructure — for example, for reporting systems built on the Ant-based XML reporting format for JUnit 4.Get the unique ID of this identifier's parent as aString
, if available.Get the unique ID of this identifier's parent as aUniqueId
, if available.Get the source of the represented test or container, if available.getTags()
Get the set of tags associated with the represented test or container.getType()
Get the underlying descriptor type.Get the unique ID of the represented test or container as aString
.Get the unique ID of the represented test or container as aUniqueId
.int
hashCode()
boolean
Determine if this identifier represents a container.boolean
isTest()
Determine if this identifier represents a test.toString()
-
Method Details
-
from
@API(status=INTERNAL, since="1.0") public static TestIdentifier from(TestDescriptor testDescriptor)Factory for creating a newTestIdentifier
from aTestDescriptor
. -
getUniqueId
Get the unique ID of the represented test or container as aString
.Uniqueness must be guaranteed across an entire test plan, regardless of how many engines are used behind the scenes.
- Returns:
- the unique ID for this identifier; never
null
-
getUniqueIdObject
Get the unique ID of the represented test or container as aUniqueId
.Uniqueness must be guaranteed across an entire test plan, regardless of how many engines are used behind the scenes.
- Returns:
- the unique ID for this identifier; never
null
- Since:
- 5.8
-
getParentId
Get the unique ID of this identifier's parent as aString
, if available.An identifier without a parent is called a root.
- Returns:
- a container for the unique ID for this identifier's parent;
never
null
though potentially empty
-
getParentIdObject
Get the unique ID of this identifier's parent as aUniqueId
, if available.An identifier without a parent is called a root.
- Returns:
- a container for the unique ID for this identifier's parent;
never
null
though potentially empty - Since:
- 5.8
-
getDisplayName
Get the display name of the represented test or container.A display name is a human-readable name for a test or container that is typically used for test reporting in IDEs and build tools. Display names may contain spaces, special characters, and emoji, and the format may be customized by
TestEngines
or potentially by end users as well. Consequently, display names should never be parsed; rather, they should be used for display purposes only.- Returns:
- the display name for this identifier; never
null
or blank - See Also:
getSource()
,TestDescriptor.getDisplayName()
-
getLegacyReportingName
Get the name of this identifier in a format that is suitable for legacy reporting infrastructure — for example, for reporting systems built on the Ant-based XML reporting format for JUnit 4.The default implementation delegates to
getDisplayName()
.- Returns:
- the legacy reporting name; never
null
or blank - See Also:
TestDescriptor.getLegacyReportingName()
,LegacyReportingUtils
-
getType
Get the underlying descriptor type.- Returns:
- the underlying descriptor type; never
null
-
isTest
public boolean isTest()Determine if this identifier represents a test.- Returns:
true
if the underlying descriptor type represents a test,false
otherwise- See Also:
TestDescriptor.Type.isTest()
-
isContainer
public boolean isContainer()Determine if this identifier represents a container.- Returns:
true
if the underlying descriptor type represents a container,false
otherwise- See Also:
TestDescriptor.Type.isContainer()
-
getSource
Get the source of the represented test or container, if available.- See Also:
TestSource
-
getTags
Get the set of tags associated with the represented test or container.- See Also:
TestTag
-
equals
-
hashCode
public int hashCode() -
toString
-