Top Fields Constructors Methods
org.junit.jupiter.params

pack-priv Class ParameterizedClassExtension

extends ParameterizedInvocationContextProvider<ParameterizedClassInvocationContext>
implements ClassTemplateInvocationContextProvider, ParameterResolver
Class Inheritance
All Implemented Interfaces
org.junit.jupiter.api.extension.ParameterResolver, org.junit.jupiter.api.extension.TestInstantiationAwareExtension, org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.ClassTemplateInvocationContextProvider
Static Imports
java.util.Objects.requireNonNull, org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS, org.junit.jupiter.params.ParameterizedClassContext.InjectionType.CONSTRUCTOR, org.junit.platform.commons.support.AnnotationSupport.findAnnotation

Since
5.13

Field Summary

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static ParameterizedClassContext
createClassContext(ExtensionContext extensionContext, Class<?> testClass, ParameterizedClass annotation)

private ParameterizedClassContext
private ExtensionContext.Store
private static boolean
public boolean
mayReturnZeroClassTemplateInvocationContexts(ExtensionContext extensionContext)

Overrides default org.junit.jupiter.api.extension.ClassTemplateInvocationContextProvider.mayReturnZeroClassTemplateInvocationContexts.

Signal that this provider may provide zero invocation contexts for the class template represented by the supplied context.

public Stream<ParameterizedClassInvocationContext>
public Object
resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext)

Implements org.junit.jupiter.api.extension.ParameterResolver.resolveParameter.

Resolve an argument for the Parameter in the supplied ParameterContext for the supplied ExtensionContext.

public boolean
supportsClassTemplate(ExtensionContext extensionContext)

Implements org.junit.jupiter.api.extension.ClassTemplateInvocationContextProvider.supportsClassTemplate.

Determine if this provider supports providing invocation contexts for the class template represented by the supplied context.

public boolean
supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext)

Implements org.junit.jupiter.api.extension.ParameterResolver.supportsParameter.

Determine if this resolver supports resolution of an argument for the Parameter in the supplied ParameterContext for the supplied ExtensionContext.

private boolean
Inherited from org.junit.jupiter.params.ParameterizedInvocationContextProvider:
argumentsprovideInvocationContexts

Field Detail

DECLARATION_CONTEXT_KEYback to summary
private static final String DECLARATION_CONTEXT_KEY

Constructor Detail

ParameterizedClassExtensionback to summary
pack-priv ParameterizedClassExtension()

Method Detail

createClassContextback to summary
private static ParameterizedClassContext createClassContext(ExtensionContext extensionContext, Class<?> testClass, ParameterizedClass annotation)
getDeclarationContextback to summary
private ParameterizedClassContext getDeclarationContext(ExtensionContext extensionContext)
getStoreback to summary
private ExtensionContext.Store getStore(ExtensionContext context)
isDeclaredOnTestClassConstructorback to summary
private static boolean isDeclaredOnTestClassConstructor(ParameterContext parameterContext, ExtensionContext extensionContext)
mayReturnZeroClassTemplateInvocationContextsback to summary
public boolean mayReturnZeroClassTemplateInvocationContexts(ExtensionContext extensionContext)

Overrides default org.junit.jupiter.api.extension.ClassTemplateInvocationContextProvider.mayReturnZeroClassTemplateInvocationContexts.

Doc from org.junit.jupiter.api.extension.ClassTemplateInvocationContextProvider.mayReturnZeroClassTemplateInvocationContexts.

Signal that this provider may provide zero invocation contexts for the class template represented by the supplied context.

If this method returns false (which is the default) and the provider returns an empty stream from provideClassTemplateInvocationContexts, this will be considered an execution error. Override this method to return true to ignore the absence of invocation contexts for this provider.

Annotations
@Override
provideClassTemplateInvocationContextsback to summary
public Stream<ParameterizedClassInvocationContext> provideClassTemplateInvocationContexts(ExtensionContext extensionContext)

Implements org.junit.jupiter.api.extension.ClassTemplateInvocationContextProvider.provideClassTemplateInvocationContexts.

Doc from org.junit.jupiter.api.extension.ClassTemplateInvocationContextProvider.provideClassTemplateInvocationContexts.

Provide invocation contexts for the class template represented by the supplied context.

This method is only called by the framework if supportsClassTemplate previously returned true for the same ExtensionContext; this method is allowed to return an empty Stream but not null.

The returned Stream will be properly closed by calling Stream#close(), making it safe to use a resource such as Files.lines().

Annotations
@Override
resolveParameterback to summary
public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException

Implements org.junit.jupiter.api.extension.ParameterResolver.resolveParameter.

Doc from org.junit.jupiter.api.extension.ParameterResolver.resolveParameter.

Resolve an argument for the Parameter in the supplied ParameterContext for the supplied ExtensionContext.

This method is only called by the framework if supportsParameter previously returned true for the same ParameterContext and ExtensionContext.

The java.lang.reflect.Method or java.lang.reflect.Constructor in which the parameter is declared can be retrieved via ParameterContext#getDeclaringExecutable().

Annotations
@Override
supportsClassTemplateback to summary
public boolean supportsClassTemplate(ExtensionContext extensionContext)

Implements org.junit.jupiter.api.extension.ClassTemplateInvocationContextProvider.supportsClassTemplate.

Doc from org.junit.jupiter.api.extension.ClassTemplateInvocationContextProvider.supportsClassTemplate.

Determine if this provider supports providing invocation contexts for the class template represented by the supplied context.

Annotations
@Override
supportsParameterback to summary
public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException

Implements org.junit.jupiter.api.extension.ParameterResolver.supportsParameter.

Doc from org.junit.jupiter.api.extension.ParameterResolver.supportsParameter.

Determine if this resolver supports resolution of an argument for the Parameter in the supplied ParameterContext for the supplied ExtensionContext.

The java.lang.reflect.Method or java.lang.reflect.Constructor in which the parameter is declared can be retrieved via ParameterContext#getDeclaringExecutable().

Annotations
@Override
validateAndStoreClassContextback to summary
private boolean validateAndStoreClassContext(ExtensionContext extensionContext)