Today I had the pleasure to play with the current CVS version of jMock 2.
Most important changes in jMock 2:
1.
In jMock 1 the method signature of expected method calls had to be coded as a string and so refactoring mocked classes was not very easy.
Now expected method calls in my mocks are now easily refactorable since jMock 2 makes use of generics.
2.
jMock 1 was depending heavily on JUnit.
jMock 2 is test framework independent, it has special “plugins” for each framework. – The only plugin I’m currently missing is one for TestNG, but it’s on the TODO list – though you can use it with TestNG even without a plugin.
3.
The great constraints api from jMock 1 is now a seperate framework called Ham Crest (which is a anagram of matchers ;o)). It’s completely safe to use with and without jMock or any other (test) framework.
My conclusion after day one with jMock 2: The successor to the great jMock 1 is now even better and yet very stable for a pre-beta release.
Kudos to the whole jMock Team.