@API(status=STABLE,
since="1.0")
public final class TestIdentifier
extends java.lang.Object
implements java.io.Serializable
TestPlan.TestPlan,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
private static class |
TestIdentifier.SerializedForm
Represents the serialized output of
TestIdentifier. |
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
displayName |
private java.lang.String |
legacyReportingName |
private UniqueId |
parentId |
private static java.io.ObjectStreamField[] |
serialPersistentFields |
private static long |
serialVersionUID |
private TestSource |
source |
private java.util.Set<TestTag> |
tags |
private TestDescriptor.Type |
type |
private UniqueId |
uniqueId |
| Modifier | Constructor and Description |
|---|---|
private |
TestIdentifier(UniqueId uniqueId,
java.lang.String displayName,
TestSource source,
java.util.Set<TestTag> tags,
TestDescriptor.Type type,
UniqueId parentId,
java.lang.String legacyReportingName) |
| Modifier and Type | Method and Description |
|---|---|
private java.util.Set<TestTag> |
copyOf(java.util.Set<TestTag> tags) |
boolean |
equals(java.lang.Object obj) |
static TestIdentifier |
from(TestDescriptor testDescriptor)
Factory for creating a new
TestIdentifier from a TestDescriptor. |
java.lang.String |
getDisplayName()
Get the display name of the represented test or container.
|
java.lang.String |
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.
|
java.util.Optional<java.lang.String> |
getParentId()
Get the unique ID of this identifier's parent as a
String, if
available. |
java.util.Optional<UniqueId> |
getParentIdObject()
Get the unique ID of this identifier's parent as a
UniqueId, if
available. |
java.util.Optional<TestSource> |
getSource()
Get the source of the represented test
or container, if available.
|
java.util.Set<TestTag> |
getTags()
Get the set of tags associated with the represented
test or container.
|
TestDescriptor.Type |
getType()
Get the underlying descriptor type.
|
java.lang.String |
getUniqueId()
Get the unique ID of the represented test or container as a
String. |
UniqueId |
getUniqueIdObject()
Get the unique ID of the represented test or container as a
UniqueId. |
int |
hashCode() |
boolean |
isContainer()
Determine if this identifier represents a container.
|
boolean |
isTest()
Determine if this identifier represents a test.
|
private void |
readObject(java.io.ObjectInputStream s) |
java.lang.String |
toString() |
private void |
writeObject(java.io.ObjectOutputStream s) |
private static final long serialVersionUID
private static final java.io.ObjectStreamField[] serialPersistentFields
private UniqueId uniqueId
private UniqueId parentId
private java.lang.String displayName
private java.lang.String legacyReportingName
private TestSource source
private java.util.Set<TestTag> tags
private TestDescriptor.Type type
private TestIdentifier(UniqueId uniqueId, java.lang.String displayName, TestSource source, java.util.Set<TestTag> tags, TestDescriptor.Type type, UniqueId parentId, java.lang.String legacyReportingName)
@API(status=INTERNAL,
since="1.0")
public static TestIdentifier from(TestDescriptor testDescriptor)
TestIdentifier from a TestDescriptor.public java.lang.String getUniqueId()
String.
Uniqueness must be guaranteed across an entire test plan, regardless of how many engines are used behind the scenes.
null@API(status=STABLE,
since="5.8")
public UniqueId getUniqueIdObject()
UniqueId.
Uniqueness must be guaranteed across an entire test plan, regardless of how many engines are used behind the scenes.
nullpublic java.util.Optional<java.lang.String> getParentId()
String, if
available.
An identifier without a parent is called a root.
null though potentially empty@API(status=STABLE,
since="5.8")
public java.util.Optional<UniqueId> getParentIdObject()
UniqueId, if
available.
An identifier without a parent is called a root.
null though potentially emptypublic java.lang.String getDisplayName()
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.
null or blankgetSource(),
TestDescriptor.getDisplayName()public java.lang.String getLegacyReportingName()
The default implementation delegates to getDisplayName().
null or blankTestDescriptor.getLegacyReportingName(),
org.junit.platform.reporting.legacy.LegacyReportingUtilspublic TestDescriptor.Type getType()
nullpublic boolean isTest()
true if the underlying descriptor type represents a test,
false otherwiseTestDescriptor.Type.isTest()public boolean isContainer()
true if the underlying descriptor type represents a container,
false otherwiseTestDescriptor.Type.isContainer()public java.util.Optional<TestSource> getSource()
TestSourcepublic java.util.Set<TestTag> getTags()
TestTagpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectprivate void writeObject(java.io.ObjectOutputStream s)
throws java.io.IOException
java.io.IOExceptionprivate void readObject(java.io.ObjectInputStream s)
throws java.lang.ClassNotFoundException,
java.io.IOException
java.lang.ClassNotFoundExceptionjava.io.IOException