|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Breakpoint
Represents a request for execution to block at a particular
position. Breakpoints are normally obtained by calling ObjectInstrumentation.createBreakpoint(CodePosition, Thread), but other classes
may also implement the Breakpoint interface.
A Breakpoint is a single-shot object. Once execution blocks at a particular
Breakpoint, it will not block again when that position is reached a second
time. A new Breakpoint must be created.
| Method Summary | |
|---|---|
void |
await()
Waits for this breakpoint to be reached. |
void |
disable()
Disables the Breakpoint. |
void |
enable()
Enables the Breakpoint. |
int |
getLimit()
Gets the limit. |
Thread |
getThread()
Gets the thread associated with this Breakpoint, if any. |
boolean |
isBlocked()
Returns true if the associated thread is currently blocked at this breakpoint. |
boolean |
isEnabled()
Returns true if this breakpoint is enabled. |
void |
resume()
Tells the blocked thread to continue. |
void |
resume(Breakpoint nextBreak)
Tells the blocked thread to continue, and then wait for the given breakpoint. |
void |
setHandler(BreakpointHandler handler)
Sets a handler for this Breakpoint. |
void |
setLimit(int limit)
Sets the limit. |
| Method Detail |
|---|
Thread getThread()
void setHandler(BreakpointHandler handler)
BreakpointHandler.handleBreakpoint(com.google.testing.threadtester.Breakpoint) method.
void setLimit(int limit)
Note that once a breakpoint has stopped, it is no longer active, and will not stop again.
IllegalArgumentException - if limit < 1
IllegalStateException - if this breakpoint has already been reached.int getLimit()
setLimit(int).
boolean isEnabled()
disable(). A
Breakpoint's thread will only stop if the Breakpoint is enabled.
void disable()
void enable()
disable().
boolean isBlocked()
void await()
throws TestTimeoutException
It is the caller's responsibility to ensure that this breakpoint is reachable in the current environment. Waiting for a breakpoint that is not reached will eventually throw a TestTimeoutException.
IllegalStateException - if this breakpoint is not currently active
TestTimeoutException - if this breakpoint is not reached within the
time limit defined by Options.timeout. The thread of the timeout
exception will be set to the thread of this breakpoint, not to the thread
that called await.void resume()
await() has been successfully called.
IllegalStateException - if await has not been called.
void resume(Breakpoint nextBreak)
throws TestTimeoutException
breakPoint.resume(); nextBreak.await();
TestTimeoutException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||