Package org.testng.internal
Class Invoker
- java.lang.Object
-
- org.testng.internal.Invoker
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.util.function.BiPredicate<ITestNGMethod,IClass>
CAN_RUN_FROM_CLASS
Predicate to filter methodsprivate ConfigInvoker
m_configInvoker
private TestInvoker
m_testInvoker
(package private) static java.util.function.BiPredicate<ITestNGMethod,IClass>
SAME_CLASS
Predicate to filter methods
-
Constructor Summary
Constructors Constructor Description Invoker(IConfiguration configuration, ITestContext testContext, ITestResultNotifier notifier, SuiteRunState state, boolean skipFailedInvocationCounts, java.util.Collection<IInvokedMethodListener> invokedMethodListeners, java.util.List<IClassListener> classListeners, java.util.Collection<IDataProviderListener> dataProviderListeners)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigInvoker
getConfigInvoker()
TestInvoker
getTestInvoker()
void
invokeConfigurations(IClass testClass, ITestNGMethod[] allMethods, XmlSuite suite, java.util.Map<java.lang.String,java.lang.String> params, java.lang.Object[] parameterValues, java.lang.Object instance)
Invoke configuration methods if they belong to the same TestClass passed in parameter..java.util.List<ITestResult>
invokeTestMethods(ITestNGMethod testMethod, java.util.Map<java.lang.String,java.lang.String> testParameters, ConfigurationGroupMethods groupMethods, java.lang.Object instance, ITestContext testContext)
Invoke all the test methods.(package private) static void
log(int level, java.lang.String s)
-
-
-
Field Detail
-
CAN_RUN_FROM_CLASS
static final java.util.function.BiPredicate<ITestNGMethod,IClass> CAN_RUN_FROM_CLASS
Predicate to filter methods
-
SAME_CLASS
static final java.util.function.BiPredicate<ITestNGMethod,IClass> SAME_CLASS
Predicate to filter methods
-
m_testInvoker
private final TestInvoker m_testInvoker
-
m_configInvoker
private final ConfigInvoker m_configInvoker
-
-
Constructor Detail
-
Invoker
public Invoker(IConfiguration configuration, ITestContext testContext, ITestResultNotifier notifier, SuiteRunState state, boolean skipFailedInvocationCounts, java.util.Collection<IInvokedMethodListener> invokedMethodListeners, java.util.List<IClassListener> classListeners, java.util.Collection<IDataProviderListener> dataProviderListeners)
-
-
Method Detail
-
getConfigInvoker
public ConfigInvoker getConfigInvoker()
- Specified by:
getConfigInvoker
in interfaceIInvoker
-
getTestInvoker
public TestInvoker getTestInvoker()
- Specified by:
getTestInvoker
in interfaceIInvoker
-
invokeConfigurations
public void invokeConfigurations(IClass testClass, ITestNGMethod[] allMethods, XmlSuite suite, java.util.Map<java.lang.String,java.lang.String> params, java.lang.Object[] parameterValues, java.lang.Object instance)
Invoke configuration methods if they belong to the same TestClass passed in parameter..TODO: Calculate ahead of time which methods should be invoked for each class. Might speed things up for users who invoke the same test class with different parameters in the same suite run.
If instance is non-null, the configuration will be run on it. If it is null, the configuration methods will be run on all the instances retrieved from the ITestClass.
- Specified by:
invokeConfigurations
in interfaceIInvoker
- Parameters:
testClass
- the class whose configuration methods must be run
-
invokeTestMethods
public java.util.List<ITestResult> invokeTestMethods(ITestNGMethod testMethod, java.util.Map<java.lang.String,java.lang.String> testParameters, ConfigurationGroupMethods groupMethods, java.lang.Object instance, ITestContext testContext)
Invoke all the test methods. Note the plural: the method passed in parameter might be invoked several times if the test class it belongs to has more than one instance (i.e., if an @Factory method has been declared somewhere that returns several instances of this TestClass). If no @Factory method was specified, testMethod will only be invoked once.Note that this method also takes care of invoking the beforeTestMethod and afterTestMethod, if any.
Note (alex): this method can be refactored to use a SingleTestMethodWorker that directly invokes
ITestInvoker.invokeTestMethod(TestMethodArguments, XmlSuite, FailureContext)
and this would simplify the implementation (see how DataTestMethodWorker is used)- Specified by:
invokeTestMethods
in interfaceIInvoker
- Returns:
- a list containing the results of the test methods invocations
-
log
static void log(int level, java.lang.String s)
-
-