Class DynamicTestTestDescriptor
- java.lang.Object
-
- org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
-
- org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
-
- org.junit.jupiter.engine.descriptor.DynamicNodeTestDescriptor
-
- org.junit.jupiter.engine.descriptor.DynamicTestTestDescriptor
-
- All Implemented Interfaces:
Node<JupiterEngineExecutionContext>,TestDescriptor
class DynamicTestTestDescriptor extends DynamicNodeTestDescriptor
TestDescriptorfor aDynamicTest.- Since:
- 5.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
JupiterTestDescriptor.ExceptionHandlerInvoker<E extends org.junit.jupiter.api.extension.Extension>
-
Nested classes/interfaces inherited from interface org.junit.platform.engine.support.hierarchical.Node
Node.DynamicTestExecutor, Node.ExecutionMode, Node.Invocation<C extends EngineExecutionContext>, Node.SkipResult
-
Nested classes/interfaces inherited from interface org.junit.platform.engine.TestDescriptor
TestDescriptor.Type, TestDescriptor.Visitor
-
-
Field Summary
Fields Modifier and Type Field Description private org.junit.jupiter.api.DynamicTestdynamicTestprivate static InvocationInterceptorChaininterceptorChain-
Fields inherited from class org.junit.jupiter.engine.descriptor.DynamicNodeTestDescriptor
index
-
Fields inherited from class org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
configuration
-
Fields inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
children
-
-
Constructor Summary
Constructors Constructor Description DynamicTestTestDescriptor(UniqueId uniqueId, int index, org.junit.jupiter.api.DynamicTest dynamicTest, TestSource source, JupiterConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafter(JupiterEngineExecutionContext context)Avoid anOutOfMemoryErrorby releasing the reference to this descriptor'sDynamicTestwhich holds a reference to the user-suppliedExecutablewhich may potentially consume large amounts of memory on the heap.JupiterEngineExecutionContextexecute(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor)Execute the behavior of this node.TestDescriptor.TypegetType()Determine theTestDescriptor.Typeof this descriptor.protected DynamicTestTestDescriptorwithUniqueId(java.util.function.UnaryOperator<UniqueId> uniqueIdTransformer){@return shallow copy (without children) of this descriptor with the supplied unique ID}-
Methods inherited from class org.junit.jupiter.engine.descriptor.DynamicNodeTestDescriptor
getLegacyReportingName, prepare, shouldBeSkipped
-
Methods inherited from class org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
cleanUp, copyIncludingDescendants, getDefaultChildExecutionMode, getExclusiveResources, getExecutionMode, getExecutionModeFromAnnotation, getExplicitExecutionMode, getTags, invokeExecutionExceptionHandlers, toExecutionMode
-
Methods inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getTags, getUniqueId, hashCode, orderChildren, removeChild, removeFromHierarchy, setParent, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.junit.platform.engine.support.hierarchical.Node
around, before, nodeFinished, nodeSkipped
-
Methods inherited from interface org.junit.platform.engine.TestDescriptor
accept, getAncestors, getDescendants, isContainer, isRoot, isTest, mayRegisterTests, prune
-
-
-
-
Field Detail
-
interceptorChain
private static final InvocationInterceptorChain interceptorChain
-
dynamicTest
private org.junit.jupiter.api.DynamicTest dynamicTest
-
-
Constructor Detail
-
DynamicTestTestDescriptor
DynamicTestTestDescriptor(UniqueId uniqueId, int index, org.junit.jupiter.api.DynamicTest dynamicTest, TestSource source, JupiterConfiguration configuration)
-
-
Method Detail
-
withUniqueId
protected DynamicTestTestDescriptor withUniqueId(java.util.function.UnaryOperator<UniqueId> uniqueIdTransformer)
Description copied from class:JupiterTestDescriptor{@return shallow copy (without children) of this descriptor with the supplied unique ID}- Specified by:
withUniqueIdin classJupiterTestDescriptor
-
getType
public TestDescriptor.Type getType()
Description copied from interface:TestDescriptorDetermine theTestDescriptor.Typeof this descriptor.- Returns:
- the descriptor type; never
null. - See Also:
TestDescriptor.isContainer(),TestDescriptor.isTest()
-
execute
public JupiterEngineExecutionContext execute(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor)
Description copied from interface:NodeExecute the behavior of this node.Containers typically do not implement this method since the
HierarchicalTestEnginehandles execution of their children.The supplied
dynamicTestExecutormay be used to submit additional dynamic tests for immediate execution.The default implementation returns the supplied
contextunmodified.- Parameters:
context- the context to execute indynamicTestExecutor- the executor to submit dynamic tests to- Returns:
- the new context to be used for children of this node and for the after behavior of the parent of this node, if any
- See Also:
Node.before(C),Node.after(C)
-
after
public void after(JupiterEngineExecutionContext context) throws java.lang.Exception
Avoid anOutOfMemoryErrorby releasing the reference to this descriptor'sDynamicTestwhich holds a reference to the user-suppliedExecutablewhich may potentially consume large amounts of memory on the heap.- Parameters:
context- the context to execute in- Throws:
java.lang.Exception- Since:
- 5.5
- See Also:
- Issue 1865
-
-