Package org.testng.internal
Class Parameters
java.lang.Object
org.testng.internal.Parameters
Methods that bind parameters declared in testng.xml to actual values used to invoke methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A parameter passing helper class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Object[]
createConfigurationParameters
(Method m, Map<String, String> params, Object[] parameterValues, ITestNGMethod currentTestMethod, IAnnotationFinder finder, XmlSuite xmlSuite, ITestContext ctx, ITestResult testResult) Creates the parameters needed for the specified@Configuration
Method
.static Object[]
createInstantiationParameters
(Constructor<?> ctor, String methodAnnotation, IAnnotationFinder finder, String[] parameterNames, Map<String, String> params, XmlSuite xmlSuite) Creates the parameters needed for constructing a test class instance.static ParameterHolder
handleParameters
(ITestObjectFactory objectFactory, ITestNGMethod testMethod, Map<String, String> allParameterNames, Object instance, Parameters.MethodParameters methodParams, XmlSuite xmlSuite, IAnnotationFinder annotationFinder, Object fedInstance, DataProviderHolder holder) If the method has parameters, fill them in.static ParameterHolder
handleParameters
(ITestObjectFactory objectFactory, ITestNGMethod testMethod, Map<String, String> allParameterNames, Object instance, Parameters.MethodParameters methodParams, XmlSuite xmlSuite, IAnnotationFinder annotationFinder, Object fedInstance, DataProviderHolder holder, String annotationName) If the method has parameters, fill them in.static Object[]
injectParameters
(Object[] parameterValues, Method method, ITestContext context) Gets an array of parameter values returned by data provider or the ones that are injected based on parameter type.
-
Constructor Details
-
Parameters
public Parameters()
-
-
Method Details
-
createInstantiationParameters
public static Object[] createInstantiationParameters(Constructor<?> ctor, String methodAnnotation, IAnnotationFinder finder, String[] parameterNames, Map<String, String> params, XmlSuite xmlSuite) Creates the parameters needed for constructing a test class instance. -
createConfigurationParameters
public static Object[] createConfigurationParameters(Method m, Map<String, String> params, Object[] parameterValues, ITestNGMethod currentTestMethod, IAnnotationFinder finder, XmlSuite xmlSuite, ITestContext ctx, ITestResult testResult) Creates the parameters needed for the specified@Configuration
Method
.- Parameters:
m
- the configuraton methodcurrentTestMethod
- the current @Test method ornull
if no @Test is available (this is not only in case the configuration method is a @Before/@AfterMethodfinder
- the annotation finder
-
handleParameters
public static ParameterHolder handleParameters(ITestObjectFactory objectFactory, ITestNGMethod testMethod, Map<String, String> allParameterNames, Object instance, Parameters.MethodParameters methodParams, XmlSuite xmlSuite, IAnnotationFinder annotationFinder, Object fedInstance, DataProviderHolder holder) If the method has parameters, fill them in. Either by using a @DataProvider if any was provided, or by looking up<parameters>
in testng.xml- Returns:
- An Iterator over the values for each parameter of this method.
-
handleParameters
public static ParameterHolder handleParameters(ITestObjectFactory objectFactory, ITestNGMethod testMethod, Map<String, String> allParameterNames, Object instance, Parameters.MethodParameters methodParams, XmlSuite xmlSuite, IAnnotationFinder annotationFinder, Object fedInstance, DataProviderHolder holder, String annotationName) If the method has parameters, fill them in. Either by using a @DataProvider if any was provided, or by looking up<parameters>
in testng.xml- Returns:
- An Iterator over the values for each parameter of this method.
-
injectParameters
public static Object[] injectParameters(Object[] parameterValues, Method method, ITestContext context) throws TestNGException Gets an array of parameter values returned by data provider or the ones that are injected based on parameter type. The method also checks forNoInjection
annotation- Parameters:
parameterValues
- parameter values from a data providermethod
- method to be invokedcontext
- test context- Throws:
TestNGException
-