Java Reference
In-Depth Information
19.6
Summary
In this chapter we analyzed a few tools that complement
JU
nit, provide additional fea-
tures, or make some tasks more productive.
We learned three different ways to use mocks in our test cases in a more productive
way, how to leverage DbUnit usage through third-party annotations, many custom
assertions that cover a wide variety of object comparisons, and how to access private
fields without dealing with the low-level reflection
API
directly.
Some of the features analyzed were offered by more than one tool, which might
make it hard to decide which one to use. Although we described the pros and cons of
each option, typically the best option depends on the project's needs and your per-
sonal style. What is most important, though, is to be aware that such tools exist, so you
can evaluate them early in the project. The sooner such tools are used, the more time
is saved because of productivity gains.