|
|
||
Tom White's BlogjMock 2 and my Java Unit Testing ToolkitPosted by tomwhite on April 11, 2007 at 06:16 AM | Comments (2)The long-awaited final version of jMock 2 was released today. There are some big changes since version one. For example, you can now write
and then set expectations on the returned
(This means that the This change means that you can refactor your method names without breaking your tests, unlike jMock 1 where the method names were strings:
You may have noticed that the new syntax is a little weird (check out the double braces, and how e.g. will modifiers need new statements), and it may take a little getting used to, but I think it's worth it for the IDE completion and refactoring support. For example, in test driven mode I can write the name of the method that doesn't yet exist then get my IDE to create the method for me. The other nice thing is the integration with Hamcrest (a library of matchers that I've written about before). My toolkit for writing new unit tests now includes:
Bookmark blog post: CommentsComments are listed in date ascending order (oldest first) | Post Comment
| ||
|
|