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, ResourceLockAware, 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 class JupiterTestDescriptor
JupiterTestDescriptor.ExceptionHandlerInvoker<E>Nested classes/interfaces inherited from interface Node
Node.DynamicTestExecutor, Node.ExecutionMode, Node.Invocation<C>, Node.SkipResultNested classes/interfaces inherited from interface TestDescriptor
TestDescriptor.Type, TestDescriptor.Visitor -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprivate final DynamicDescendantFilterprivate static final InterceptingExecutableInvokerprivate static final InterceptingExecutableInvoker.ReflectiveInterceptorCall<Method, Object> static final StringFields inherited from class JupiterTestDescriptor
configurationFields inherited from class AbstractTestDescriptor
children -
Constructor Summary
ConstructorsModifierConstructorDescriptionTestFactoryTestDescriptor(UniqueId uniqueId, Class<?> testClass, Method testMethod, Supplier<List<Class<?>>> enclosingInstanceTypes, JupiterConfiguration configuration) privateTestFactoryTestDescriptor(UniqueId uniqueId, String displayName, Class<?> testClass, Method testMethod, JupiterConfiguration configuration, DynamicDescendantFilter dynamicDescendantFilter) -
Method Summary
Modifier and TypeMethodDescription(package private) static Optional<JupiterTestDescriptor> createDynamicDescriptor(JupiterTestDescriptor parent, org.junit.jupiter.api.DynamicNode node, int index, TestSource defaultTestSource, DynamicDescendantFilter dynamicDescendantFilter, JupiterConfiguration configuration) (package private) static TestSourcegetType()Determine theTestDescriptor.Typeof this descriptor.private org.junit.platform.commons.JUnitExceptionprotected 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(JupiterEngineExecutionContext, TestDescriptor, TestExecutionResult)as a no-op, since theTestWatcherAPI is not supported for@TestFactorycontainers.voidnodeSkipped(JupiterEngineExecutionContext context, TestDescriptor descriptor, Node.SkipResult result) OverrideMethodBasedTestDescriptor.nodeSkipped(JupiterEngineExecutionContext, TestDescriptor, Node.SkipResult)as a no-op, since theTestWatcherAPI is not supported for@TestFactorycontainers.private Stream<org.junit.jupiter.api.DynamicNode> toDynamicNodeStream(Object testFactoryMethodResult) protected TestFactoryTestDescriptorwithUniqueId(UnaryOperator<UniqueId> uniqueIdTransformer) Returns shallow copy (without children) of this descriptor with the supplied unique ID.Methods inherited from class TestMethodTestDescriptor
cleanUp, execute, populateNewExtensionRegistry, prepare, prepareExtensionContextMethods inherited from class MethodBasedTestDescriptor
getEnclosingTestClasses, getExclusiveResourceCollector, getExplicitExecutionMode, getLegacyReportingName, getResourceLocksProviderEvaluator, getTags, getTestClass, getTestMethod, invokeTestWatchers, validateMethods inherited from class JupiterTestDescriptor
copyIncludingDescendants, getDefaultChildExecutionMode, getExclusiveResources, getExecutionMode, getExecutionModeFromAnnotation, getTags, invokeExecutionExceptionHandlers, shouldBeSkipped, toExecutionModeMethods inherited from class AbstractTestDescriptor
addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getUniqueId, hashCode, orderChildren, removeChild, removeFromHierarchy, setParent, toStringMethods inherited from interface ResourceLockAware
determineExclusiveResources, determineOwnExclusiveResourcesMethods inherited from interface 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:
-
interceptorCall
private static final InterceptingExecutableInvoker.ReflectiveInterceptorCall<Method,Object> interceptorCall -
executableInvoker
-
dynamicDescendantFilter
-
-
Constructor Details
-
TestFactoryTestDescriptor
-
TestFactoryTestDescriptor
private TestFactoryTestDescriptor(UniqueId uniqueId, String displayName, Class<?> testClass, Method testMethod, JupiterConfiguration configuration, DynamicDescendantFilter dynamicDescendantFilter)
-
-
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
-
toDynamicNodeStream
-
invalidReturnTypeException
-
createDynamicDescriptor
static Optional<JupiterTestDescriptor> createDynamicDescriptor(JupiterTestDescriptor parent, org.junit.jupiter.api.DynamicNode node, int index, TestSource defaultTestSource, DynamicDescendantFilter dynamicDescendantFilter, JupiterConfiguration configuration) -
fromUri
- Since:
- 5.3
-
nodeSkipped
public void nodeSkipped(JupiterEngineExecutionContext context, TestDescriptor descriptor, Node.SkipResult result) OverrideMethodBasedTestDescriptor.nodeSkipped(JupiterEngineExecutionContext, TestDescriptor, 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(JupiterEngineExecutionContext, TestDescriptor, 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
-