org.jmock.lib.concurrent
Class Blitzer

java.lang.Object
  extended by org.jmock.lib.concurrent.Blitzer

public class Blitzer
extends Object

A class that "blitzes" an object by calling it many times, from multiple threads. Used for stress-testing synchronisation.

Author:
nat

Field Summary
static int DEFAULT_THREAD_COUNT
          The default number of threads to run concurrently.
 
Constructor Summary
Blitzer(int actionCount)
           
Blitzer(int actionCount, ExecutorService executorService)
           
Blitzer(int actionCount, int threadCount)
           
Blitzer(int actionCount, int threadCount, ThreadFactory threadFactory)
           
 
Method Summary
 void blitz(long timeoutMs, Runnable action)
           
 void blitz(Runnable action)
           
 void shutdown()
           
 int totalActionCount()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_THREAD_COUNT

public static final int DEFAULT_THREAD_COUNT
The default number of threads to run concurrently.

See Also:
Constant Field Values
Constructor Detail

Blitzer

public Blitzer(int actionCount)

Blitzer

public Blitzer(int actionCount,
               int threadCount)

Blitzer

public Blitzer(int actionCount,
               int threadCount,
               ThreadFactory threadFactory)

Blitzer

public Blitzer(int actionCount,
               ExecutorService executorService)
Method Detail

totalActionCount

public int totalActionCount()

blitz

public void blitz(Runnable action)
           throws InterruptedException
Throws:
InterruptedException

blitz

public void blitz(long timeoutMs,
                  Runnable action)
           throws InterruptedException,
                  TimeoutException
Throws:
InterruptedException
TimeoutException

shutdown

public void shutdown()