| Modifier and Type | Field and Description |
|---|---|
| public static final String | DISABLE_CLASS_MOCKING
Since EasyMock 3.0, EasyMock can perform class mocking directly without using the class extension. |
| public static final String | ENABLE_THREAD_SAFETY_CHECK_BY_DEFAULT
Since EasyMock 2.4, by default, a mock wasn't allowed to be called in
multiple threads unless it was made thread-safe (See
|
| public static final String | NOT_THREAD_SAFE_BY_DEFAULT
Since EasyMock 2.5, by default a mock is thread-safe. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | Returns: false.placeholder for the first expectation. first, boolean placeholder for the second expectation. second)Expects a boolean that matches both given expectations. |
| public static byte | Returns: 0.placeholder for the first expectation. first, byte placeholder for the second expectation. second)Expects a byte that matches both given expectations. |
| public static char | Returns: 0.placeholder for the first expectation. first, char placeholder for the second expectation. second)Expects a char that matches both given expectations. |
| public static double | Returns: 0.placeholder for the first expectation. first, double placeholder for the second expectation. second)Expects a double that matches both given expectations. |
| public static float | Returns: 0.placeholder for the first expectation. first, float placeholder for the second expectation. second)Expects a float that matches both given expectations. |
| public static int | Returns: 0.placeholder for the first expectation. first, int placeholder for the second expectation. second)Expects an int that matches both given expectations. |
| public static long | Returns: 0.placeholder for the first expectation. first, long placeholder for the second expectation. second)Expects a long that matches both given expectations. |
| public static short | Returns: 0.placeholder for the first expectation. first, short placeholder for the second expectation. second)Expects a short that matches both given expectations. |
| public static < the type of the object, it is passed through to prevent casts. T> T | Returns: null.placeholder for the first expectation. first, T placeholder for the second expectation. second)Expects an Object that matches both given expectations. |
| public static boolean | |
| public static byte | |
| public static char | |
| public static double | |
| public static float | |
| public static int | |
| public static long | |
| public static < type of the method argument to match T> T | |
| public static < type of the method argument to match T> T | |
| public static short | |
| public static String | |
| public static boolean[] | Returns: null.the given array. value)Expects a boolean array that is equal to the given array, i.e. it has to have the same length, and each element has to be equal. |
| public static byte[] | Returns: null.the given array. value)Expects a byte array that is equal to the given array, i.e. it has to have the same length, and each element has to be equal. |
| public static char[] | Returns: null.the given array. value)Expects a char array that is equal to the given array, i.e. it has to have the same length, and each element has to be equal. |
| public static double[] | Returns: null.the given array. value)Expects a double array that is equal to the given array, i.e. it has to have the same length, and each element has to be equal. |
| public static float[] | Returns: null.the given array. value)Expects a float array that is equal to the given array, i.e. it has to have the same length, and each element has to be equal. |
| public static int[] | Returns: null.the given array. value)Expects an int array that is equal to the given array, i.e. it has to have the same length, and each element has to be equal. |
| public static long[] | Returns: null.the given array. value)Expects a long array that is equal to the given array, i.e. it has to have the same length, and each element has to be equal. |
| public static short[] | Returns: null.the given array. value)Expects a short array that is equal to the given array, i.e. it has to have the same length, and each element has to be equal. |
| public static < the type of the array, it is passed through to prevent casts. T> T[] | Returns: null.the given array. value)Expects an Object array that is equal to the given array, i.e. it has to have the same type, length, and each element has to be equal. |
| public static < Type of the captured object T> T | |
| public static boolean | Returns: falseWhere the parameter is captured captured)Expect any boolean but captures it for later use. |
| public static byte | Returns: 0Where the parameter is captured captured)Expect any byte but captures it for later use. |
| public static char | Returns: 0Where the parameter is captured captured)Expect any char but captures it for later use. |
| public static double | Returns: 0Where the parameter is captured captured)Expect any double but captures it for later use. |
| public static float | Returns: 0Where the parameter is captured captured)Expect any float but captures it for later use. |
| public static int | Returns: 0Where the parameter is captured captured)Expect any int but captures it for later use. |
| public static long | Returns: 0Where the parameter is captured captured)Expect any long but captures it for later use. |
| public static void | checkIsUsedInOneThread(Object
the mock mock, boolean If the mock should be used in only one thread shouldBeUsedInOneThread)Tell that the mock should be used in only one thread. |
| public static void | checkOrder(Object
the mock object. mock, boolean true switches order checking on,
false switches it off.Switches order checking of the given mock object (more exactly: the control of the mock object) the on and off. |
| public static < type of the method argument to match T> T | Returns: nullthe given value. value, Comparator<? super T> Comparator used to compare the actual with expected value. comparator, LogicalOperator The comparison operator. operator)Expects an argument that will be compared using the provided comparator. |
| public static < type of the method argument to match T extends Comparable | Returns: null.the given value. value)Expects a comparable argument equals to the given value according to their compareTo method. |
| public static String | |
| public static IMocksControl | Returns: the control.the mock type type)Creates a control of the requested type. |
| public static IMocksControl | |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | Returns: the mock object.the type of the mock to be created. type, Class<?> the class or interface that should be mocked. toMock)Creates a mock object, of the requested type, that implements the given interface or extends the given class. |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | Returns: the mock object.the name of the mock object. name, MockType the type of the mock to be created. type, Class<?> the class or interface that should be mocked. toMock)Creates a mock object, of the requested type and name, that implements the given interface or extends the given class Note This is the old version of |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | Returns: the mock object.the class or interface that should be mocked. toMock)Creates a mock object that implements the given interface, order checking is disabled by default. |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | Returns: the mock object.the name of the mock object. name, Class<?> the class or interface that should be mocked. toMock)Creates a mock object that implements the given interface, order checking is disabled by default. |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> IMockBuildertoMock. | Returns: a mock builder to create a partial mockthe class or interface that should be mocked. toMock)Create a mock builder allowing to create a partial mock for the given class or interface. |
| public static IMocksControl | Returns: the control.Creates a control, order checking is disabled by default, and the mock
objects created by this control will return |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | Returns: the mock object.the class or interface that should be mocked. toMock)Creates a mock object that implements the given interface, order checking
is disabled by default, and the mock object will return |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | Returns: the mock object.the name of the mock object. name, Class<?> the class or interface that should be mocked. toMock)Creates a mock object that implements the given interface, order checking
is disabled by default, and the mock object will return |
| public static IMocksControl | |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | Returns: the mock object.the class or interface that should be mocked. toMock)Creates a mock object that implements the given interface, order checking is enabled by default. |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | Returns: the mock object.the name of the mock object. name, Class<?> the class or interface that should be mocked. toMock)Creates a mock object that implements the given interface, order checking is enabled by default. |
| public static String | |
| public static boolean | |
| public static byte | |
| public static char | |
| public static double | |
| public static float | |
| public static int | |
| public static long | |
| public static short | |
| public static < type of the method argument to match T> T | |
| public static double | Returns: 0.the given value. value, double the given delta. delta)Expects a double that has an absolute difference to the given value that is less than the given delta. |
| public static float | Returns: 0.the given value. value, float the given delta. delta)Expects a float that has an absolute difference to the given value that is less than the given delta. |
| public static < type returned by the expected method T> IExpectationSetters | Returns: the expectation setter.the parameter is used to transport the type to the
ExpectationSetter. It allows writing the expected call as
argument, i.e. expect(mock.getName()).andReturn("John Doe"). value)Returns the expectation setter for the last expected invocation in the current thread. |
| public static < type returned by the expected method T> IExpectationSetters | Returns: the expectation setter.Returns the expectation setter for the last expected invocation in the current thread. |
| public static String | |
| public static < type of the method argument to match T extends Comparable | Returns: null.the given value. value)Expects a comparable argument greater than or equal the given value. |
| public static byte | Returns: 0.the given value. value)Expects a byte argument greater than or equal to the given value. |
| public static double | Returns: 0.the given value. value)Expects a double argument greater than or equal to the given value. |
| public static float | Returns: 0.the given value. value)Expects a float argument greater than or equal to the given value. |
| public static int | Returns: 0.the given value. value)Expects an int argument greater than or equal to the given value. |
| public static long | Returns: 0.the given value. value)Expects a long argument greater than or equal to the given value. |
| public static short | Returns: 0.the given value. value)Expects a short argument greater than or equal to the given value. |
| private static AssertionError | |
| private static MocksControl | |
| private static <T> IExpectationSetters | |
| public static <T> T | |
| public static Object[] | Returns: the arguments of the current mock method call.Returns the arguments of the current mock method call, if inside an
|
| public static String | Returns: the property valuekey for the property key)Get the current value for an EasyMock property |
| private static RuntimeException | |
| public static < type of the method argument to match T extends Comparable | Returns: null.the given value. value)Expects a comparable argument greater than the given value. |
| public static byte | |
| public static double | |
| public static float | |
| public static int | |
| public static long | |
| public static short | |
| public static < the accepted type. T> T | |
| public static < type of the method argument to match T> T | |
| public static < type of the method argument to match T> T | |
| public static < type of the method argument to match T extends Comparable | Returns: null.the given value. value)Expects a comparable argument less than or equal the given value. |
| public static byte | Returns: 0.the given value. value)Expects a byte argument less than or equal to the given value. |
| public static double | Returns: 0.the given value. value)Expects a double argument less than or equal to the given value. |
| public static float | Returns: 0.the given value. value)Expects a float argument less than or equal to the given value. |
| public static int | Returns: 0.the given value. value)Expects an int argument less than or equal to the given value. |
| public static long | Returns: 0.the given value. value)Expects a long argument less than or equal to the given value. |
| public static short | Returns: 0.the given value. value)Expects a short argument less than or equal to the given value. |
| public static < type of the method argument to match T extends Comparable | |
| public static byte | |
| public static double | |
| public static float | |
| public static int | |
| public static long | |
| public static short | |
| public static void | makeThreadSafe(Object
the mock to make thread safe mock, boolean If the mock should be thread safe or not threadSafe)By default, a mock is thread safe (unless
|
| public static String | |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | |
| public static < type of the class to be captured T> Capture | Returns: the new capture objectCreate a new capture instance that will keep only the last captured value. |
| public static < type of the class to be captured T> Capture | Returns: the new capture objectcapture type wanted type)Create a new capture instance with a specific |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | Returns: the mock object.the name of the mock object. name, Class<?> the class or interface that should be mocked. toMock)Creates a mock object that implements the given interface, order checking
is disabled by default, and the mock object will return |
| public static boolean | Returns: false.placeholder for the expectation. first)Expects a boolean that does not match the given expectation. |
| public static byte | Returns: 0.placeholder for the expectation. first)Expects a byte that does not match the given expectation. |
| public static char | Returns: 0.placeholder for the expectation. first)Expects a char that does not match the given expectation. |
| public static double | Returns: 0.placeholder for the expectation. first)Expects a double that does not match the given expectation. |
| public static float | Returns: 0.placeholder for the expectation. first)Expects a float that does not match the given expectation. |
| public static int | Returns: 0.placeholder for the expectation. first)Expects an int that does not match the given expectation. |
| public static long | Returns: 0.placeholder for the expectation. first)Expects a long that does not match the given expectation. |
| public static short | Returns: 0.placeholder for the expectation. first)Expects a short that does not match the given expectation. |
| public static < the type of the object, it is passed through to prevent casts. T> T | Returns: null.placeholder for the expectation. first)Expects an Object that does not match the given expectation. |
| public static < type of the method argument to match T> T | |
| public static < type of the method argument to match T> T | |
| public static boolean | Returns: false.placeholder for the first expectation. first, boolean placeholder for the second expectation. second)Expects a boolean that matches one of the given expectations. |
| public static byte | Returns: 0.placeholder for the first expectation. first, byte placeholder for the second expectation. second)Expects a byte that matches one of the given expectations. |
| public static char | Returns: 0.placeholder for the first expectation. first, char placeholder for the second expectation. second)Expects a char that matches one of the given expectations. |
| public static double | Returns: 0.placeholder for the first expectation. first, double placeholder for the second expectation. second)Expects a double that matches one of the given expectations. |
| public static float | Returns: 0.placeholder for the first expectation. first, float placeholder for the second expectation. second)Expects a float that matches one of the given expectations. |
| public static int | Returns: 0.placeholder for the first expectation. first, int placeholder for the second expectation. second)Expects an int that matches one of the given expectations. |
| public static long | Returns: 0.placeholder for the first expectation. first, long placeholder for the second expectation. second)Expects a long that matches one of the given expectations. |
| public static short | Returns: 0.placeholder for the first expectation. first, short placeholder for the second expectation. second)Expects a short that matches one of the given expectations. |
| public static < the type of the object, it is passed through to prevent casts. T> T | Returns: null.placeholder for the first expectation. first, T placeholder for the second expectation. second)Expects an Object that matches one of the given expectations. |
| public static < the class that the mock object should extend. T> IMockBuilder | Returns: a mock builder to create a partial mockthe class or interface that should be mocked. toMock)Create a mock builder allowing to create a partial mock for the given class or interface. |
| public static void | |
| public static void | reportMatcher(IArgumentMatcher
the matcher to use to match currently mocked method argument matcher)Reports an argument matcher. |
| public static void | |
| public static void | resetToDefault(Object...
the mock objects mocks)Resets the given mock objects (more exactly: the controls of the mock objects) and turn them to a mock with default behavior. |
| public static void | resetToNice(Object...
the mock objects mocks)Resets the given mock objects (more exactly: the controls of the mock objects) and turn them to a mock with nice behavior. |
| public static void | resetToStrict(Object...
the mock objects mocks)Resets the given mock objects (more exactly: the controls of the mock objects) and turn them to a mock with strict behavior. |
| public static < the type of the object, it is passed through to prevent casts. T> T | |
| public static String | Returns: the previous property valueproperty key key, String property value. A null value will remove the property value)Set a property to modify the default EasyMock behavior. |
| public static String | Returns: null.the prefix. prefix)Expects a string that starts with the given prefix. |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | Returns: the mock object.the class or interface that should be mocked. toMock)Creates a mock object that implements the given interface, order checking is enabled by default. |
| public static < the class or interface that the mock object should extend/implement. It is expected to be of
class T> TtoMock. | Returns: the mock object.the name of the mock object. name, Class<?> the class or interface that should be mocked. toMock)Creates a mock object that implements the given interface, order checking is enabled by default. |
| public static void | |
| public static void | |
| public static void | verifyUnexpectedCalls(Object...
the mock objects. mocks)Verifies that no unexpected call was performed. |