Package org.easymock.internal
Class ClassProxyFactory
- java.lang.Object
-
- org.easymock.internal.ClassProxyFactory
-
- All Implemented Interfaces:
IProxyFactory
public class ClassProxyFactory extends Object implements IProxyFactory
Factory generating a mock for a class.- Author:
- Henri Tremblay
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classClassProxyFactory.MockMethodInterceptor
-
Constructor Summary
Constructors Constructor Description ClassProxyFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TcreateProxy(Class<T> toMock, InvocationHandler handler, Method[] mockedMethods, ConstructorArgs args)InvocationHandlergetInvocationHandler(Object mock)Returns the invocation handler formock;static booleanisCallerMockInvocationHandlerInvoke(Throwable e)
-
-
-
Method Detail
-
isCallerMockInvocationHandlerInvoke
public static boolean isCallerMockInvocationHandlerInvoke(Throwable e)
-
createProxy
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
public InvocationHandler getInvocationHandler(Object mock)
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
-
-