public class ClassProxyFactory extends java.lang.Object implements IProxyFactory
Modifier and Type | Class and Description |
---|---|
static class |
ClassProxyFactory.MockMethodInterceptor |
Modifier and Type | Field and Description |
---|---|
private static net.sf.cglib.core.NamingPolicy |
ALLOWS_MOCKING_CLASSES_IN_SIGNED_PACKAGES |
Constructor and Description |
---|
ClassProxyFactory() |
Modifier and Type | Method and Description |
---|---|
private net.sf.cglib.proxy.Enhancer |
createEnhancer(java.lang.Class<?> toMock) |
<T> T |
createProxy(java.lang.Class<T> toMock,
java.lang.reflect.InvocationHandler handler,
java.lang.reflect.Method[] mockedMethods,
ConstructorArgs args) |
java.lang.reflect.InvocationHandler |
getInvocationHandler(java.lang.Object mock)
Returns the invocation handler for
mock ; |
static boolean |
isCallerMockInvocationHandlerInvoke(java.lang.Throwable e) |
private static final net.sf.cglib.core.NamingPolicy ALLOWS_MOCKING_CLASSES_IN_SIGNED_PACKAGES
public static boolean isCallerMockInvocationHandlerInvoke(java.lang.Throwable e) throws java.lang.Throwable
java.lang.Throwable
public <T> T createProxy(java.lang.Class<T> toMock, java.lang.reflect.InvocationHandler handler, java.lang.reflect.Method[] mockedMethods, ConstructorArgs args)
createProxy
in interface IProxyFactory
T
- type of the class to mocktoMock
- the class to mock by the factoryhandler
- the handler that will be linked to the created proxymockedMethods
- the subset of toMock
'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.private net.sf.cglib.proxy.Enhancer createEnhancer(java.lang.Class<?> toMock)
public java.lang.reflect.InvocationHandler getInvocationHandler(java.lang.Object mock)
IProxyFactory
mock
;getInvocationHandler
in interface IProxyFactory
mock
- a mock instance previously returned by createProxy
.mock