org.testng.internal.thread
Class ThreadUtil

java.lang.Object
  extended by org.testng.internal.thread.ThreadUtil

public class ThreadUtil
extends java.lang.Object

A helper class to interface TestNG concurrency usage.

Author:
Nested Class Summary
static class ThreadUtil.ThreadFactoryImpl
           
 
Constructor Summary
ThreadUtil()
           
 
Method Summary
static IAtomicInteger createAtomicInteger(int initialValue)
           
static IExecutor createExecutor(int threadCount, java.lang.String threadFactoryName)
           
static java.lang.String currentThreadInfo()
          Returns a readable name of the current executing thread.
static void execute(java.util.List<? extends java.lang.Runnable> tasks, int threadPoolSize, long timeout, boolean triggerAtOnce)
          Parallel execution of the tasks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadUtil

public ThreadUtil()
Method Detail

execute

public static final void execute(java.util.List<? extends java.lang.Runnable> tasks,
                                 int threadPoolSize,
                                 long timeout,
                                 boolean triggerAtOnce)
Parallel execution of the tasks. The startup is synchronized so this method emulates a load test.

Parameters:
tasks - the list of tasks to be run
threadPoolSize - the size of the parallel threads to be used to execute the tasks
timeout - CURRENTLY NOT USED (a maximum timeout to wait for tasks finalization)
triggerAtOnce - true if the parallel execution of tasks should be trigger at once

currentThreadInfo

public static final java.lang.String currentThreadInfo()
Returns a readable name of the current executing thread.


createExecutor

public static final IExecutor createExecutor(int threadCount,
                                             java.lang.String threadFactoryName)

createAtomicInteger

public static final IAtomicInteger createAtomicInteger(int initialValue)


Copyright © 2010. All Rights Reserved.