Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

EasyMock is a mocking framework for Java. Here we look at EasyMock 2.2 which requires Java 5 and has the following benefits:

  • Hand-writing classes for Mock Objects is not needed.
  • Supports refactoring-safe Mock Objects: test code will not break at runtime when renaming methods or reordering method parameters
  • Supports return values and exceptions.
  • Supports checking the order of method calls, for one or more Mock Objects.

The sections below illustrate using EasyMock for the mocking parts of Using Testing Frameworks with Groovy.

The Item Storer Example

We are going to consider how you might use EasyMock as part of testing the Item Storer Example.

Here is how we can test JavaStorer:

  • No labels