After some annoyance about the usage of the Hamcrest matchers in
combination with JUnit, I have decided to replace them by those ones
supplied by FEST (see http://code.google.com/p/fest/).
For those with no previous experience with Hamcrest, the basic idea is
to write assertions in "fluent" expressions.
Take the example that I test that the Root object contains a
StateManager after creation:
assertThat(root.getStateManager()).isInstanceOf(StateManager.class);
Other usages is that it allows to assert if an object is inside a
collection etc.
More examples are in section 3 of the following guide:
https://github.com/alexruiz/fest-assert-2.x/wiki/One-minute-starting-guide
Given that there is a separate tree for all testing code (junit versus
src), I moved all libraries (junit, jmockito and FEST assertions) which
are used for testing only into a lib folder inside that tree.
Stefan
|