img
Figure 19-10. Investigating the code coverage
In the lower part, the Code Coverage view presents you with the code coverage of all the classes.
Since the test class was testing the ContactServiceImpl class, we can click the class and verify the
detailed code coverage information on the right side. In Figure 19-10 you can see that the code coverage
for the class is 75 percent (shown after the class on the left side). Double-click the class, which will open
it in the editor area. In the editor view, the tested code will have a green indicator on the left side, while
red indicates that the code was not called during testing. Consequently, you can visualize how much
code your test case has covered and see which methods or lines of code were not tested. It's a handy tool
to help you increase your code coverage.
Summary
In this chapter, we covered how to develop various kinds of unit testing in Spring-based applications
with the help of commonly used frameworks, libraries, and tools including JUnit, DBUnit, Mockito,
Selenium, and so on.
Search WWH :
Custom Search
Previous Page
Spring Framework 3 Topic Index
Next Page
Spring Framework 3 Bookmarks
Home