Module org.junit.jupiter.engine
Class TestFactoryTestDescriptor
java.lang.Object
org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor
org.junit.jupiter.engine.descriptor.TestFactoryTestDescriptor
- All Implemented Interfaces:
Filterable
,Node<JupiterEngineExecutionContext>
,TestDescriptor
@API(status=INTERNAL,
since="5.0")
public class TestFactoryTestDescriptor
extends TestMethodTestDescriptor
implements Filterable
TestDescriptor
for
@TestFactory
methods.- Since:
- 5.0
-
Nested Class Summary
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 inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
children
-
Constructor Summary
ConstructorDescriptionTestFactoryTestDescriptor
(UniqueId uniqueId, Class<?> testClass, Method testMethod, JupiterConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptiongetType()
Determine theTestDescriptor.Type
of this descriptor.protected void
invokeTestMethod
(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor) boolean
Determine if this descriptor may register dynamic tests during execution.void
nodeFinished
(JupiterEngineExecutionContext context, TestDescriptor descriptor, TestExecutionResult result) OverrideTestMethodTestDescriptor.nodeFinished(org.junit.jupiter.engine.execution.JupiterEngineExecutionContext, org.junit.platform.engine.TestDescriptor, org.junit.platform.engine.TestExecutionResult)
as a no-op, since theTestWatcher
API is not supported for@TestFactory
containers.void
nodeSkipped
(JupiterEngineExecutionContext context, TestDescriptor descriptor, Node.SkipResult result) OverrideMethodBasedTestDescriptor.nodeSkipped(org.junit.jupiter.engine.execution.JupiterEngineExecutionContext, org.junit.platform.engine.TestDescriptor, org.junit.platform.engine.support.hierarchical.Node.SkipResult)
as a no-op, since theTestWatcher
API is not supported for@TestFactory
containers.Methods inherited from class org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor
cleanUp, execute, populateNewExtensionRegistry, prepare
Methods inherited from class org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor
getExclusiveResources, getExplicitExecutionMode, getLegacyReportingName, getTags, getTestClass, getTestMethod, invokeTestWatchers
Methods inherited from class org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
getExecutionMode, shouldBeSkipped, toExecutionMode
Methods inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getUniqueId, hashCode, 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
after, around, before
Methods inherited from interface org.junit.platform.engine.TestDescriptor
accept, getDescendants, isContainer, isRoot, isTest, prune
-
Field Details
-
SEGMENT_TYPE
- See Also:
-
DYNAMIC_CONTAINER_SEGMENT_TYPE
- See Also:
-
DYNAMIC_TEST_SEGMENT_TYPE
- See Also:
-
-
Constructor Details
-
TestFactoryTestDescriptor
public TestFactoryTestDescriptor(UniqueId uniqueId, Class<?> testClass, Method testMethod, JupiterConfiguration configuration)
-
-
Method Details
-
getDynamicDescendantFilter
- Specified by:
getDynamicDescendantFilter
in interfaceFilterable
-
getType
Description copied from interface:TestDescriptor
Determine theTestDescriptor.Type
of this descriptor.- Specified by:
getType
in interfaceTestDescriptor
- Overrides:
getType
in classTestMethodTestDescriptor
- Returns:
- the descriptor type; never
null
. - See Also:
-
mayRegisterTests
public boolean mayRegisterTests()Description copied from interface:TestDescriptor
Determine if this descriptor may register dynamic tests during execution.The default implementation assumes tests are usually known during discovery and thus returns
false
.- Specified by:
mayRegisterTests
in interfaceTestDescriptor
-
invokeTestMethod
protected void invokeTestMethod(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor) - Overrides:
invokeTestMethod
in classTestMethodTestDescriptor
-
nodeSkipped
public void nodeSkipped(JupiterEngineExecutionContext context, TestDescriptor descriptor, Node.SkipResult result) OverrideMethodBasedTestDescriptor.nodeSkipped(org.junit.jupiter.engine.execution.JupiterEngineExecutionContext, org.junit.platform.engine.TestDescriptor, org.junit.platform.engine.support.hierarchical.Node.SkipResult)
as a no-op, since theTestWatcher
API is not supported for@TestFactory
containers.- Specified by:
nodeSkipped
in interfaceNode<JupiterEngineExecutionContext>
- Overrides:
nodeSkipped
in classMethodBasedTestDescriptor
- Parameters:
context
- the execution contextdescriptor
- the test descriptor that was skippedresult
- the result of skipped execution- Since:
- 5.4
-
nodeFinished
public void nodeFinished(JupiterEngineExecutionContext context, TestDescriptor descriptor, TestExecutionResult result) OverrideTestMethodTestDescriptor.nodeFinished(org.junit.jupiter.engine.execution.JupiterEngineExecutionContext, org.junit.platform.engine.TestDescriptor, org.junit.platform.engine.TestExecutionResult)
as a no-op, since theTestWatcher
API is not supported for@TestFactory
containers.- Specified by:
nodeFinished
in interfaceNode<JupiterEngineExecutionContext>
- Overrides:
nodeFinished
in classTestMethodTestDescriptor
- Parameters:
context
- the execution contextdescriptor
- the test descriptor that was executedresult
- the result of the execution- Since:
- 5.4
-