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:
- Test
public abstract class MultithreadedTest
- extends MultithreadedTestCase
- implements 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
- Author:
- William Pugh, Nathaniel Ayewah
- See Also:
MultithreadedTestCase,
runTest()
| Methods inherited from class edu.umd.cs.mtc.MultithreadedTestCase |
assertTick, awaitOn, finish, freezeClock, getThread, getThreadByName, getTick, getTrace, goodbye, hello, 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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MultithreadedTest
public MultithreadedTest()
countTestCases
public int countTestCases()
- Specified by:
countTestCases in interface Test
run
public void run(TestResult result)
- Specified by:
run in interface Test
runBare
protected void runBare()
throws Throwable
- Runs the bare test sequence, including setUp and tearDown
if available.
- Throws:
Throwable - if any exception is thrown
runTest
public void runTest()
throws Throwable
- 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 calling
TestFramework.runOnce(MultithreadedTestCase).
To change the way the test is run, simply override this method.
- Throws:
Throwable - if any exception is thrown- See Also:
TestFramework.runOnce(MultithreadedTestCase),
TestFramework.runOnce(MultithreadedTestCase, Integer, Integer),
TestFramework.runManyTimes(MultithreadedTestCase, int),
TestFramework.runManyTimes(MultithreadedTestCase, int, Integer, Integer)
addSetUpAndTearDown
void addSetUpAndTearDown(TestCase tc,
Method setUp,
Method tearDown)
- If this
MultithreadedTest is added to a test suite using
TestFramework.buildTestSuite(Class), and if it is a non-static
inner class of a TestCase, then the setUp and tearDown methods
should be called before and after the test is run respectively. This
method is used by
TestFramework.addSetUpAndTearDown(MultithreadedTest, TestCase)
to provide the necessary references so that these methods can be invoked.
- Parameters:
tc - setUp - tearDown -
Web Accessibility