Next page | Contents page |

EasyMock

Comes from http://easymock.org. Current version (Jan 09) is 2.4.

Version 2.x is significantly different from v1.x - it uses Java 5 and it no longer uses a MockControl object which was a major feature of the earlier version.

Methods of class EasyMock itself are all static so use a static import:

import static org.easymock.EasyMock.*;

Using a mock object in JUnit tests usually involves several steps, the first of which is
Create the mock, using method createMock(class-literal). Eg,

	Order order1 = createMock (Order.class);
Next page | Contents page |