Package org.testng.internal.thread
Class DefaultThreadPoolExecutorFactory
- java.lang.Object
-
- org.testng.internal.thread.DefaultThreadPoolExecutorFactory
-
- All Implemented Interfaces:
IExecutorFactory
public class DefaultThreadPoolExecutorFactory extends java.lang.Object implements IExecutorFactory
-
-
Constructor Summary
Constructors Constructor Description DefaultThreadPoolExecutorFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ITestNGThreadPoolExecutornewSuiteExecutor(java.lang.String name, IDynamicGraph<ISuite> graph, IThreadWorkerFactory<ISuite> factory, int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.Comparator<ISuite> comparator)ITestNGThreadPoolExecutornewTestMethodExecutor(java.lang.String name, IDynamicGraph<ITestNGMethod> graph, IThreadWorkerFactory<ITestNGMethod> factory, int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.Comparator<ITestNGMethod> comparator)
-
-
-
Method Detail
-
newSuiteExecutor
public ITestNGThreadPoolExecutor newSuiteExecutor(java.lang.String name, IDynamicGraph<ISuite> graph, IThreadWorkerFactory<ISuite> factory, int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.Comparator<ISuite> comparator)
- Specified by:
newSuiteExecutorin interfaceIExecutorFactory- Parameters:
name- - The name to be used as a prefix for all created threads.graph- - AIDynamicGraphobject that represents the graph of methods and the hierarchy of execution.factory- - AIThreadWorkerFactoryfactory to create threads.corePoolSize- the number of threads to keep in the pool, even if they are idle, unlessallowCoreThreadTimeOutis 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 thekeepAliveTimeargumentworkQueue- the queue to use for holding tasks before they are executed. This queue will hold only theRunnabletasks submitted by theexecutemethod.comparator- - AComparatorto order nodes internally.- Returns:
- - A new
ITestNGThreadPoolExecutorthat is capable of running suites in parallel.
-
newTestMethodExecutor
public ITestNGThreadPoolExecutor newTestMethodExecutor(java.lang.String name, IDynamicGraph<ITestNGMethod> graph, IThreadWorkerFactory<ITestNGMethod> factory, int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue, java.util.Comparator<ITestNGMethod> comparator)
- Specified by:
newTestMethodExecutorin interfaceIExecutorFactory- Parameters:
name- - The name to be used as a prefix for all created threads.graph- - AIDynamicGraphobject that represents the graph of methods and the hierarchy of execution.factory- - AIThreadWorkerFactoryfactory to create threads.corePoolSize- the number of threads to keep in the pool, even if they are idle, unlessallowCoreThreadTimeOutis 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 thekeepAliveTimeargumentworkQueue- the queue to use for holding tasks before they are executed. This queue will hold only theRunnabletasks submitted by theexecutemethod.comparator- - AComparatorto order nodes internally.- Returns:
- - A new
ITestNGThreadPoolExecutorthat is capable of running test methods in parallel.
-
-