net.groboclown.junit.jpda.v1
Class AsyncTest
java.lang.Object
|
+--junit.framework.Assert
|
+--net.groboclown.junit.jpda.v1.AsyncTest
- Direct Known Subclasses:
- MainTest.Test1
- public abstract class AsyncTest
- extends junit.framework.Assert
Specifies the test method to test the asynchronous methods against,
and the options to support it.
The series of steps are as follows:
- The
test()
method is invoked in two separate threads
on the remote VM.
- The method is stepped through until the
isTestReady()
method returns true.
- At this point, the method is continued to be stepped through
until a method is invoked which is outside this class.
- When both threads are at this point, the methods are evaluated
for thread safety.
- After the method returns, the test should repeat the method
invokation until
finishedTest()
is invoked.
- The test() method should then shut down and exit.
Note that there is tight coupling between this class, and the
AsyncTestWatcher
class.
Methods inherited from class junit.framework.Assert |
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
TEST_1_THREAD
public static final String TEST_1_THREAD
TEST_2_THREAD
public static final String TEST_2_THREAD
DEBUG_VM_ARG
public static final String DEBUG_VM_ARG
sync
private Object sync
isTestRunning
private volatile boolean isTestRunning
isTestReady1
private volatile boolean isTestReady1
isTestReady2
private volatile boolean isTestReady2
errors
private Vector errors
r1
private AsyncTest.AsyncRunner r1
r2
private AsyncTest.AsyncRunner r2
t1
private Thread t1
t2
private Thread t2
AsyncTest
public AsyncTest()
main
public static void main(String[] args)
throws Exception
- Called from the command line.
- Parameters:
args
- the command line arguments
startTest
public final void startTest()
finishedTest
public final void finishedTest()
isTestReady
public final boolean isTestReady()
test
public final void test()
- Only invoked by AsyncRunner.
setupTest
public void setupTest()
shutdownTest
public void shutdownTest()
runTest
public abstract void runTest()
Written under the LGPL