net.groboclown.junit.jpda.v1
Class TestThreadHandler

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

public class TestThreadHandler
extends Object

Iterates through an AsyncTest tester thread.


Inner Class Summary
private  class TestThreadHandler.StepRequestListener
           
private  class TestThreadHandler.TDRListener
           
 
Field Summary
private  AsyncTestController controller
           
private  int index
           
private  RemoteAsyncTestInstance instance
           
private  StepEvent step
           
private  ThreadReference testThread
           
private  JpdaStackFrameTrace tracer
           
 
Constructor Summary
TestThreadHandler(ThreadReference tr, AsyncTestController atc)
           
 
Method Summary
 void beginThread()
          Advance to the beginning of the thread, after it has reported that it is ready.
protected  void cleanUp()
           
 void enterRunTest()
          Advance the thread step-by-step until it enters the runTest() method.
 RemoteAsyncTestInstance getAsyncTest()
           
 int getIndex()
           
 Field getIsTestReadyField()
           
 int getRemainingStepsInTest()
          Finishes parsing through the test method, counting each step (bytecode) along the way.
 ThreadReference getThread()
           
 boolean isInTest()
           
 boolean isTestReady()
           
 boolean isThreadDead()
           
 void resume()
          Resume the thread - that is, signal it to be resumed when the next event is polled.
 void setThreadDead()
           
 void step()
           
 void suspend()
          Suspends the thread so that even if an event is polled, the thread will still be suspended.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

testThread

private ThreadReference testThread

instance

private RemoteAsyncTestInstance instance

controller

private AsyncTestController controller

step

private StepEvent step

index

private int index

tracer

private JpdaStackFrameTrace tracer
Constructor Detail

TestThreadHandler

public TestThreadHandler(ThreadReference tr,
                         AsyncTestController atc)
Method Detail

getIndex

public int getIndex()

getThread

public ThreadReference getThread()

getAsyncTest

public RemoteAsyncTestInstance getAsyncTest()

isTestReady

public boolean isTestReady()

getIsTestReadyField

public Field getIsTestReadyField()

setThreadDead

public void setThreadDead()

isThreadDead

public boolean isThreadDead()

resume

public void resume()
Resume the thread - that is, signal it to be resumed when the next event is polled.

suspend

public void suspend()
Suspends the thread so that even if an event is polled, the thread will still be suspended.

beginThread

public void beginThread()
Advance to the beginning of the thread, after it has reported that it is ready.

enterRunTest

public void enterRunTest()
Advance the thread step-by-step until it enters the runTest() method. If it starts inside that method, it returns immediately.

step

public void step()

getRemainingStepsInTest

public int getRemainingStepsInTest()
Finishes parsing through the test method, counting each step (bytecode) along the way. WARNING: if you call this at a point where this thread is waiting on the other thread, then your event request will time-out.

isInTest

public boolean isInTest()

cleanUp

protected void cleanUp()


Written under the LGPL