Class Blitzer
java.lang.Object
org.jmock.lib.concurrent.Blitzer
A class that "blitzes" an object by calling it many times, from multiple
threads. Used for stress-testing synchronisation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intstatic final intThe default number of threads to run concurrently.private final ExecutorService -
Constructor Summary
ConstructorsConstructorDescriptionBlitzer(int actionCount) Blitzer(int actionCount, int threadCount) Blitzer(int actionCount, int threadCount, ThreadFactory threadFactory) Blitzer(int actionCount, ExecutorService executorService) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidshutdown()private CountDownLatchspawnThreads(Runnable action) int
-
Field Details
-
DEFAULT_THREAD_COUNT
public static final int DEFAULT_THREAD_COUNTThe default number of threads to run concurrently.- See Also:
-
executorService
-
actionCount
private final int actionCount
-
-
Constructor Details
-
Blitzer
public Blitzer(int actionCount) -
Blitzer
public Blitzer(int actionCount, int threadCount) -
Blitzer
-
Blitzer
-
-
Method Details
-
totalActionCount
public int totalActionCount() -
blitz
- Throws:
InterruptedException
-
blitz
- Throws:
InterruptedExceptionTimeoutException
-
spawnThreads
-
shutdown
public void shutdown()
-