public class NoopDescriptor extends java.lang.Object implements org.junit.platform.engine.support.hierarchical.Node<FWDEngineExecutionContext>, org.junit.platform.engine.TestDescriptor, Printable, java.io.Externalizable
NoopDescriptor does nothing.org.junit.platform.engine.support.hierarchical.Node.DynamicTestExecutor, org.junit.platform.engine.support.hierarchical.Node.ExecutionMode, org.junit.platform.engine.support.hierarchical.Node.Invocation<C extends org.junit.platform.engine.support.hierarchical.EngineExecutionContext>, org.junit.platform.engine.support.hierarchical.Node.SkipResult| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
displayName
This descriptor display name
|
protected org.junit.platform.engine.TestDescriptor |
parent
The parent descriptor or
null if this is the root (test engine) descriptor |
private org.junit.platform.engine.UniqueId |
uniqueId
The descriptor unique ID
|
| Constructor and Description |
|---|
NoopDescriptor(org.junit.platform.engine.UniqueId uniqueId,
java.lang.String displayName)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(org.junit.platform.engine.TestDescriptor descriptor)
Add a child to this descriptor.
|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
|
FWDEngineExecutionContext |
execute(FWDEngineExecutionContext context,
org.junit.platform.engine.support.hierarchical.Node.DynamicTestExecutor dynamicTestExecutor)
Execute the behavior of this node.
|
java.util.Optional<? extends org.junit.platform.engine.TestDescriptor> |
findByUniqueId(org.junit.platform.engine.UniqueId id)
Find the descriptor with the supplied unique ID.
|
java.util.Set<? extends org.junit.platform.engine.TestDescriptor> |
getChildren()
Get the immutable set of children of this descriptor.
|
java.lang.String |
getDisplayName()
Get the display name for this descriptor.
|
java.util.Optional<org.junit.platform.engine.TestDescriptor> |
getParent()
Get the parent of this descriptor, if available.
|
java.util.Optional<org.junit.platform.engine.TestSource> |
getSource()
Get the source of the test or container described
by this descriptor, if available.
|
java.util.Set<org.junit.platform.engine.TestTag> |
getTags()
Get the set of tags associated with this descriptor.
|
org.junit.platform.engine.TestDescriptor.Type |
getType()
Determine the
TestDescriptor.Type of this descriptor. |
org.junit.platform.engine.UniqueId |
getUniqueId()
Get the unique identifier (UID) for this descriptor.
|
int |
hashCode()
Returns a hash code value for the object.
|
void |
print(PrintHelper printer)
Print all class-specific fields.
|
void |
readExternal(java.io.ObjectInput in)
The object implements the readExternal method to restore its
contents by calling the methods of DataInput for primitive
types and readObject for objects, strings and arrays.
|
void |
removeChild(org.junit.platform.engine.TestDescriptor descriptor)
Remove a child from this descriptor.
|
void |
removeFromHierarchy()
Remove this non-root descriptor from its parent and remove all the
children from this descriptor.
|
void |
setParent(org.junit.platform.engine.TestDescriptor parent)
Set the parent of this descriptor.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
void |
writeExternal(java.io.ObjectOutput out)
The object implements the writeExternal method to save its contents
by calling the methods of DataOutput for its primitive values or
calling the writeObject method of ObjectOutput for objects, strings,
and arrays.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitafter, around, before, cleanUp, getExclusiveResources, getExecutionMode, nodeFinished, nodeSkipped, prepare, shouldBeSkippedprivate java.lang.String displayName
private org.junit.platform.engine.UniqueId uniqueId
protected org.junit.platform.engine.TestDescriptor parent
null if this is the root (test engine) descriptorpublic NoopDescriptor(org.junit.platform.engine.UniqueId uniqueId,
java.lang.String displayName)
uniqueId - the descriptor unique IDdisplayName - the descriptor display namepublic void addChild(org.junit.platform.engine.TestDescriptor descriptor)
addChild in interface org.junit.platform.engine.TestDescriptordescriptor - the child to add to this descriptor; never nullpublic final boolean equals(java.lang.Object obj)
The equals method implements an equivalence relation
on non-null object references:
x, x.equals(x) should return
true.
x and y, x.equals(y)
should return true if and only if
y.equals(x) returns true.
x, y, and z, if
x.equals(y) returns true and
y.equals(z) returns true, then
x.equals(z) should return true.
x and y, multiple invocations of
x.equals(y) consistently return true
or consistently return false, provided no
information used in equals comparisons on the
objects is modified.
x,
x.equals(null) should return false.
The equals method for class Object implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x and
y, this method returns true if and only
if x and y refer to the same object
(x == y has the value true).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode method, which states
that equal objects must have equal hash codes.
equals in class java.lang.Objectobj - the reference object with which to compare.true if this object is the same as the obj
argument; false otherwise.hashCode(),
HashMappublic FWDEngineExecutionContext execute(FWDEngineExecutionContext context, org.junit.platform.engine.support.hierarchical.Node.DynamicTestExecutor dynamicTestExecutor) throws java.lang.Exception
Containers typically do not implement this method since the
HierarchicalTestEngine handles execution of their children.
The supplied dynamicTestExecutor may be used to submit
additional dynamic tests for immediate execution.
The default implementation returns the supplied context unmodified.
execute in interface org.junit.platform.engine.support.hierarchical.Node<FWDEngineExecutionContext>context - the context to execute indynamicTestExecutor - the executor to submit dynamic tests tojava.lang.ExceptionNode.before(C),
Node.after(C)public java.util.Optional<? extends org.junit.platform.engine.TestDescriptor> findByUniqueId(org.junit.platform.engine.UniqueId id)
The search algorithm begins with this descriptor and then searches through its descendants.
findByUniqueId in interface org.junit.platform.engine.TestDescriptorid - the UniqueId to search for; never nullpublic java.util.Set<? extends org.junit.platform.engine.TestDescriptor> getChildren()
getChildren in interface org.junit.platform.engine.TestDescriptornull
nor mutable, but potentially emptyTestDescriptor.getDescendants()public 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.
getDisplayName in interface org.junit.platform.engine.TestDescriptornull or blankgetSource()public java.util.Optional<org.junit.platform.engine.TestDescriptor> getParent()
getParent in interface org.junit.platform.engine.TestDescriptorpublic java.util.Optional<org.junit.platform.engine.TestSource> getSource()
getSource in interface org.junit.platform.engine.TestDescriptorTestSourcepublic java.util.Set<org.junit.platform.engine.TestTag> getTags()
getTags in interface org.junit.platform.engine.TestDescriptornull
but potentially emptyTestTagpublic org.junit.platform.engine.TestDescriptor.Type getType()
TestDescriptor.Type of this descriptor.getType in interface org.junit.platform.engine.TestDescriptornull.TestDescriptor.isContainer(),
TestDescriptor.isTest()public final org.junit.platform.engine.UniqueId getUniqueId()
Uniqueness must be guaranteed across an entire test plan, regardless of how many engines are used behind the scenes.
getUniqueId in interface org.junit.platform.engine.TestDescriptorUniqueId for this descriptor; never nullpublic final int hashCode()
HashMap.
The general contract of hashCode is:
hashCode method
must consistently return the same integer, provided no information
used in equals comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
equals(Object)
method, then calling the hashCode method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by
class Object does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
Java™ programming language.)
hashCode in class java.lang.ObjectObject.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public void print(PrintHelper printer)
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablein - the stream to read data from in order to restore the objectjava.io.IOException - if I/O errors occurjava.lang.ClassNotFoundException - If the class for an object being
restored cannot be found.public void removeChild(org.junit.platform.engine.TestDescriptor descriptor)
removeChild in interface org.junit.platform.engine.TestDescriptordescriptor - the child to remove from this descriptor; never
nullpublic void removeFromHierarchy()
If this method is invoked on a root descriptor,
this method must throw a JUnitException
explaining that a root cannot be removed from the
hierarchy.
removeFromHierarchy in interface org.junit.platform.engine.TestDescriptorpublic void setParent(org.junit.platform.engine.TestDescriptor parent)
setParent in interface org.junit.platform.engine.TestDescriptorparent - the new parent of this descriptor; may be null.public java.lang.String toString()
toString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
toString in class java.lang.Objectpublic void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizableout - the stream to write the object tojava.io.IOException - Includes any I/O exceptions that may occur