java.lang.Object
org.easymock.internal.ClassProxyFactory
- All Implemented Interfaces:
IProxyFactory
Factory generating a mock for a class.
- Author:
- Henri Tremblay
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TcreateProxy(Class<T> toMock, InvocationHandler handler, Method[] mockedMethods, ConstructorArgs args) getInvocationHandler(Object mock) Returns the invocation handler formock;static boolean
-
Constructor Details
-
ClassProxyFactory
public ClassProxyFactory()
-
-
Method Details
-
isCallerMockInvocationHandlerInvoke
-
createProxy
@IgnoreAnimalSniffer public <T> T createProxy(Class<T> toMock, InvocationHandler handler, Method[] mockedMethods, ConstructorArgs args) - Specified by:
createProxyin interfaceIProxyFactory- Type Parameters:
T- type of the class to mock- Parameters:
toMock- the class to mock by the factoryhandler- the handler that will be linked to the created proxymockedMethods- the subset oftoMock's methods to mock, or null to mock all methods.args- the constructor arguments to use, or null to use heuristics to choose a constructor.- Returns:
- the newly created proxy
-
getInvocationHandler
Description copied from interface:IProxyFactoryReturns the invocation handler formock;- Specified by:
getInvocationHandlerin interfaceIProxyFactory- Parameters:
mock- a mock instance previously returned bycreateProxy.- Returns:
- the handler handling method calls for the
mock
-