Class ExecutableInvoker
- java.lang.Object
-
- org.junit.jupiter.engine.execution.ExecutableInvoker
-
@API(status=INTERNAL, since="5.0") public class ExecutableInvoker extends java.lang.Object
ExecutableInvoker
encapsulates the invocation of aExecutable
(i.e., method or constructor), including support for dynamic resolution of method parameters viaParameterResolvers
.- Since:
- 5.0
-
-
Constructor Summary
Constructors Constructor Description ExecutableInvoker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
invoke(java.lang.reflect.Constructor<T> constructor, java.lang.Object outerInstance, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Invoke the supplied constructor with the supplied outer instance and dynamic parameter resolution.<T> T
invoke(java.lang.reflect.Constructor<T> constructor, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Invoke the supplied constructor with dynamic parameter resolution.java.lang.Object
invoke(java.lang.reflect.Method method, java.lang.Object target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Invoke the supplied method on the supplied target object with dynamic parameter resolution.java.lang.Object
invoke(java.lang.reflect.Method method, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Invoke the suppliedstatic
method with dynamic parameter resolution.
-
-
-
Method Detail
-
invoke
public <T> T invoke(java.lang.reflect.Constructor<T> constructor, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Invoke the supplied constructor with dynamic parameter resolution.- Parameters:
constructor
- the constructor to invoke and resolve parameters forextensionContext
- the currentExtensionContext
extensionRegistry
- theExtensionRegistry
to retrieveParameterResolvers
from
-
invoke
public <T> T invoke(java.lang.reflect.Constructor<T> constructor, java.lang.Object outerInstance, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Invoke the supplied constructor with the supplied outer instance and dynamic parameter resolution.This method should only be used to invoke the constructor for an inner class.
- Parameters:
constructor
- the constructor to invoke and resolve parameters forouterInstance
- the outer instance to supply as the first argument to the constructorextensionContext
- the currentExtensionContext
extensionRegistry
- theExtensionRegistry
to retrieveParameterResolvers
from
-
invoke
public java.lang.Object invoke(java.lang.reflect.Method method, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Invoke the suppliedstatic
method with dynamic parameter resolution.- Parameters:
method
- the method to invoke and resolve parameters forextensionContext
- the currentExtensionContext
extensionRegistry
- theExtensionRegistry
to retrieveParameterResolvers
from
-
invoke
public java.lang.Object invoke(java.lang.reflect.Method method, java.lang.Object target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
Invoke the supplied method on the supplied target object with dynamic parameter resolution.- Parameters:
method
- the method to invoke and resolve parameters fortarget
- the object on which the method will be invoked; should benull
for static methodsextensionContext
- the currentExtensionContext
extensionRegistry
- theExtensionRegistry
to retrieveParameterResolvers
from
-
-