EasyMock 3.2 is out!

EasyMock 3.2 was just released.

Two main features:

Android support

Is it now possible to use EasyMock on Android. Thanks to Jesse Wilson for his help on this topic.

@Mock and @TestSubject annotations

A long awaited feature allowing to do code like this:

@RunWith(EasyMockRunner.class)
public class AnnotatedMockTest extends EasyMockSupport {
  @TestSubject
  private final ClassTested classUnderTest = new ClassTested();

  @Mock
  private Collaborator collaborator;

  @Test
  public void addDocument() {
    collaborator.documentAdded("New Document");
    replayAll();
    classUnderTest.addDocument("New Document", new byte[0]);
    verifyAll();
  }
}

instead of

public class AnnotatedMockTest extends EasyMockSupport {
  private final ClassTested classUnderTest = new ClassTested();
  private Collaborator collaborator = createMock(Collaborator.class);
  
  @Before
  public void before() {
    classUnderTest.setCollaborator(collaborator);
  }
  
  @Test
  public void addDocument() {
    collaborator.documentAdded("New Document");
    replayAll();
    classUnderTest.addDocument("New Document", new byte[0]);
    verifyAll();
  }
}

The complete release notes: http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=12103&version=17851