Java Reference
In-Depth Information
3.7
Summary
As you saw in chapter 1, it isn't hard to jump in and begin writing JU nit tests for your
applications. In this chapter, we created a test case for a simple but complete applica-
tion controller. Rather than test a single component, the test case examined how sev-
eral components worked together. We started with a bootstrap test case that could be
used with any class. Then we added new tests to the test case one by one until all of the
original components were under test. Because the assertions were getting more and
more complicated, we found a way to simplify them by means of the Hamcrest match-
ers. We expect this package to grow, so we created a second source code directory for
the test classes. Because the test and domain source directories are part of the same
package, we can still test protected and package default members.
In the next chapter, we put unit testing in perspective with other types of tests that
you need to perform on your applications. We also talk about how unit testing fits in
the development lifecycle.
 
Search WWH ::




Custom Search