Mock is a widely used technology in unit test domain. It shields exteral and unnecessary factors and helps developers focus on the specific function to be tested.
EasyMock is a well known mock tool which can create mock object for given interface at runtime. The mock object's behavior can be fine defined prior the test code in the test case. EasyMock is based on java.lang.reflect.Proxy, which can create dynamic proxy class/object according to the given interfaces. It has the inherent limitation from the Proxy. It can create mock object for given interface only.
Mocquer is a similar mock tool as EasyMock. With the help of Dunamis Project, it extends the function of EasyMock to support mock object creation for both class and interface.
JMock is a library that supports test-driven development1 of Java2 code with mock objects3.
Mock objects help you design and test the interactions between the objects in your programs.
The jMock library:
* makes it quick and easy to define mock objects, so you don't break the rhythm of programming.
* lets you precisely specify the interactions between your objects, reducing the brittleness of your tests.
* works well with the autocompletion and refactoring features of your IDE
* plugs into your favourite test framework
* is easy to extend.