Unit testing

For unit testing, Geomajas uses the JUnit library. At least each class implementing the public API  should have a unit test, testing all methods. Note that this rule does not stop anyone from making more tests J

Advantages of unit testing:

  • Capturing a Jira bug report in a reproducible manner.
  • Allowing you to specify exactly the behavior you want, before you start coding

 

How unit testing should be done, using JUnit 4:

  • Since JUnit 4 is annotation based, there is no need to start method names with "test" anymore. It is preferred to give the test methods the same name as the class methods they test.
  • The test will run automatically when executing a "mvn install". Moreover when committing a unit test, the continuous integration engine "Hudson" will also automatically run the tests and produce a report on the Geomajas commit mailing list.