org.apache.directory.junit.tools
Class MultiThreadedMultiInvoker
java.lang.Object
org.apache.directory.junit.tools.MultiThreadedMultiInvoker
- All Implemented Interfaces:
- org.junit.rules.MethodRule
public class MultiThreadedMultiInvoker
- extends Object
- implements org.junit.rules.MethodRule
Rule that invokes each test method multiple times using multiple threads.
Just put the following two lines to your test.
@RuleRule
public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker();
- Author:
- Apache Directory Project
|
Method Summary |
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runners.model.FrameworkMethod method,
Object target)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
THREADSAFE
public static final boolean THREADSAFE
- See Also:
- Constant Field Values
NOT_THREADSAFE
public static final boolean NOT_THREADSAFE
- See Also:
- Constant Field Values
MultiThreadedMultiInvoker
public MultiThreadedMultiInvoker(boolean threadSafe)
- Instantiates a new multi threaded invoker.
The number of threads and invocations per thread are derived from
system properties 'threads' and 'invocations'.
- Parameters:
threadSafe - whether the tested class is thread safe
MultiThreadedMultiInvoker
public MultiThreadedMultiInvoker(int numThreads,
int numInvocationsPerThread)
- Instantiates a new multi threaded multi invoker.
- Parameters:
numThreads - the number of threadsnumInvocationsPerThread - the number of method invocations per thread
MultiThreadedMultiInvoker
public MultiThreadedMultiInvoker(int numThreads,
int numInvocationsPerThread,
boolean trace)
- Instantiates a new multi threaded multi invoker.
- Parameters:
numThreads - the number of threadsnumInvocationsPerThread - the number of method invocations per threadtrace - the trace flag
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,
org.junit.runners.model.FrameworkMethod method,
Object target)
-
- Specified by:
apply in interface org.junit.rules.MethodRule
Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.