Package org.testng.internal.thread
Class ThreadUtil
java.lang.Object
org.testng.internal.thread.ThreadUtil
A helper class to interface TestNG concurrency usage.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutorService
createExecutor
(int threadCount, String threadFactoryName) static String
Returns a readable name of the current executing thread.static void
Parallel execution of thetasks
.static boolean
-
Field Details
-
THREAD_NAME
- See Also:
-
-
Constructor Details
-
ThreadUtil
public ThreadUtil()
-
-
Method Details
-
isTestNGThread
public static boolean isTestNGThread()- Returns:
- true if the current thread was created by TestNG.
-
execute
public static void execute(String name, List<? extends Runnable> tasks, int threadPoolSize, long timeout) Parallel execution of thetasks
. The startup is synchronized so this method emulates a load test.- Parameters:
tasks
- the list of tasks to be runthreadPoolSize
- the size of the parallel threads to be used to execute the taskstimeout
- a maximum timeout to wait for tasks finalization
-
currentThreadInfo
Returns a readable name of the current executing thread. -
createExecutor
-