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