|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.testing.threadtester.AbstractBreakpoint
com.google.testing.threadtester.utils.BlockingProxy<T>
T - the fake object being proxiedpublic class BlockingProxy<T>
Provides a proxy that can be used to control thread execution by blocking at a given point. It can be used to proxy method calls to a fake test object, and provide a BreakPoint at the point where a particular method is called.
| Field Summary |
|---|
| Fields inherited from class com.google.testing.threadtester.AbstractBreakpoint |
|---|
blocked, enabled, limit, numHits, thread |
| Method Summary | ||
|---|---|---|
static
|
create(Class<T> clss,
T original,
Method method,
boolean before)
Creates a new BlockingProxy for the given object. |
|
static
|
create(Class<T> clss,
T original,
String methodName,
boolean before)
Creates a new BlockingProxy for the given object. |
|
T |
getProxy()
Gets the dynamic proxy object. |
|
Thread |
getThread()
Gets the thread associated with this Breakpoint, if any. |
|
Object |
invoke(Object proxy,
Method invoked,
Object[] args)
|
|
void |
setThread(Thread thread)
Sets the thread associated with this breakpoint. |
|
| Methods inherited from class com.google.testing.threadtester.AbstractBreakpoint |
|---|
await, disable, enable, finishWaiting, getHits, getId, getLimit, hitBreakpoint, isBlocked, isEnabled, reset, resume, resume, setHandler, setLimit, setThreadImpl, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.google.testing.threadtester.Breakpoint |
|---|
await, disable, enable, getLimit, isBlocked, isEnabled, resume, resume, setHandler, setLimit |
| Method Detail |
|---|
public T getProxy()
public Object invoke(Object proxy,
Method invoked,
Object[] args)
throws Throwable
invoke in interface InvocationHandlerThrowablepublic Thread getThread()
Breakpoint
getThread in interface BreakpointgetThread in class AbstractBreakpointpublic void setThread(Thread thread)
ReusableBreakpointBreakpoint.await() followed
by Breakpoint.resume().
setThread in interface ReusableBreakpoint
public static <T> BlockingProxy<T> create(Class<T> clss,
T original,
String methodName,
boolean before)
clss - the class being proxied. Must be an interface.original - the object being proxied. Must implement the given interface.methodName - the name of the method where this proxy will block.before - if true, block before calling the given method. If false,
block afterwards.
public static <T> BlockingProxy<T> create(Class<T> clss,
T original,
Method method,
boolean before)
clss - the class being proxied. Must be an interface.original - the object being proxied. Must implement the given interface.method - the method where this proxy will block.before - if true, block before calling the given method. If false,
block afterwards.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||