com.google.testing.threadtester
Interface Stepper


public interface Stepper

Allows an instrumented class to be stepped through line by line. A Stepper is created by calling ObjectInstrumentation.step(com.google.testing.threadtester.Breakpoint). Typical useage is:


  Breakpoint bp = ...
  bp.await();
  Stepper stepper = instrumentedObject.step(bp);
  while(stepper.hasNext()) {
    stepper.step();
  }
  stepper.resume();
 

Author:
alasdair.mackintosh@gmail.com (Alasdair Mackintosh)

Method Summary
 boolean hasNext()
          Returns true if this stepper can be stepped again.
 void resume()
          Causes the Stepper's thread to continue running.
 void step()
          Advances a stepper a single line.
 

Method Detail

hasNext

boolean hasNext()
Returns true if this stepper can be stepped again. Typically, this method will return false once the Stepper has advanced to the end of an instrumented method, and is about to return into non-instrumented code.


step

void step()
          throws TestTimeoutException
Advances a stepper a single line. If the stepper cannot be stepped again (i.e. if hasNext() returns false) then this method is equivalent to calling resume().

Throws:
TestTimeoutException

resume

void resume()
            throws TestTimeoutException
Causes the Stepper's thread to continue running. Note that this method should only be used when hasNext() has returned false. Otherwise, use step().

Throws:
TestTimeoutException
See Also:
Breakpoint.resume()


Copyright © 2013. All Rights Reserved.