Package org.jmock.lib.legacy
Class ClassImposteriser
- java.lang.Object
-
- org.jmock.lib.legacy.ClassImposteriser
-
- All Implemented Interfaces:
Imposteriser
public class ClassImposteriser extends java.lang.Object implements Imposteriser
Deprecated.Java11 support is weak, Migrate to org.jmock.lib.imposters.ByteBuddyClassImposteriserThis class lets you imposterise abstract and concrete classes without calling the constructors of the mocked class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClassImposteriser.ClassWithSuperclassToWorkAroundCglibBug
Deprecated.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.reflect.Method
FINALIZE_METHOD
Deprecated.private static net.sf.cglib.proxy.CallbackFilter
IGNORED_METHODS
Deprecated.static Imposteriser
INSTANCE
Deprecated.private static net.sf.cglib.core.NamingPolicy
NAMING_POLICY_THAT_ALLOWS_IMPOSTERISATION_OF_CLASSES_IN_SIGNED_PACKAGES
Deprecated.private org.objenesis.Objenesis
objenesis
Deprecated.
-
Constructor Summary
Constructors Modifier Constructor Description private
ClassImposteriser()
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
canImposterise(java.lang.Class<?> type)
Deprecated.Reports if the Imposteriser is able to imposterise a given type.private static java.lang.reflect.Method
findFinalizeMethod()
Deprecated.<T> T
imposterise(Invokable mockObject, java.lang.Class<T> mockedType, java.lang.Class<?>... ancilliaryTypes)
Deprecated.Creates an imposter for a given type that forwardsInvocation
s to anInvokable
object.private java.lang.Class<?>[]
prepend(java.lang.Class<?> first, java.lang.Class<?>... rest)
Deprecated.private boolean
protectedPackageNamespace(java.lang.Class<?> mockedType)
Deprecated.private java.lang.Object
proxy(java.lang.Class<?> proxyClass, Invokable mockObject)
Deprecated.private java.lang.Class<?>
proxyClass(java.lang.Class<?> possibleMockedType, java.lang.Class<?>... ancilliaryTypes)
Deprecated.private void
setConstructorsAccessible(java.lang.Class<?> mockedType, boolean accessible)
Deprecated.private boolean
toStringMethodIsFinal(java.lang.Class<?> type)
Deprecated.
-
-
-
Field Detail
-
INSTANCE
public static final Imposteriser INSTANCE
Deprecated.
-
FINALIZE_METHOD
private static final java.lang.reflect.Method FINALIZE_METHOD
Deprecated.
-
NAMING_POLICY_THAT_ALLOWS_IMPOSTERISATION_OF_CLASSES_IN_SIGNED_PACKAGES
private static final net.sf.cglib.core.NamingPolicy NAMING_POLICY_THAT_ALLOWS_IMPOSTERISATION_OF_CLASSES_IN_SIGNED_PACKAGES
Deprecated.
-
IGNORED_METHODS
private static final net.sf.cglib.proxy.CallbackFilter IGNORED_METHODS
Deprecated.
-
objenesis
private final org.objenesis.Objenesis objenesis
Deprecated.
-
-
Method Detail
-
canImposterise
public boolean canImposterise(java.lang.Class<?> type)
Deprecated.Description copied from interface:Imposteriser
Reports if the Imposteriser is able to imposterise a given type.- Specified by:
canImposterise
in interfaceImposteriser
- Parameters:
type
- The type in question.- Returns:
- True if this imposteriser can imposterise type, false otherwise.
-
imposterise
public <T> T imposterise(Invokable mockObject, java.lang.Class<T> mockedType, java.lang.Class<?>... ancilliaryTypes)
Deprecated.Description copied from interface:Imposteriser
Creates an imposter for a given type that forwardsInvocation
s to anInvokable
object.- Specified by:
imposterise
in interfaceImposteriser
- Type Parameters:
T
- The static type of the imposter that is created.- Parameters:
mockObject
- The object that is to receive invocations forwarded from the imposter.mockedType
- The class representing the static type of the imposter.ancilliaryTypes
- Other types for the imposter. It must be possible to dynamically cast the imposter to these types. These types must all be interfaces because Java only allows single inheritance of classes.- Returns:
- A new imposter. The imposter must implement the mockedType and all the ancialliaryTypes.
-
toStringMethodIsFinal
private boolean toStringMethodIsFinal(java.lang.Class<?> type)
Deprecated.
-
setConstructorsAccessible
private void setConstructorsAccessible(java.lang.Class<?> mockedType, boolean accessible)
Deprecated.
-
proxyClass
private java.lang.Class<?> proxyClass(java.lang.Class<?> possibleMockedType, java.lang.Class<?>... ancilliaryTypes)
Deprecated.
-
proxy
private java.lang.Object proxy(java.lang.Class<?> proxyClass, Invokable mockObject)
Deprecated.
-
prepend
private java.lang.Class<?>[] prepend(java.lang.Class<?> first, java.lang.Class<?>... rest)
Deprecated.
-
findFinalizeMethod
private static java.lang.reflect.Method findFinalizeMethod()
Deprecated.
-
protectedPackageNamespace
private boolean protectedPackageNamespace(java.lang.Class<?> mockedType)
Deprecated.
-
-