|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.powermock.api.easymock.internal.invocationcontrol.EasyMockMethodInvocationControl<T>
public class EasyMockMethodInvocationControl<T>
The default implementation of the MethodInvocationControl interface.
| Constructor Summary | |
|---|---|
EasyMockMethodInvocationControl(org.easymock.internal.MockInvocationHandler invocationHandler,
Set<Method> methodsToMock)
Initializes internal state. |
|
EasyMockMethodInvocationControl(org.easymock.internal.MockInvocationHandler invocationHandler,
Set<Method> methodsToMock,
T mockInstance)
Initializes internal state. |
|
| Method Summary | |
|---|---|
org.easymock.internal.MocksControl.MockType |
getMockType()
|
Object |
invoke(Object proxy,
Method method,
Object[] arguments)
|
boolean |
isMocked(Method method)
|
Object |
replay(Object... mocks)
|
Object |
reset(Object... mocks)
|
Object |
verify(Object... mocks)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EasyMockMethodInvocationControl(org.easymock.internal.MockInvocationHandler invocationHandler,
Set<Method> methodsToMock,
T mockInstance)
invocationHandler - The mock invocation handler to be associated with this
instance.methodsToMock - The methods that are mocked for this instance. If
methodsToMock is null all methods for the
invocationHandler are considered to be mocked.mockInstance - The actual mock instance. May be null. Even
though the mock instance may not be used it's needed to keep a
reference to this object otherwise it may be garbage collected
in some situations. For example when mocking static methods we
don't return the mock object and thus it will be garbage
collected (and thus the finalize method will be invoked which
will be caught by the proxy and the test will fail because we
haven't setup expectations for this method) because then that
object has no reference. In order to avoid this we keep a
reference to this instance here.
public EasyMockMethodInvocationControl(org.easymock.internal.MockInvocationHandler invocationHandler,
Set<Method> methodsToMock)
invocationHandler - The mock invocation handler to be associated with this
instance.methodsToMock - The methods that are mocked for this instance. If
methodsToMock is null all methods for the
invocationHandler are considered to be mocked.| Method Detail |
|---|
public boolean isMocked(Method method)
isMocked in interface MethodInvocationControl
public Object invoke(Object proxy,
Method method,
Object[] arguments)
throws Throwable
invoke in interface InvocationHandlerThrowablepublic org.easymock.internal.MocksControl.MockType getMockType()
public Object replay(Object... mocks)
replay in interface DefaultBehaviorpublic Object verify(Object... mocks)
verify in interface DefaultBehaviorpublic Object reset(Object... mocks)
reset in interface DefaultBehavior
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||