I've been thinking about EasyMock 3 for a while now. I'm starting to know what I'll put in there. So it's time for a little post about my roadmap just to ask the world what there think about it.

Merge EasyMock and EasyMock Class Extension

Originally, it was thought that mocking classes was caused by bad design. Years have passed and we now know that there are reasons that justify class mocking. Mainly legacy code and base class testing (where the tested class has mocked methods).

Also, even if we tried to make it as painless as possible, it can be annoying to juggle with EasyMock and EasyMock CE imports. So I would like to merge the two projects. However, I also have some requirements:

  • Be able to desactivate class mocking using EasyMock properties
  • Be able to mock interfaces without having cglib in dependencies

Mock private, final and static methods (and final classes)

This requires class instrumentation. So it's not that easy to do. The two possibilities are to have dedicated test runners for the main test frameworks (JUnit and TestNG) or to have JVM class instrumentation. Requirements are:

  • It should be an add-on over EasyMock normal behavior and totally optional
  • No test framework should be in dependency. This probably means that there should be dedicated a project for each test frameworks.

Shorter tests

The new EasyMockSupport is a little bit about that. But it want to do more to reduce the code needed to use EasyMock. This might also require dedicated test runners. Requirement:

  • Be backward compatible with EasyMock 2

Get rid of EasyMock 1 code

Java 5 is now used pretty much everywhere so everyone can use EasyMock 2 now. To clean the code, I want to remove the compatibility with EasyMock 1.

Annotations

I'm not a big fan of it but sometimes it can be useful to have test annotations on your business code. For instance to create mocks on all dependencies of an object at once. The requirements are:

  • The business code should only have annotations in dependency. No EasyMock code
  • It should be flexible enough allow strict and nice mocks to be created
  • If possible, EasyMock should work without the annotation dependency

Easier partial class mocking

I would like to provide a set of helpers to make partial class mocking easier.

Hamcrest and assertThat kind of matcher

These seem to get popularity so it would be nice to be able to have matchers using this syntax.

Be able to mock equals, toString and hashCode

The default behavior is a good thing most of the time. However, Being able to mock these two methods can be useful once in a while. So I think we should be able to overload the default.

Conclusion

As you can see, it's a pretty big roadmap. So I don't think everything will make it in the first version. Merging projects and getting rid of EasyMock 1 will be a good start.

What do you think?