Package com.clarkware.junitperf
Class ThreadedTest
- java.lang.Object
-
- com.clarkware.junitperf.ThreadedTest
-
- All Implemented Interfaces:
junit.framework.Test
public class ThreadedTest extends java.lang.Object implements junit.framework.TestTheThreadedTestis a test decorator that runs a test in a separate thread.- Author:
- Mike Clark, Clarkware Consulting, Inc.
-
-
Constructor Summary
Constructors Constructor Description ThreadedTest(junit.framework.Test test)Constructs aThreadedTestto decorate the specified test using the same thread group as the current thread.ThreadedTest(junit.framework.Test test, java.lang.ThreadGroup group, ThreadBarrier barrier)Constructs aThreadedTestto decorate the specified test using the specified thread group and thread barrier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountTestCases()Returns the number of test cases in this threaded test.voidrun(junit.framework.TestResult result)Runs this test.java.lang.StringtoString()Returns the test description.
-
-
-
Constructor Detail
-
ThreadedTest
public ThreadedTest(junit.framework.Test test)
Constructs aThreadedTestto decorate the specified test using the same thread group as the current thread.- Parameters:
test- Test to decorate.
-
ThreadedTest
public ThreadedTest(junit.framework.Test test, java.lang.ThreadGroup group, ThreadBarrier barrier)Constructs aThreadedTestto decorate the specified test using the specified thread group and thread barrier.- Parameters:
test- Test to decorate.group- Thread group.barrier- Thread barrier.
-
-
Method Detail
-
countTestCases
public int countTestCases()
Returns the number of test cases in this threaded test.- Specified by:
countTestCasesin interfacejunit.framework.Test- Returns:
- Number of test cases.
-
run
public void run(junit.framework.TestResult result)
Runs this test.- Specified by:
runin interfacejunit.framework.Test- Parameters:
result- Test result.
-
toString
public java.lang.String toString()
Returns the test description.- Overrides:
toStringin classjava.lang.Object- Returns:
- Description.
-
-