Hammock is a software that allows you to mock objects for Java ME.
Unit-testing with the xUnit family of test frameworks has become popular as agile development methodologies have gained acceptance. For J2ME there are several derivatives of JUnit (for example, JMUnit, J2MEUnit and MoMEUnit). The goal of unit testing is that each class should be tested in isolation from other classes. However, in practice, this can be difficult since classes need to collaborate to do anything useful. A popular method to work around this dependency problem is to use mock objects.
A mock object stands in for a real object that a class under test collaborates with. The test code specifies how the mock object should respond when the class under test calls methods on the mock object. By using a mock object rather than the real object we ensure that bugs in the collaborating class don't cause tests for the class under test to fail. Also, the use of mock objects allows us to simulate scenarios that may be difficult to configure for the real object (for example, a network fault).
- Added a plug-in for Eclipse.
- Fixed a bug (static inner classes can now be mocked).