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,TestClassAware,Validatable,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.SkipResultNested classes/interfaces inherited from interface org.junit.platform.engine.TestDescriptor
TestDescriptor.Type, TestDescriptor.Visitor -
Field Summary
FieldsFields inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
children -
Constructor Summary
ConstructorsConstructorDescriptionTestFactoryTestDescriptor(UniqueId uniqueId, Class<?> testClass, Method testMethod, Supplier<List<Class<?>>> enclosingInstanceTypes, JupiterConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptiondefault Stream<ExclusiveResource> default Stream<ExclusiveResource> determineOwnExclusiveResources(Function<ResourceLocksProvider, Set<ResourceLocksProvider.Lock>> providerToLocks) getType()Determine theTestDescriptor.Typeof this descriptor.protected voidinvokeTestMethod(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor) booleanDetermine if this descriptor may register dynamic tests during execution.voidnodeFinished(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 theTestWatcherAPI is not supported for@TestFactorycontainers.voidnodeSkipped(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 theTestWatcherAPI is not supported for@TestFactorycontainers.protected TestFactoryTestDescriptorwithUniqueId(UnaryOperator<UniqueId> uniqueIdTransformer) Returns shallow copy (without children) of this descriptor with the supplied unique ID.Methods inherited from class org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor
cleanUp, execute, populateNewExtensionRegistry, prepare, prepareExtensionContextMethods inherited from class org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor
getEnclosingTestClasses, getExclusiveResourceCollector, getExplicitExecutionMode, getLegacyReportingName, getResourceLocksProviderEvaluator, getTags, getTestClass, getTestMethod, invokeTestWatchers, validateMethods inherited from class org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
copyIncludingDescendants, getExclusiveResources, getExecutionMode, shouldBeSkipped, toExecutionModeMethods inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getUniqueId, hashCode, orderChildren, removeChild, removeFromHierarchy, setParent, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.junit.platform.engine.support.hierarchical.Node
after, around, beforeMethods inherited from interface org.junit.platform.engine.TestDescriptor
accept, addChild, findByUniqueId, getAncestors, getChildren, getDescendants, getDisplayName, getParent, getSource, getUniqueId, isContainer, isRoot, isTest, orderChildren, prune, removeChild, removeFromHierarchy, setParent
-
Field Details
-
SEGMENT_TYPE
- See Also:
-
DYNAMIC_CONTAINER_SEGMENT_TYPE
- See Also:
-
DYNAMIC_TEST_SEGMENT_TYPE
- See Also:
-
-
Constructor Details
-
TestFactoryTestDescriptor
-
-
Method Details
-
withUniqueId
Description copied from class:JupiterTestDescriptorReturns shallow copy (without children) of this descriptor with the supplied unique ID.- Overrides:
withUniqueIdin classTestMethodTestDescriptor- Returns:
- shallow copy (without children) of this descriptor with the supplied unique ID
-
getDynamicDescendantFilter
- Specified by:
getDynamicDescendantFilterin interfaceFilterable
-
getType
Description copied from interface:TestDescriptorDetermine theTestDescriptor.Typeof this descriptor.- Specified by:
getTypein interfaceTestDescriptor- Overrides:
getTypein classTestMethodTestDescriptor- Returns:
- the descriptor type; never
null. - See Also:
-
mayRegisterTests
public boolean mayRegisterTests()Description copied from interface:TestDescriptorDetermine 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:
mayRegisterTestsin interfaceTestDescriptor
-
invokeTestMethod
protected void invokeTestMethod(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor) - Overrides:
invokeTestMethodin 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 theTestWatcherAPI is not supported for@TestFactorycontainers.- Specified by:
nodeSkippedin interfaceNode<JupiterEngineExecutionContext>- Overrides:
nodeSkippedin 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 theTestWatcherAPI is not supported for@TestFactorycontainers.- Specified by:
nodeFinishedin interfaceNode<JupiterEngineExecutionContext>- Overrides:
nodeFinishedin classTestMethodTestDescriptor- Parameters:
context- the execution contextdescriptor- the test descriptor that was executedresult- the result of the execution- Since:
- 5.4
-
determineExclusiveResources
-
determineOwnExclusiveResources
default Stream<ExclusiveResource> determineOwnExclusiveResources(Function<ResourceLocksProvider, Set<ResourceLocksProvider.Lock>> providerToLocks)
-