class ParameterizedTestMethodContext
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ParameterizedTestMethodContext.Aggregator |
(package private) static class |
ParameterizedTestMethodContext.Converter |
(package private) static interface |
ParameterizedTestMethodContext.Resolver |
(package private) static class |
ParameterizedTestMethodContext.ResolverType |
Modifier and Type | Field and Description |
---|---|
private java.lang.reflect.Parameter[] |
parameters |
private ParameterizedTestMethodContext.Resolver[] |
resolvers |
private java.util.List<ParameterizedTestMethodContext.ResolverType> |
resolverTypes |
Constructor and Description |
---|
ParameterizedTestMethodContext(java.lang.reflect.Method testMethod) |
Modifier and Type | Method and Description |
---|---|
(package private) int |
getParameterCount()
Get the number of parameters of the
Method represented by this
context. |
(package private) java.util.Optional<java.lang.String> |
getParameterName(int parameterIndex)
Get the name of the
Parameter with the supplied index, if
it is present and declared before the aggregators. |
private ParameterizedTestMethodContext.Resolver |
getResolver(ParameterContext parameterContext) |
(package private) boolean |
hasAggregator()
Determine if the
Method represented by this context declares at
least one Parameter that is an
aggregator. |
(package private) boolean |
hasPotentiallyValidSignature()
Determine if the
Method represented by this context has a
potentially valid signature (i.e., formal parameter
declarations) with regard to aggregators. |
(package private) int |
indexOfFirstAggregator()
|
(package private) boolean |
isAggregator(int parameterIndex)
Determine if the
Parameter with the supplied index is an
aggregator (i.e., of type ArgumentsAccessor or annotated with
AggregateWith ). |
private static boolean |
isAggregator(java.lang.reflect.Parameter parameter)
Determine if the supplied
Parameter is an aggregator (i.e., of
type ArgumentsAccessor or annotated with AggregateWith ). |
private static ParameterResolutionException |
parameterResolutionException(java.lang.String message,
java.lang.Exception cause,
ParameterContext parameterContext) |
(package private) java.lang.Object |
resolve(ParameterContext parameterContext,
java.lang.Object[] arguments)
Resolve the parameter for the supplied context using the supplied
arguments.
|
private final java.lang.reflect.Parameter[] parameters
private final ParameterizedTestMethodContext.Resolver[] resolvers
private final java.util.List<ParameterizedTestMethodContext.ResolverType> resolverTypes
ParameterizedTestMethodContext(java.lang.reflect.Method testMethod)
private static boolean isAggregator(java.lang.reflect.Parameter parameter)
Parameter
is an aggregator (i.e., of
type ArgumentsAccessor
or annotated with AggregateWith
).true
if the parameter is an aggregatorboolean hasPotentiallyValidSignature()
Method
represented by this context has a
potentially valid signature (i.e., formal parameter
declarations) with regard to aggregators.
This method takes a best-effort approach at enforcing the following policy for parameterized test methods that accept aggregators as arguments.
ParameterResolver
implementations come last.true
if the method has a potentially valid signatureint getParameterCount()
Method
represented by this
context.java.util.Optional<java.lang.String> getParameterName(int parameterIndex)
Parameter
with the supplied index, if
it is present and declared before the aggregators.Optional
containing the name of the parameterboolean hasAggregator()
Method
represented by this context declares at
least one Parameter
that is an
aggregator.true
if the method has an aggregatorboolean isAggregator(int parameterIndex)
Parameter
with the supplied index is an
aggregator (i.e., of type ArgumentsAccessor
or annotated with
AggregateWith
).true
if the parameter is an aggregatorint indexOfFirstAggregator()
-1
if not foundjava.lang.Object resolve(ParameterContext parameterContext, java.lang.Object[] arguments)
private ParameterizedTestMethodContext.Resolver getResolver(ParameterContext parameterContext)
private static ParameterResolutionException parameterResolutionException(java.lang.String message, java.lang.Exception cause, ParameterContext parameterContext)