After wading through the sea of unit testing tools out there, here is a minimalist (and so far, sufficient) set of open-source tools for testing server-side centric Java code.
That is almost a given, full integration with Eclipse and Ant, standard in the industry, etc, etc. JUnit 4.1 is the last release where I did some thorough investigation of any new function, though the just released JUnit 4.7 (Aug/4th) has some function I would like to explore.
This is the best alternative for data-driven testing, where the test code is small but has to use different data inputs.
Side comment:This presentation cross-compares DDTUnit with other data-driven approaches:
Tip: The syntax for the test XML data can be a chore, but this Eclipse snippet (with instructions) can help:
This library allows you to pre-program objects in the JUnit testcase with the "right" responses to exercise the target code.
This library is used to replace Java calls ordinarily not under your control with code under your control.
For instance, you can intercept a call to DriverManager.getConnection and return your own implementation of java.sql.Connection.
Tip 1: This library requires you to add -java.agent=build_dir/libraries/test/jmockit/jmockit.jar to the unit execution path.
Tip 2: Avoid it if you can, it makes tests slower and harder to follow. If you have another entry point to pass a JMock object, such as setter method, do it.
Links I have bookmarked about unit testing recently: http://delicious.com/nastacio/unit-testing