public class ThreadUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
THREAD_NAME |
| Constructor and Description |
|---|
ThreadUtil() |
| Modifier and Type | Method and Description |
|---|---|
static ExecutorService |
createExecutor(int threadCount,
String threadFactoryName) |
static String |
currentThreadInfo()
Returns a readable name of the current executing thread.
|
static void |
execute(String name,
List<? extends Runnable> tasks,
int threadPoolSize,
long timeout)
Parallel execution of the
tasks. |
static boolean |
isTestNGThread() |
public static final String THREAD_NAME
public static boolean isTestNGThread()
public static void execute(String name, List<? extends Runnable> tasks, int threadPoolSize, long timeout)
tasks. The startup is synchronized so this method
emulates a load test.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 finalizationpublic static String currentThreadInfo()
public static ExecutorService createExecutor(int threadCount, String threadFactoryName)
Copyright © 2025. All rights reserved.