Package edu.umd.cs.mtc
Class MultithreadedTest
java.lang.Object
junit.framework.Assert
edu.umd.cs.mtc.MultithreadedTestCase
edu.umd.cs.mtc.MultithreadedTest
- All Implemented Interfaces:
junit.framework.Test
public abstract class MultithreadedTest
extends MultithreadedTestCase
implements junit.framework.Test
Extends
MultithreadedTestCase
by implementing
Test
so that tests can be added to a
TestSuite.
When using this class, the default behavior
is to run the test once. To change this default behavior,
override runTest()
. For example, to run a test 20
times, override:
public void runTest() throws Throwable {
TestFramework.runManyTimes(this, 20);
}
- Since:
- 1.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class edu.umd.cs.mtc.MultithreadedTestCase
assertTick, awaitOn, finish, freezeClock, getThread, getThreadByName, getTick, getTrace, initialize, isClockFrozen, mayYield, mayYield, putThread, setTrace, skipNextWait, unfreezeClock, waitForTick, waitForTick, waitOn
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
-
Constructor Details
-
MultithreadedTest
public MultithreadedTest()
-
-
Method Details
-
countTestCases
public int countTestCases()- Specified by:
countTestCases
in interfacejunit.framework.Test
-
run
public void run(junit.framework.TestResult result) - Specified by:
run
in interfacejunit.framework.Test
-
runBare
Runs the bare test sequence, including setUp and tearDown if available.- Throws:
Throwable
- if any exception is thrown
-
runTest
This is the method that runs this test. It is equivalent to the testXxx methods in JUnit 3. By default the test is just run once, by callingTestFramework.runOnce(MultithreadedTestCase)
. To change the way the test is run, simply override this method.
-