Package org.testng.thread
Interface IExecutorFactory
- All Known Implementing Classes:
DefaultThreadPoolExecutorFactory
public interface IExecutorFactory
Represents the capabilities to be possessed by any implementation that can be plugged into TestNG
to execute nodes from a
IDynamicGraph
object.-
Method Summary
Modifier and TypeMethodDescriptionnewSuiteExecutor
(String name, IDynamicGraph<ISuite> graph, IThreadWorkerFactory<ISuite> factory, int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, Comparator<ISuite> comparator) newTestMethodExecutor
(String name, IDynamicGraph<ITestNGMethod> graph, IThreadWorkerFactory<ITestNGMethod> factory, int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, Comparator<ITestNGMethod> comparator)
-
Method Details
-
newSuiteExecutor
ITestNGThreadPoolExecutor newSuiteExecutor(String name, IDynamicGraph<ISuite> graph, IThreadWorkerFactory<ISuite> factory, int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, Comparator<ISuite> comparator) - Parameters:
name
- - The name to be used as a prefix for all created threads.graph
- - AIDynamicGraph
object that represents the graph of methods and the hierarchy of execution.factory
- - AIThreadWorkerFactory
factory to create threads.corePoolSize
- the number of threads to keep in the pool, even if they are idle, unlessallowCoreThreadTimeOut
is setmaximumPoolSize
- the maximum number of threads to allow in the poolkeepAliveTime
- when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.unit
- the time unit for thekeepAliveTime
argumentworkQueue
- the queue to use for holding tasks before they are executed. This queue will hold only theRunnable
tasks submitted by theexecute
method.comparator
- - AComparator
to order nodes internally.- Returns:
- - A new
ITestNGThreadPoolExecutor
that is capable of running suites in parallel.
-
newTestMethodExecutor
ITestNGThreadPoolExecutor newTestMethodExecutor(String name, IDynamicGraph<ITestNGMethod> graph, IThreadWorkerFactory<ITestNGMethod> factory, int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, Comparator<ITestNGMethod> comparator) - Parameters:
name
- - The name to be used as a prefix for all created threads.graph
- - AIDynamicGraph
object that represents the graph of methods and the hierarchy of execution.factory
- - AIThreadWorkerFactory
factory to create threads.corePoolSize
- the number of threads to keep in the pool, even if they are idle, unlessallowCoreThreadTimeOut
is setmaximumPoolSize
- the maximum number of threads to allow in the poolkeepAliveTime
- when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.unit
- the time unit for thekeepAliveTime
argumentworkQueue
- the queue to use for holding tasks before they are executed. This queue will hold only theRunnable
tasks submitted by theexecute
method.comparator
- - AComparator
to order nodes internally.- Returns:
- - A new
ITestNGThreadPoolExecutor
that is capable of running test methods in parallel.
-