public class PowerMock
extends org.powermock.api.support.membermodification.MemberModifier
Constructor and Description |
---|
PowerMock() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
createMock(java.lang.Class<T> type)
Creates a mock object that supports mocking of final and native methods.
|
static <T> T |
createMock(java.lang.Class<T> type,
org.easymock.ConstructorArgs constructorArgs,
java.lang.reflect.Method... methods)
Creates a mock object that supports mocking of final and native methods
and invokes a specific constructor.
|
static <T> T |
createMock(java.lang.Class<T> type,
java.lang.reflect.Method... methods)
Creates a mock object that supports mocking of final and native methods.
|
static <T> T |
createMock(java.lang.Class<T> type,
java.lang.Object... constructorArguments)
Creates a mock object that supports mocking of final and native methods
and invokes a specific constructor based on the supplied argument values.
|
static <T> T |
createMockAndExpectNew(java.lang.Class<T> type,
java.lang.Class<?>[] parameterTypes,
java.lang.Object... arguments)
Convenience method for createMock followed by expectNew when PowerMock
cannot determine which constructor to use automatically.
|
static <T> T |
createMockAndExpectNew(java.lang.Class<T> type,
java.lang.Object... arguments)
Convenience method for createMock followed by expectNew.
|
static <T> T |
createNiceMock(java.lang.Class<T> type)
Creates a nice mock object that supports mocking of final and native
methods.
|
static <T> T |
createNiceMock(java.lang.Class<T> type,
org.easymock.ConstructorArgs constructorArgs,
java.lang.reflect.Method... methods)
Creates a nice mock object that supports mocking of final and native
methods and invokes a specific constructor.
|
static <T> T |
createNiceMock(java.lang.Class<T> type,
java.lang.reflect.Method... methods)
Creates a nice mock object that supports mocking of final and native
methods.
|
static <T> T |
createNiceMock(java.lang.Class<T> type,
java.lang.Object... constructorArguments)
Creates a nice mock object that supports mocking of final and native
methods and invokes a specific constructor based on the supplied argument
values.
|
static <T> T |
createNiceMockAndExpectNew(java.lang.Class<T> type,
java.lang.Class<?>[] parameterTypes,
java.lang.Object... arguments)
Convenience method for createNiceMock followed by expectNew when
PowerMock cannot determine which constructor to use automatically.
|
static <T> T |
createNiceMockAndExpectNew(java.lang.Class<T> type,
java.lang.Object... arguments)
Convenience method for createNiceMock followed by expectNew.
|
static <T> T |
createNicePartialMock(java.lang.Class<T> type,
java.lang.Class<? super T> where,
java.lang.String... methodNames)
A utility method that may be used to nicely mock several methods in an
easy way (by just passing in the method names of the method you wish to
mock).
|
static <T> T |
createNicePartialMock(java.lang.Class<T> type,
java.lang.String... methodNames)
A utility method that may be used to nicely mock several methods in an
easy way (by just passing in the method names of the method you wish to
mock).
|
static <T> T |
createNicePartialMock(java.lang.Class<T> type,
java.lang.String[] methodNames,
java.lang.Object... constructorArguments)
* A utility method that may be used to nicely mock several methods in an
easy way (by just passing in the method names of the method you wish to
mock).
|
static <T> T |
createNicePartialMock(java.lang.Class<T> type,
java.lang.String methodName,
java.lang.Class<?>[] methodParameterTypes,
java.lang.Object... constructorArguments)
A utility method that may be used to nicely mock several methods in an
easy way (by just passing in the method names of the method you wish to
mock).
|
static <T> T |
createNicePartialMock(java.lang.Class<T> type,
java.lang.String methodName,
java.lang.Class<?>[] methodParameterTypes,
java.lang.Object[] constructorArguments,
java.lang.Class<?>[] constructorParameterTypes)
A utility method that may be used to nicely mock several methods in an
easy way (by just passing in the method names of the method you wish to
mock).
|
static <T> T |
createNicePartialMock(java.lang.Class<T> type,
java.lang.String methodNameToMock,
java.lang.Class<?> firstArgumentType,
java.lang.Class<?>... additionalArgumentTypes)
Nicely mock a single specific method.
|
static <T> T |
createNicePartialMockAndInvokeDefaultConstructor(java.lang.Class<T> type,
java.lang.String... methodNames)
A utility method that may be used to nicely mock several methods in an
easy way (by just passing in the method names of the method you wish to
mock).
|
static <T> T |
createNicePartialMockForAllMethodsExcept(java.lang.Class<T> type,
java.lang.String... methodNames)
A utility method that may be used to specify several methods that should
not be nicely mocked in an easy manner (by just passing in the
method names of the method you wish not to mock).
|
static <T> T |
createNicePartialMockForAllMethodsExcept(java.lang.Class<T> type,
java.lang.String methodNameToExclude,
java.lang.Class<?> firstArgumentType,
java.lang.Class<?>... moreTypes)
Mock all methods of a class except for a specific one nicely.
|
static <T> T |
createPartialMock(java.lang.Class<T> type,
java.lang.Class<? super T> where,
java.lang.String... methodNames)
A utility method that may be used to mock several methods in an easy way
(by just passing in the method names of the method you wish to mock).
|
static <T> T |
createPartialMock(java.lang.Class<T> type,
java.lang.String... methodNames)
A utility method that may be used to mock several methods in an easy way
(by just passing in the method names of the method you wish to mock).
|
static <T> T |
createPartialMock(java.lang.Class<T> type,
java.lang.String[] methodNames,
java.lang.Object... constructorArguments)
A utility method that may be used to mock several methods in an easy way
(by just passing in the method names of the method you wish to mock).
|
static <T> T |
createPartialMock(java.lang.Class<T> type,
java.lang.String methodName,
java.lang.Class<?>[] methodParameterTypes,
java.lang.Object... constructorArguments)
A utility method that may be used to mock several methods in an easy way
(by just passing in the method names of the method you wish to mock).
|
static <T> T |
createPartialMock(java.lang.Class<T> type,
java.lang.String methodName,
java.lang.Class<?>[] methodParameterTypes,
java.lang.Object[] constructorArguments,
java.lang.Class<?>[] constructorParameterTypes)
A utility method that may be used to mock several methods in an easy way
(by just passing in the method names of the method you wish to mock).
|
static <T> T |
createPartialMock(java.lang.Class<T> type,
java.lang.String methodNameToMock,
java.lang.Class<?> firstArgumentType,
java.lang.Class<?>... additionalArgumentTypes)
Mock a single specific method.
|
static <T> T |
createPartialMockAndInvokeDefaultConstructor(java.lang.Class<T> type,
java.lang.String... methodNames)
A utility method that may be used to mock several methods in an easy way
(by just passing in the method names of the method you wish to mock).
|
static <T> T |
createPartialMockForAllMethodsExcept(java.lang.Class<T> type,
java.lang.String... methodNames)
A utility method that may be used to specify several methods that should
not be mocked in an easy manner (by just passing in the method
names of the method you wish not to mock).
|
static <T> T |
createPartialMockForAllMethodsExcept(java.lang.Class<T> type,
java.lang.String methodNameToExclude,
java.lang.Class<?> firstArgumentType,
java.lang.Class<?>... moreTypes)
Mock all methods of a class except for a specific one.
|
static <T> T |
createStrictMock(java.lang.Class<T> type)
Creates a strict mock object that supports mocking of final and native
methods.
|
static <T> T |
createStrictMock(java.lang.Class<T> type,
org.easymock.ConstructorArgs constructorArgs,
java.lang.reflect.Method... methods)
Creates a strict mock object that supports mocking of final and native
methods and invokes a specific constructor.
|
static <T> T |
createStrictMock(java.lang.Class<T> type,
java.lang.reflect.Method... methods)
Creates a strict mock object that supports mocking of final and native
methods.
|
static <T> T |
createStrictMock(java.lang.Class<T> type,
java.lang.Object... constructorArguments)
Creates a strict mock object that supports mocking of final and native
methods and invokes a specific constructor based on the supplied argument
values.
|
static <T> T |
createStrictMockAndExpectNew(java.lang.Class<T> type,
java.lang.Class<?>[] parameterTypes,
java.lang.Object... arguments)
Convenience method for createStrictMock followed by expectNew when
PowerMock cannot determine which constructor to use automatically.
|
static <T> T |
createStrictMockAndExpectNew(java.lang.Class<T> type,
java.lang.Object... arguments)
Convenience method for createStrictMock followed by expectNew.
|
static <T> T |
createStrictPartialMock(java.lang.Class<T> type,
java.lang.Class<? super T> where,
java.lang.String... methodNames)
A utility method that may be used to strictly mock several methods in an
easy way (by just passing in the method names of the method you wish to
mock).
|
static <T> T |
createStrictPartialMock(java.lang.Class<T> type,
java.lang.String... methodNames)
A utility method that may be used to strictly mock several methods in an
easy way (by just passing in the method names of the method you wish to
mock).
|
static <T> T |
createStrictPartialMock(java.lang.Class<T> type,
java.lang.String[] methodNames,
java.lang.Object... constructorArguments)
* A utility method that may be used to strictly mock several methods in
an easy way (by just passing in the method names of the method you wish
to mock).
|
static <T> T |
createStrictPartialMock(java.lang.Class<T> type,
java.lang.String methodName,
java.lang.Class<?>[] methodParameterTypes,
java.lang.Object... constructorArguments)
A utility method that may be used to strictly mock several methods in an
easy way (by just passing in the method names of the method you wish to
mock).
|
static <T> T |
createStrictPartialMock(java.lang.Class<T> type,
java.lang.String methodName,
java.lang.Class<?>[] methodParameterTypes,
java.lang.Object[] constructorArguments,
java.lang.Class<?>[] constructorParameterTypes)
A utility method that may be used to strictly mock several methods in an
easy way (by just passing in the method names of the method you wish to
mock).
|
static <T> T |
createStrictPartialMock(java.lang.Class<T> type,
java.lang.String methodNameToMock,
java.lang.Class<?> firstArgumentType,
java.lang.Class<?>... additionalArgumentTypes)
Strictly mock a single specific method.
|
static <T> T |
createStrictPartialMockAndInvokeDefaultConstructor(java.lang.Class<T> type,
java.lang.String... methodNames)
A utility method that may be used to strictly mock several methods in an
easy way (by just passing in the method names of the method you wish to
mock).
|
static <T> T |
createStrictPartialMockForAllMethodsExcept(java.lang.Class<T> type,
java.lang.String... methodNames)
A utility method that may be used to specify several methods that should
not be strictly mocked in an easy manner (by just passing in the
method names of the method you wish not to mock).
|
static <T> T |
createStrictPartialMockForAllMethodsExcept(java.lang.Class<T> type,
java.lang.String methodNameToExclude,
java.lang.Class<?> firstArgumentType,
java.lang.Class<?>... moreTypes)
Mock all methods of a class except for a specific one strictly.
|
static org.easymock.IExpectationSetters<java.lang.Object> |
expectLastCall()
This method just delegates to EasyMock class extensions
EasyMock.expectLastCall() method. |
static <T> org.easymock.IExpectationSetters<T> |
expectNew(java.lang.Class<T> type,
java.lang.Class<?>[] parameterTypes,
java.lang.Object... arguments)
Allows specifying expectations on new invocations.
|
static <T> org.easymock.IExpectationSetters<T> |
expectNew(java.lang.Class<T> type,
java.lang.Object... arguments)
Allows specifying expectations on new invocations.
|
static <T> org.easymock.IExpectationSetters<T> |
expectNew(java.lang.String fullyQualifiedName,
java.lang.Object... arguments)
Allows specifying expectations on new invocations for private member
(inner) classes, local or anonymous classes.
|
static <T> org.easymock.IExpectationSetters<T> |
expectNiceNew(java.lang.Class<T> type,
java.lang.Class<?>[] parameterTypes,
java.lang.Object... arguments)
Allows specifying expectations on new invocations.
|
static <T> org.easymock.IExpectationSetters<T> |
expectNiceNew(java.lang.Class<T> type,
java.lang.Object... arguments)
Allows specifying expectations on new invocations.
|
static <T> org.easymock.IExpectationSetters<T> |
expectPrivate(java.lang.Class<?> clazz,
java.lang.reflect.Method method,
java.lang.Object... arguments)
Used to specify expectations on private static methods.
|
static <T> org.easymock.IExpectationSetters<T> |
expectPrivate(java.lang.Object instance,
java.lang.reflect.Method method,
java.lang.Object... arguments)
Used to specify expectations on private methods.
|
static <T> org.easymock.IExpectationSetters<T> |
expectPrivate(java.lang.Object instance,
java.lang.Object... arguments)
Used to specify expectations on methods without specifying a method name.
|
static <T> org.easymock.IExpectationSetters<T> |
expectPrivate(java.lang.Object instance,
java.lang.String methodName,
java.lang.Class<?>[] parameterTypes,
java.lang.Object... arguments)
Used to specify expectations on private methods.
|
static <T> org.easymock.IExpectationSetters<T> |
expectPrivate(java.lang.Object instance,
java.lang.String methodName,
java.lang.Class<?> where,
java.lang.Class<?>[] parameterTypes,
java.lang.Object... arguments)
Used to specify expectations on methods using the method name at a
specific place in the class hierarchy (specified by the
where parameter). |
static <T> org.easymock.IExpectationSetters<T> |
expectPrivate(java.lang.Object instance,
java.lang.String methodName,
java.lang.Class<?> where,
java.lang.Object... arguments)
Used to specify expectations on methods using the method name at a
specific place in the class hierarchy (specified by the
where parameter). |
static <T> org.easymock.IExpectationSetters<T> |
expectPrivate(java.lang.Object instance,
java.lang.String methodName,
java.lang.Object... arguments)
Used to specify expectations on methods using the method name.
|
static <T> org.easymock.IExpectationSetters<T> |
expectStrictNew(java.lang.Class<T> type,
java.lang.Class<?>[] parameterTypes,
java.lang.Object... arguments)
Allows specifying expectations on new invocations.
|
static <T> org.easymock.IExpectationSetters<T> |
expectStrictNew(java.lang.Class<T> type,
java.lang.Object... arguments)
Allows specifying expectations on new invocations.
|
static void |
mockStatic(java.lang.Class<?> type)
Enable static mocking for a class.
|
static void |
mockStatic(java.lang.Class<?> type,
java.lang.reflect.Method... methods)
Enable static mocking for a class.
|
static void |
mockStaticNice(java.lang.Class<?> type)
Enable nice static mocking for a class.
|
static void |
mockStaticNice(java.lang.Class<?> type,
java.lang.reflect.Method... methods)
Enable nice static mocking for a class.
|
static void |
mockStaticPartial(java.lang.Class<?> clazz,
java.lang.String... methodNames)
A utility method that may be used to mock several static methods
in an easy way (by just passing in the method names of the method you
wish to mock).
|
static void |
mockStaticPartial(java.lang.Class<?> clazz,
java.lang.String methodNameToMock,
java.lang.Class<?> firstArgumentType,
java.lang.Class<?>... additionalArgumentTypes)
Mock a single static method.
|
static void |
mockStaticPartialNice(java.lang.Class<?> clazz,
java.lang.String... methodNames)
A utility method that may be used to mock several static methods
(nice) in an easy way (by just passing in the method names of the method
you wish to mock).
|
static void |
mockStaticPartialNice(java.lang.Class<?> clazz,
java.lang.String methodNameToMock,
java.lang.Class<?> firstArgumentType,
java.lang.Class<?>... additionalArgumentTypes)
Mock a single static method (nice).
|
static void |
mockStaticPartialStrict(java.lang.Class<?> clazz,
java.lang.String... methodNames)
A utility method that may be used to mock several static methods
(strict) in an easy way (by just passing in the method names of the
method you wish to mock).
|
static void |
mockStaticPartialStrict(java.lang.Class<?> clazz,
java.lang.String methodNameToMock,
java.lang.Class<?> firstArgumentType,
java.lang.Class<?>... additionalArgumentTypes)
Mock a single static method (strict).
|
static void |
mockStaticStrict(java.lang.Class<?> type)
Enable strict static mocking for a class.
|
static void |
mockStaticStrict(java.lang.Class<?> type,
java.lang.reflect.Method... methods)
Enable strict static mocking for a class.
|
static void |
niceReplayAndVerify()
Sometimes it is useful to allow replay and verify on non-mocks.
|
static void |
replay(java.lang.Object... mocks)
Switches the mocks or classes to replay mode.
|
static void |
replayAll(java.lang.Object... additionalMocks)
Replay all classes and mock objects known by PowerMock.
|
static void |
reset(java.lang.Class<?>... classMocks)
Reset a list of class mocks.
|
static void |
reset(java.lang.Object... mocks)
Reset a list of mock objects or classes.
|
static void |
resetAll(java.lang.Object... additionalMocks)
Reset all classes and mock objects known by PowerMock.
|
static void |
suppressConstructor(java.lang.Class<?>... classes)
Deprecated.
Use
MemberModifier.suppress(Constructor[]) instead. |
static void |
suppressConstructor(java.lang.Class<?> clazz,
boolean excludePrivateConstructors)
Deprecated.
Use
MemberModifier.suppress(Constructor[]) instead. |
static void |
suppressConstructor(java.lang.reflect.Constructor<?>... constructors)
Deprecated.
Use
MemberModifier.suppress(Constructor[]) instead. |
static void |
suppressField(java.lang.Class<?>[] classes)
Deprecated.
Use
MemberModifier.suppress(Field[]) instead. |
static void |
suppressField(java.lang.Class<?> clazz,
java.lang.String... fieldNames)
Deprecated.
Use
MemberModifier.suppress(Field) instead. |
static void |
suppressField(java.lang.reflect.Field... fields)
Deprecated.
Use
MemberModifier.suppress(Field[]) instead. |
static void |
suppressMethod(java.lang.Class<?>[] classes)
Deprecated.
Use
MemberModifier.suppress(Method[]) instead. |
static void |
suppressMethod(java.lang.Class<?> clazz,
boolean excludePrivateMethods)
Deprecated.
Use
MemberModifier.suppress(Method[]) instead. |
static void |
suppressMethod(java.lang.Class<?> cls,
java.lang.Class<?>... additionalClasses)
Deprecated.
Use
MemberModifier.suppress(Method[]) instead. |
static void |
suppressMethod(java.lang.Class<?> clazz,
java.lang.String[] methodNames)
Deprecated.
Use
MemberModifier.suppress(Method[]) instead. |
static void |
suppressMethod(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.Class<?>[] parameterTypes)
Deprecated.
Use
MemberModifier.suppress(Method) instead. |
static void |
suppressMethod(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.String... additionalMethodNames)
Deprecated.
Use
MemberModifier.suppress(Method[]) instead. |
static void |
suppressMethod(java.lang.reflect.Method... methods)
Deprecated.
Use
MemberModifier.suppress(Method[]) instead. |
static void |
suppressSpecificConstructor(java.lang.Class<?> clazz,
java.lang.Class<?>... parameterTypes)
Deprecated.
Use
MemberModifier.suppress(Constructor) instead. |
static void |
verify(java.lang.Object... objects)
Switches the mocks or classes to verify mode.
|
static void |
verifyAll()
Verify all classes and mock objects known by PowerMock.
|
replace, stub, suppress, suppress, suppress, suppress, suppress, suppress, suppress
public static <T> T createMock(java.lang.Class<T> type, java.lang.reflect.Method... methods)
T
- the type of the mock objecttype
- the type of the mock objectmethods
- optionally what methods to mockpublic static <T> T createMock(java.lang.Class<T> type)
T
- the type of the mock objecttype
- the type of the mock objectpublic static <T> T createMock(java.lang.Class<T> type, org.easymock.ConstructorArgs constructorArgs, java.lang.reflect.Method... methods)
T
- the type of the mock objecttype
- the type of the mock objectconstructorArgs
- The constructor arguments that will be used to invoke a
special constructor.methods
- optionally what methods to mockpublic static <T> T createMock(java.lang.Class<T> type, java.lang.Object... constructorArguments)
T
- the type of the mock objecttype
- the type of the mock objectconstructorArguments
- The constructor arguments that will be used to invoke a
certain constructor.public static <T> T createStrictMock(java.lang.Class<T> type, java.lang.reflect.Method... methods)
T
- the type of the mock objecttype
- the type of the mock objectmethods
- optionally what methods to mockpublic static <T> T createStrictMock(java.lang.Class<T> type)
T
- the type of the mock objecttype
- the type of the mock objectpublic static <T> T createNiceMock(java.lang.Class<T> type, java.lang.reflect.Method... methods)
T
- the type of the mock objecttype
- the type of the mock objectmethods
- optionally what methods to mockpublic static <T> T createNiceMock(java.lang.Class<T> type)
T
- the type of the mock objecttype
- the type of the mock objectpublic static <T> T createStrictMock(java.lang.Class<T> type, org.easymock.ConstructorArgs constructorArgs, java.lang.reflect.Method... methods)
T
- the type of the mock objecttype
- the type of the mock objectconstructorArgs
- The constructor arguments that will be used to invoke a
special constructor.methods
- optionally what methods to mockpublic static <T> T createNiceMock(java.lang.Class<T> type, org.easymock.ConstructorArgs constructorArgs, java.lang.reflect.Method... methods)
T
- the type of the mock objecttype
- the type of the mock objectconstructorArgs
- The constructor arguments that will be used to invoke a
special constructor.methods
- optionally what methods to mockpublic static <T> T createStrictMock(java.lang.Class<T> type, java.lang.Object... constructorArguments)
T
- the type of the mock objecttype
- the type of the mock objectconstructorArguments
- The constructor arguments that will be used to invoke a
certain constructor.public static <T> T createNiceMock(java.lang.Class<T> type, java.lang.Object... constructorArguments)
T
- the type of the mock objecttype
- the type of the mock objectconstructorArguments
- The constructor arguments that will be used to invoke a
certain constructor.public static void mockStatic(java.lang.Class<?> type, java.lang.reflect.Method... methods)
type
- the class to enable static mockingmethods
- optionally what methods to mockpublic static void mockStatic(java.lang.Class<?> type)
type
- the class to enable static mockingpublic static void mockStaticStrict(java.lang.Class<?> type, java.lang.reflect.Method... methods)
type
- the class to enable static mockingmethods
- optionally what methods to mockpublic static void mockStaticStrict(java.lang.Class<?> type)
type
- the class to enable static mockingpublic static void mockStaticNice(java.lang.Class<?> type, java.lang.reflect.Method... methods)
type
- the class to enable static mockingmethods
- optionally what methods to mockpublic static void mockStaticNice(java.lang.Class<?> type)
type
- the class to enable static mockingpublic static <T> T createPartialMockForAllMethodsExcept(java.lang.Class<T> type, java.lang.String... methodNames)
type
. This method will
mock ALL methods that doesn't match the supplied name(s) regardless of
parameter types and signature. If this is not the case you should
fall-back on using the createMock(Class, Method...)
method
instead.T
- The type of the mock.type
- The type that'll be used to create a mock instance.methodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).public static <T> T createNicePartialMockForAllMethodsExcept(java.lang.Class<T> type, java.lang.String... methodNames)
type
. This method
will mock ALL methods that doesn't match the supplied name(s) regardless
of parameter types and signature. If this is not the case you should
fall-back on using the createMock(Class, Method...)
method
instead.T
- The type of the mock.type
- The type that'll be used to create a mock instance.methodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).public static <T> T createStrictPartialMockForAllMethodsExcept(java.lang.Class<T> type, java.lang.String... methodNames)
type
. This method
will mock ALL methods that doesn't match the supplied name(s) regardless
of parameter types and signature. If this is not the case you should
fall-back on using the createMock(Class, Method...)
method
instead.T
- The type of the mock.type
- The type that'll be used to create a mock instance.methodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).public static <T> T createPartialMockForAllMethodsExcept(java.lang.Class<T> type, java.lang.String methodNameToExclude, java.lang.Class<?> firstArgumentType, java.lang.Class<?>... moreTypes)
T
- The type of the mock.type
- The type that'll be used to create a mock instance.methodNameToExclude
- The name of the method not to mock.firstArgumentType
- The type of the first parameter of the method not to mockmoreTypes
- Optionally more parameter types that defines the method. Note
that this is only needed to separate overloaded methods.public static <T> T createNicePartialMockForAllMethodsExcept(java.lang.Class<T> type, java.lang.String methodNameToExclude, java.lang.Class<?> firstArgumentType, java.lang.Class<?>... moreTypes)
T
- The type of the mock.type
- The type that'll be used to create a mock instance.methodNameToExclude
- The name of the method not to mock.firstArgumentType
- The type of the first parameter of the method not to mockmoreTypes
- Optionally more parameter types that defines the method. Note
that this is only needed to separate overloaded methods.public static <T> T createStrictPartialMockForAllMethodsExcept(java.lang.Class<T> type, java.lang.String methodNameToExclude, java.lang.Class<?> firstArgumentType, java.lang.Class<?>... moreTypes)
T
- The type of the mock.type
- The type that'll be used to create a mock instance.methodNameToExclude
- The name of the method not to mock.firstArgumentType
- The type of the first parameter of the method not to mockmoreTypes
- Optionally more parameter types that defines the method. Note
that this is only needed to separate overloaded methods.public static <T> T createPartialMock(java.lang.Class<T> type, java.lang.String methodNameToMock, java.lang.Class<?> firstArgumentType, java.lang.Class<?>... additionalArgumentTypes)
T
- The type of the mock.type
- The type that'll be used to create a mock instance.methodNameToMock
- The name of the method to mockfirstArgumentType
- The type of the first parameter of the method to mockadditionalArgumentTypes
- Optionally more parameter types that defines the method. Note
that this is only needed to separate overloaded methods.public static <T> T createStrictPartialMock(java.lang.Class<T> type, java.lang.String methodNameToMock, java.lang.Class<?> firstArgumentType, java.lang.Class<?>... additionalArgumentTypes)
T
- The type of the mock.type
- The type that'll be used to create a mock instance.methodNameToMock
- The name of the method to mockfirstArgumentType
- The type of the first parameter of the method to mockadditionalArgumentTypes
- Optionally more parameter types that defines the method. Note
that this is only needed to separate overloaded methods.public static <T> T createNicePartialMock(java.lang.Class<T> type, java.lang.String methodNameToMock, java.lang.Class<?> firstArgumentType, java.lang.Class<?>... additionalArgumentTypes)
T
- The type of the mock.type
- The type that'll be used to create a mock instance.methodNameToMock
- The name of the method to mockfirstArgumentType
- The type of the first parameter of the method to mockadditionalArgumentTypes
- Optionally more parameter types that defines the method. Note
that this is only needed to separate overloaded methods.public static void mockStaticPartial(java.lang.Class<?> clazz, java.lang.String methodNameToMock, java.lang.Class<?> firstArgumentType, java.lang.Class<?>... additionalArgumentTypes)
clazz
- The class where the method is specified in.methodNameToMock
- The first argumentfirstArgumentType
- The first argument type.additionalArgumentTypes
- Optional additional argument types.public static void mockStaticPartialStrict(java.lang.Class<?> clazz, java.lang.String methodNameToMock, java.lang.Class<?> firstArgumentType, java.lang.Class<?>... additionalArgumentTypes)
clazz
- The class where the method is specified in.methodNameToMock
- The first argumentfirstArgumentType
- The first argument type.additionalArgumentTypes
- Optional additional argument types.public static void mockStaticPartialNice(java.lang.Class<?> clazz, java.lang.String methodNameToMock, java.lang.Class<?> firstArgumentType, java.lang.Class<?>... additionalArgumentTypes)
clazz
- The class where the method is specified in.methodNameToMock
- The first argumentfirstArgumentType
- The first argument type.additionalArgumentTypes
- Optional additional argument types.public static void mockStaticPartial(java.lang.Class<?> clazz, java.lang.String... methodNames)
type
. This method will mock ALL methods that match the
supplied name regardless of parameter types and signature. If this is the
case you should fall-back on using the
mockStatic(Class, Method...)
method instead.clazz
- The class that contains the static methods that should be
mocked.methodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling mockStatic(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).public static void mockStaticPartialStrict(java.lang.Class<?> clazz, java.lang.String... methodNames)
type
. This method will mock ALL methods that match the
supplied name regardless of parameter types and signature. If this is the
case you should fall-back on using the
mockStaticStrict(Class, Method...)
method instead.clazz
- The class that contains the static methods that should be
mocked.methodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling mockStatic(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).public static void mockStaticPartialNice(java.lang.Class<?> clazz, java.lang.String... methodNames)
type
. This method will mock ALL methods that match the
supplied name regardless of parameter types and signature. If this is the
case you should fall-back on using the
mockStaticStrict(Class, Method...)
method instead.clazz
- The class that contains the static methods that should be
mocked.methodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling mockStatic(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).public static <T> T createPartialMock(java.lang.Class<T> type, java.lang.String... methodNames)
type
.
This method will mock ALL methods that match the supplied name regardless
of parameter types and signature. If this is the case you should
fall-back on using the createMock(Class, Method...)
method
instead.T
- The type of the mock.type
- The type that'll be used to create a mock instance.methodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).public static <T> T createPartialMock(java.lang.Class<T> type, java.lang.Class<? super T> where, java.lang.String... methodNames)
type
.
This method will mock ALL methods that match the supplied name regardless
of parameter types and signature. If this is the case you should
fall-back on using the createMock(Class, Method...)
method
instead.
With this method you can specify where the class hierarchy the methods
are located. This is useful in, for example, situations where class A
extends B and both have a method called "mockMe" (A overrides B's mockMe
method) and you like to specify the only the "mockMe" method in B should
be mocked. "mockMe" in A should be left intact. In this case you should
do:
A tested = createPartialMock(A.class, B.class, "mockMe");
T
- The type of the mock.type
- The type that'll be used to create a mock instance.where
- Where in the class hierarchy the methods resides.methodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).public static <T> T createStrictPartialMock(java.lang.Class<T> type, java.lang.String... methodNames)
type
. This method will mock ALL methods that match the
supplied name regardless of parameter types and signature. If this is the
case you should fall-back on using the
createMock(Class, Method...)
method instead.T
- The type of the mock.type
- The type that'll be used to create a mock instance.methodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).public static <T> T createStrictPartialMock(java.lang.Class<T> type, java.lang.Class<? super T> where, java.lang.String... methodNames)
type
. This method will mock ALL methods that match the
supplied name regardless of parameter types and signature. If this is the
case you should fall-back on using the
createMock(Class, Method...)
method instead.
With this method you can specify where the class hierarchy the methods
are located. This is useful in, for example, situations where class A
extends B and both have a method called "mockMe" (A overrides B's mockMe
method) and you like to specify the only the "mockMe" method in B should
be mocked. "mockMe" in A should be left intact. In this case you should
do:
A tested = createPartialMockStrict(A.class, B.class, "mockMe");
T
- The type of the mock.type
- The type that'll be used to create a mock instance.where
- Where in the class hierarchy the methods resides.methodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).public static <T> T createNicePartialMock(java.lang.Class<T> type, java.lang.String... methodNames)
type
. This method will mock ALL methods that match the
supplied name regardless of parameter types and signature. If this is the
case you should fall-back on using the
createMock(Class, Method...)
method instead.T
- The type of the mock.type
- The type that'll be used to create a mock instance.methodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).public static <T> T createNicePartialMock(java.lang.Class<T> type, java.lang.Class<? super T> where, java.lang.String... methodNames)
type
. This method will mock ALL methods that match the
supplied name regardless of parameter types and signature. If this is the
case you should fall-back on using the
createMock(Class, Method...)
method instead.
With this method you can specify where the class hierarchy the methods
are located. This is useful in, for example, situations where class A
extends B and both have a method called "mockMe" (A overrides B's mockMe
method) and you like to specify the only the "mockMe" method in B should
be mocked. "mockMe" in A should be left intact. In this case you should
do:
A tested = createPartialMockNice(A.class, B.class, "mockMe");
T
- The type of the mock.type
- The type that'll be used to create a mock instance.where
- Where in the class hierarchy the methods resides.methodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).public static <T> T createPartialMockAndInvokeDefaultConstructor(java.lang.Class<T> type, java.lang.String... methodNames) throws java.lang.Exception
T
- the type of the mock objecttype
- the type of the mock objectmethodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).java.lang.Exception
public static <T> T createNicePartialMockAndInvokeDefaultConstructor(java.lang.Class<T> type, java.lang.String... methodNames) throws java.lang.Exception
T
- the type of the mock objecttype
- the type of the mock objectmethodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).java.lang.Exception
public static <T> T createStrictPartialMockAndInvokeDefaultConstructor(java.lang.Class<T> type, java.lang.String... methodNames) throws java.lang.Exception
T
- the type of the mock objecttype
- the type of the mock objectmethodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).java.lang.Exception
public static <T> T createPartialMock(java.lang.Class<T> type, java.lang.String[] methodNames, java.lang.Object... constructorArguments)
T
- the type of the mock objecttype
- the type of the mock objectmethodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).constructorArguments
- The constructor arguments that will be used to invoke a
certain constructor. (optional)public static <T> T createStrictPartialMock(java.lang.Class<T> type, java.lang.String[] methodNames, java.lang.Object... constructorArguments)
T
- the type of the mock objecttype
- the type of the mock objectmethodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).constructorArguments
- The constructor arguments that will be used to invoke a
certain constructor. (optional)public static <T> T createNicePartialMock(java.lang.Class<T> type, java.lang.String[] methodNames, java.lang.Object... constructorArguments)
T
- the type of the mock objecttype
- the type of the mock objectmethodNames
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).constructorArguments
- The constructor arguments that will be used to invoke a
certain constructor. (optional)public static <T> T createPartialMock(java.lang.Class<T> type, java.lang.String methodName, java.lang.Class<?>[] methodParameterTypes, java.lang.Object... constructorArguments)
T
- the type of the mock objecttype
- the type of the mock objectmethodName
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).methodParameterTypes
- Parameter types that defines the method. Note that this is
only needed to separate overloaded methods.constructorArguments
- The constructor arguments that will be used to invoke a
certain constructor. (optional)public static <T> T createStrictPartialMock(java.lang.Class<T> type, java.lang.String methodName, java.lang.Class<?>[] methodParameterTypes, java.lang.Object... constructorArguments)
T
- the type of the mock objecttype
- the type of the mock objectmethodName
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).methodParameterTypes
- Parameter types that defines the method. Note that this is
only needed to separate overloaded methods.constructorArguments
- The constructor arguments that will be used to invoke a
certain constructor. (optional)public static <T> T createNicePartialMock(java.lang.Class<T> type, java.lang.String methodName, java.lang.Class<?>[] methodParameterTypes, java.lang.Object... constructorArguments)
T
- the type of the mock objecttype
- the type of the mock objectmethodName
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).methodParameterTypes
- Parameter types that defines the method. Note that this is
only needed to separate overloaded methods.constructorArguments
- The constructor arguments that will be used to invoke a
certain constructor. (optional)public static <T> T createPartialMock(java.lang.Class<T> type, java.lang.String methodName, java.lang.Class<?>[] methodParameterTypes, java.lang.Object[] constructorArguments, java.lang.Class<?>[] constructorParameterTypes)
T
- the type of the mock objecttype
- the type of the mock objectmethodName
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).methodParameterTypes
- Parameter types that defines the method. Note that this is
only needed to separate overloaded methods.constructorArguments
- The constructor arguments that will be used to invoke a
certain constructor.constructorParameterTypes
- Parameter types that defines the constructor that should be
invoked. Note that this is only needed to separate overloaded
constructors.public static <T> T createStrictPartialMock(java.lang.Class<T> type, java.lang.String methodName, java.lang.Class<?>[] methodParameterTypes, java.lang.Object[] constructorArguments, java.lang.Class<?>[] constructorParameterTypes)
T
- the type of the mock objecttype
- the type of the mock objectmethodName
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).methodParameterTypes
- Parameter types that defines the method. Note that this is
only needed to separate overloaded methods.constructorArguments
- The constructor arguments that will be used to invoke a
certain constructor.constructorParameterTypes
- Parameter types that defines the constructor that should be
invoked. Note that this is only needed to separate overloaded
constructors.public static <T> T createNicePartialMock(java.lang.Class<T> type, java.lang.String methodName, java.lang.Class<?>[] methodParameterTypes, java.lang.Object[] constructorArguments, java.lang.Class<?>[] constructorParameterTypes)
T
- the type of the mock objecttype
- the type of the mock objectmethodName
- The names of the methods that should be mocked. If
null
, then this method will have the same effect
as just calling createMock(Class, Method...)
with the
second parameter as new Method[0]
(i.e. all
methods in that class will be mocked).methodParameterTypes
- Parameter types that defines the method. Note that this is
only needed to separate overloaded methods.constructorArguments
- The constructor arguments that will be used to invoke a
certain constructor.constructorParameterTypes
- Parameter types that defines the constructor that should be
invoked. Note that this is only needed to separate overloaded
constructors.public static <T> org.easymock.IExpectationSetters<T> expectPrivate(java.lang.Class<?> clazz, java.lang.reflect.Method method, java.lang.Object... arguments) throws java.lang.Exception
java.lang.Exception
public static <T> org.easymock.IExpectationSetters<T> expectPrivate(java.lang.Object instance, java.lang.reflect.Method method, java.lang.Object... arguments) throws java.lang.Exception
java.lang.Exception
public static <T> org.easymock.IExpectationSetters<T> expectPrivate(java.lang.Object instance, java.lang.String methodName, java.lang.Class<?>[] parameterTypes, java.lang.Object... arguments) throws java.lang.Exception
java.lang.Exception
public static <T> org.easymock.IExpectationSetters<T> expectPrivate(java.lang.Object instance, java.lang.String methodName, java.lang.Object... arguments) throws java.lang.Exception
java.lang.Exception
public static <T> org.easymock.IExpectationSetters<T> expectPrivate(java.lang.Object instance, java.lang.Object... arguments) throws java.lang.Exception
expectPrivate(Object, String, Object...)
.java.lang.Exception
public static <T> org.easymock.IExpectationSetters<T> expectPrivate(java.lang.Object instance, java.lang.String methodName, java.lang.Class<?> where, java.lang.Class<?>[] parameterTypes, java.lang.Object... arguments) throws java.lang.Exception
where
parameter). Works on for example private or package
private methods.
Use this for overloaded methods.java.lang.Exception
public static <T> org.easymock.IExpectationSetters<T> expectPrivate(java.lang.Object instance, java.lang.String methodName, java.lang.Class<?> where, java.lang.Object... arguments) throws java.lang.Exception
where
parameter). Works on for example private or package
private methods.java.lang.Exception
public static org.easymock.IExpectationSetters<java.lang.Object> expectLastCall()
EasyMock.expectLastCall()
method.EasyMock.expectLastCall()
public static void niceReplayAndVerify()
public static void replayAll(java.lang.Object... additionalMocks)
PrepareForTest
or
PrepareOnlyThisForTest
annotations and all classes that have had
their static initializers removed by using the
SuppressStaticInitializationFor
annotation. It also includes all
mock instances created by PowerMock such as those created or used by
createMock(Class, Method...)
,
mockStatic(Class, Method...)
,
expectNew(Class, Object...)
,
createPartialMock(Class, String...)
etc.
To make it easy to pass in additional mocks not created by the
PowerMock API you can optionally specify them as additionalMocks
. These are typically those mock objects you have created using pure
EasyMock or EasyMock class extensions. No additional mocks needs to be
specified if you're only using PowerMock API methods.
Note that the additionalMocks are also automatically verified
when invoking the verifyAll()
method.additionalMocks
- Mocks not created by the PowerMock API. These are typically
those mock objects you have created using pure EasyMock or
EasyMock class extensions.public static void resetAll(java.lang.Object... additionalMocks)
PrepareForTest
or
PrepareOnlyThisForTest
annotations and all classes that have had
their static initializers removed by using the
SuppressStaticInitializationFor
annotation. It also includes all
mock instances created by PowerMock such as those created or used by
createMock(Class, Method...)
,
mockStatic(Class, Method...)
,
expectNew(Class, Object...)
,
createPartialMock(Class, String...)
etc.
To make it easy to pass in additional mocks not created by the
PowerMock API you can optionally specify them as additionalMocks
. These are typically those mock objects you have created using pure
EasyMock or EasyMock class extensions. No additional mocks needs to be
specified if you're only using PowerMock API methods.additionalMocks
- Mocks not created by the PowerMock API. These are typically
those mock objects you have created using pure EasyMock or
EasyMock class extensions.public static void reset(java.lang.Class<?>... classMocks)
public static void reset(java.lang.Object... mocks)
public static void verifyAll()
PrepareForTest
or
PrepareOnlyThisForTest
annotations and all classes that have had
their static initializers removed by using the
SuppressStaticInitializationFor
annotation. It also includes all
mock instances created by PowerMock such as those created or used by
createMock(Class, Method...)
,
mockStatic(Class, Method...)
,
expectNew(Class, Object...)
,
createPartialMock(Class, String...)
etc.
Note that all additionalMocks passed to the
replayAll(Object...)
method are also verified here
automatically.public static void replay(java.lang.Object... mocks)
mocks
- mock objects or classes loaded by PowerMock.java.lang.RuntimeException
- If something unexpected goes wrong.public static void verify(java.lang.Object... objects)
objects
- mock objects or classes loaded by PowerMock.public static <T> T createMockAndExpectNew(java.lang.Class<T> type, java.lang.Object... arguments) throws java.lang.Exception
type
- The class that should be mocked.arguments
- The constructor arguments.java.lang.Exception
public static <T> T createMockAndExpectNew(java.lang.Class<T> type, java.lang.Class<?>[] parameterTypes, java.lang.Object... arguments) throws java.lang.Exception
int
and Integer
.type
- The class that should be mocked.parameterTypes
- The constructor parameter types.arguments
- The constructor arguments.java.lang.Exception
public static <T> T createNiceMockAndExpectNew(java.lang.Class<T> type, java.lang.Object... arguments) throws java.lang.Exception
type
- The class that should be mocked.arguments
- The constructor arguments.java.lang.Exception
public static <T> T createNiceMockAndExpectNew(java.lang.Class<T> type, java.lang.Class<?>[] parameterTypes, java.lang.Object... arguments) throws java.lang.Exception
int
and Integer
.type
- The class that should be mocked.parameterTypes
- The constructor parameter types.arguments
- The constructor arguments.java.lang.Exception
public static <T> T createStrictMockAndExpectNew(java.lang.Class<T> type, java.lang.Object... arguments) throws java.lang.Exception
type
- The class that should be mocked.arguments
- The constructor arguments.java.lang.Exception
public static <T> T createStrictMockAndExpectNew(java.lang.Class<T> type, java.lang.Class<?>[] parameterTypes, java.lang.Object... arguments) throws java.lang.Exception
int
and Integer
.type
- The class that should be mocked.parameterTypes
- The constructor parameter types.arguments
- The constructor arguments.java.lang.Exception
public static <T> org.easymock.IExpectationSetters<T> expectNew(java.lang.Class<T> type, java.lang.Class<?>[] parameterTypes, java.lang.Object... arguments) throws java.lang.Exception
expectNew(Class, Object...)
instead.java.lang.Exception
public static <T> org.easymock.IExpectationSetters<T> expectNew(java.lang.Class<T> type, java.lang.Object... arguments) throws java.lang.Exception
java.lang.Exception
public static <T> org.easymock.IExpectationSetters<T> expectNew(java.lang.String fullyQualifiedName, java.lang.Object... arguments) throws java.lang.Exception
fullyQualifiedName
- The fully-qualified name of the inner/local/anonymous type to
expect.arguments
- Optional number of arguments.java.lang.Exception
public static <T> org.easymock.IExpectationSetters<T> expectStrictNew(java.lang.Class<T> type, java.lang.Object... arguments) throws java.lang.Exception
java.lang.Exception
public static <T> org.easymock.IExpectationSetters<T> expectStrictNew(java.lang.Class<T> type, java.lang.Class<?>[] parameterTypes, java.lang.Object... arguments) throws java.lang.Exception
expectNew(Class, Object...)
instead.java.lang.Exception
public static <T> org.easymock.IExpectationSetters<T> expectNiceNew(java.lang.Class<T> type, java.lang.Object... arguments) throws java.lang.Exception
java.lang.Exception
public static <T> org.easymock.IExpectationSetters<T> expectNiceNew(java.lang.Class<T> type, java.lang.Class<?>[] parameterTypes, java.lang.Object... arguments) throws java.lang.Exception
expectNew(Class, Object...)
instead.java.lang.Exception
@Deprecated public static void suppressConstructor(java.lang.reflect.Constructor<?>... constructors)
MemberModifier.suppress(Constructor[])
instead.@Deprecated public static void suppressSpecificConstructor(java.lang.Class<?> clazz, java.lang.Class<?>... parameterTypes)
MemberModifier.suppress(Constructor)
instead.clazz
- The class where the constructor is located.parameterTypes
- The parameter types of the constructor to suppress.@Deprecated public static void suppressConstructor(java.lang.Class<?>... classes)
MemberModifier.suppress(Constructor[])
instead.classes
- The classes whose constructors will be suppressed.@Deprecated public static void suppressConstructor(java.lang.Class<?> clazz, boolean excludePrivateConstructors)
MemberModifier.suppress(Constructor[])
instead.clazz
- The classes whose constructors will be suppressed.excludePrivateConstructors
- optionally keep code in private constructors@Deprecated public static void suppressField(java.lang.reflect.Field... fields)
MemberModifier.suppress(Field[])
instead.@Deprecated public static void suppressField(java.lang.Class<?>[] classes)
MemberModifier.suppress(Field[])
instead.@Deprecated public static void suppressField(java.lang.Class<?> clazz, java.lang.String... fieldNames)
MemberModifier.suppress(Field)
instead.clazz
- The class whose methods will be suppressed.fieldNames
- The names of the methods that'll be suppressed. If field names
are empty, all fields in the supplied class will be
suppressed.@Deprecated public static void suppressMethod(java.lang.reflect.Method... methods)
MemberModifier.suppress(Method[])
instead.@Deprecated public static void suppressMethod(java.lang.Class<?> cls, java.lang.Class<?>... additionalClasses)
MemberModifier.suppress(Method[])
instead.cls
- The first class whose methods will be suppressed.additionalClasses
- Additional classes whose methods will be suppressed.@Deprecated public static void suppressMethod(java.lang.Class<?>[] classes)
MemberModifier.suppress(Method[])
instead.classes
- Classes whose methods will be suppressed.@Deprecated public static void suppressMethod(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.String... additionalMethodNames)
MemberModifier.suppress(Method[])
instead.clazz
- The class whose methods will be suppressed.methodName
- The first method to be suppress in class clazz
.additionalMethodNames
- Additional methods to suppress in class clazz
.@Deprecated public static void suppressMethod(java.lang.Class<?> clazz, java.lang.String[] methodNames)
MemberModifier.suppress(Method[])
instead.clazz
- The class whose methods will be suppressed.methodNames
- Methods to suppress in class clazz
.@Deprecated public static void suppressMethod(java.lang.Class<?> clazz, boolean excludePrivateMethods)
MemberModifier.suppress(Method[])
instead.clazz
- The class which methods will be suppressed.excludePrivateMethods
- optionally not suppress private methods@Deprecated public static void suppressMethod(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Class<?>[] parameterTypes)
MemberModifier.suppress(Method)
instead.