net.groboclown.junit.jpda.v1
Class AsyncTestController

java.lang.Object
  |
  +--net.groboclown.junit.jpda.v1.AsyncTestController

public final class AsyncTestController
extends Object

Sets up and monitors the progress of the AsyncTest implementation.

Note that there is tight coupling between this class, and the AsyncTest class.


Field Summary
private  RemoteAsyncTestInstance asyncInstance
           
private  JpdaConnector connector
           
private  MainThreadHandler mainThread
           
private static long MAX_EVENT_WAIT_TIME
           
private  TestThreadHandler test1Thread
           
private  TestThreadHandler test2Thread
           
 
Constructor Summary
AsyncTestController(JpdaConnector connector)
           
 
Method Summary
protected  void addTestThread(TestThreadHandler thread)
           
 void advanceEvents()
           
 void close()
          Kills the remote VM and invalidates this watcher.
protected  void displayThreads()
           
 void finishTest()
           
protected  ModificationWatchpointRequest generateModificationWatchpointRequest(Field f)
           
protected  StepRequest generateStepRequest(ThreadReference tr)
           
protected  ThreadDeathRequest generateThreadDeathRequest()
           
protected  ThreadStartRequest generateThreadStartRequest()
           
 JpdaEventRegistry getRegistry()
           
 RemoteAsyncTestInstance getRemoteAsyncTestInstance()
           
 TestThreadHandler getTest1Thread()
           
 TestThreadHandler getTest2Thread()
           
protected  Iterator getThreads()
           
 boolean isVMDead()
           
 void restartTests()
          Restart both test threads such that they are both at the beginning of the runTest method.
 void setupStartTest()
          Advance through the initial steps of the AsyncTest, until the test loops occur.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

MAX_EVENT_WAIT_TIME

private static final long MAX_EVENT_WAIT_TIME

connector

private JpdaConnector connector

mainThread

private MainThreadHandler mainThread

test1Thread

private TestThreadHandler test1Thread

test2Thread

private TestThreadHandler test2Thread

asyncInstance

private RemoteAsyncTestInstance asyncInstance
Constructor Detail

AsyncTestController

public AsyncTestController(JpdaConnector connector)
Method Detail

close

public void close()
Kills the remote VM and invalidates this watcher.

isVMDead

public boolean isVMDead()

getRegistry

public JpdaEventRegistry getRegistry()

finishTest

public void finishTest()

getTest1Thread

public TestThreadHandler getTest1Thread()

getTest2Thread

public TestThreadHandler getTest2Thread()

advanceEvents

public void advanceEvents()

getRemoteAsyncTestInstance

public RemoteAsyncTestInstance getRemoteAsyncTestInstance()

setupStartTest

public void setupStartTest()
Advance through the initial steps of the AsyncTest, until the test loops occur.

restartTests

public void restartTests()
Restart both test threads such that they are both at the beginning of the runTest method.

getThreads

protected Iterator getThreads()

addTestThread

protected void addTestThread(TestThreadHandler thread)

generateStepRequest

protected StepRequest generateStepRequest(ThreadReference tr)

generateThreadStartRequest

protected ThreadStartRequest generateThreadStartRequest()

generateThreadDeathRequest

protected ThreadDeathRequest generateThreadDeathRequest()

generateModificationWatchpointRequest

protected ModificationWatchpointRequest generateModificationWatchpointRequest(Field f)

displayThreads

protected void displayThreads()


Written under the LGPL