TestDescriptor that may be used by
custom TestEngines.
Subclasses should provide a TestSource in their constructor, if
possible, and override getTags(), if appropriate.
| Modifier and Type | Field and Description |
|---|---|
| protected final Set | children
The synchronized set of children associated with this |
| private final String | |
| private @Nullable TestDescriptor | |
| private final @Nullable TestSource | |
| private static final String | UNICODE_REPLACEMENT_CHARACTER
The Unicode replacement character, often displayed as a black diamond with a white question mark in it: |
| private final UniqueId |
| Access | Constructor and Description |
|---|---|
| protected | AbstractTestDescriptor(UniqueId
the unique ID of this uniqueId, String TestDescriptor; never
nullthe display name for this displayName)TestDescriptor;
never null or blankCreate a new |
| protected | AbstractTestDescriptor(UniqueId
the unique ID of this uniqueId, String TestDescriptor; never
nullthe display name for this displayName, @Nullable TestSource TestDescriptor;
never null or blankthe source of the test or container described by this
source)TestDescriptor; can be nullCreate a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | addChild(TestDescriptor child)
Implements org. Add a child to this descriptor. |
| public final boolean | equals(Object other)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public Optional | findByUniqueId(UniqueId uniqueId)
Implements org. Find the descriptor with the supplied unique ID. The search algorithm begins with this descriptor and then searches through its descendants. |
| public final Set | getChildren()
Implements org. Get the immutable set of children of this descriptor. |
| public final String | getDisplayName()
Implements org. Get the display name for this descriptor. |
| public final Optional | getParent()
Implements org. Get the parent of this descriptor, if available. |
| public Optional | getSource()
Implements org. Get the source of the test or container described by this descriptor, if available. |
| public Set | getTags()
Implements org. Get the set of tags associated with this descriptor. |
| public final UniqueId | getUniqueId()
Implements org. Get the unique identifier (UID) for this descriptor. |
| public final int | |
| public void | orderChildren(UnaryOperator<List<TestDescriptor>> orderer)
Overrides default org. Order the children of this descriptor. |
| public void | removeChild(TestDescriptor child)
Implements org. Remove a child from this descriptor. |
| public void | removeFromHierarchy()
Implements org. Remove this non-root descriptor from its parent and remove all the children from this descriptor. |
| private static String | |
| private static String | |
| public final void | |
| public String |
| children | back to summary |
|---|---|
| protected final Set<TestDescriptor> children The synchronized set of children associated with this This set is used in methods such as If a subclass overrides any of the methods related to children, this set should be used instead of a set local to the subclass. | |
| displayName | back to summary |
|---|---|
| private final String displayName | |
| parent | back to summary |
|---|---|
| private @Nullable TestDescriptor parent | |
| source | back to summary |
|---|---|
| private final @Nullable TestSource source | |
| UNICODE_REPLACEMENT_CHARACTER | back to summary |
|---|---|
| private static final String UNICODE_REPLACEMENT_CHARACTER The Unicode replacement character, often displayed as a black diamond with a white question mark in it: | |
| uniqueId | back to summary |
|---|---|
| private final UniqueId uniqueId | |
| AbstractTestDescriptor | back to summary |
|---|---|
| protected AbstractTestDescriptor(UniqueId uniqueId, String displayName) Create a new As of JUnit 6.0, ISO control characters in the provided display name
will be replaced. See
| |
| AbstractTestDescriptor | back to summary | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| protected AbstractTestDescriptor(UniqueId uniqueId, String displayName, @Nullable TestSource source) Create a new As of JUnit 6.0, ISO control characters in the provided display name will be replaced according to the following table.
| |||||||||||||
| addChild | back to summary |
|---|---|
| public void addChild(TestDescriptor child) Implements org. Doc from org. Add a child to this descriptor.
| |
| equals | back to summary |
|---|---|
| public final boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| findByUniqueId | back to summary |
|---|---|
| public Optional Implements org. Doc from org. Find the descriptor with the supplied unique ID. The search algorithm begins with this descriptor and then searches through its descendants.
| |
| getChildren | back to summary |
|---|---|
| public final Set Implements org. Doc from org. Get the immutable set of children of this descriptor.
| |
| getDisplayName | back to summary |
|---|---|
| public final String getDisplayName() Implements org. Doc from org. Get the display name for this descriptor. 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
| |
| getParent | back to summary |
|---|---|
| public final Optional Implements org. Doc from org. Get the parent of this descriptor, if available.
| |
| getSource | back to summary |
|---|---|
| public Optional Implements org. Doc from org. Get the source of the test or container described by this descriptor, if available.
| |
| getTags | back to summary |
|---|---|
| public Set Implements org. Doc from org. Get the set of tags associated with this descriptor.
| |
| getUniqueId | back to summary |
|---|---|
| public final UniqueId getUniqueId() Implements org. Doc from org. Get the unique identifier (UID) for this descriptor. Uniqueness must be guaranteed across an entire test plan, regardless of how many engines are used behind the scenes.
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| orderChildren | back to summary |
|---|---|
| public void orderChildren(UnaryOperator<List<TestDescriptor>> orderer) Overrides default org. Doc from org. Order the children of this descriptor. The
| |
| removeChild | back to summary |
|---|---|
| public void removeChild(TestDescriptor child) Implements org. Doc from org. Remove a child from this descriptor.
| |
| removeFromHierarchy | back to summary |
|---|---|
| public void removeFromHierarchy() Implements org. Doc from org. Remove this non-root descriptor from its parent and remove all the children from this descriptor. If this method is invoked on a root descriptor,
this method must throw a
| |
| replaceControlCharacter | back to summary |
|---|---|
| private static String replaceControlCharacter(char ch) | |
| replaceControlCharacters | back to summary |
|---|---|
| private static String replaceControlCharacters(String text) | |
| setParent | back to summary |
|---|---|
public final void setParent(@Nullable TestDescriptor parent)
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |