background preloader

Mock

Facebook Twitter

Realsolve - Mock Object Testing With EasyMock 2. An introduction and tutorial on Mock Object testing using EasyMock.

Realsolve - Mock Object Testing With EasyMock 2

By Phil Zoio, 21 April, 2007 In this article, I look closely at the EasyMock library. Long standing users of EasyMock will have noticed that the version 2.x API has been radically overhauled to use Java 5 generics. The result is a powerful and easy to use Mock Objects implementation, which really simplifies unit testing of classes with complex dependencies. Team Blog » Unit Testing with Stubs and Mocks. Tom White's Blog: Literate Programming with jMock. Posted by tomwhite on May 11, 2006 at 11:10 AM PDT We've been using jMock at our company for some time now.

Tom White's Blog: Literate Programming with jMock

We've found it great for test driven development and isolating our unit tests from the rest of the system more effectively. One aspect of jMock that stands out for me is its idea of constraints. In fact, we've found this idea so useful that we always use the org.jmock.MockObjectTestCase base class rather than junit.framework.TestCase, even when we aren't mocking anything out. This seems to have registered with the jMock development team, as they are planning to extract the constraints into a separate project, codenamed Hamcrest (it's an anagram of "matchers").