Unit Testing

In the last chapter, we learned how to create a web application that uses a database. In this chapter, we will learn how to write and execute unit tests in Eclipse for JEE applications. We will cover the following topics in this chapter:

  • Creating and executing unit tests using Eclipse JEE
  • Executing unit tests from Eclipse IDE
  • Mocking external dependencies for unit tests
  • Calculating unit test coverage

Testing the software that you develop is a very important part of the overall software development cycle. There are many types of testing; each one has a specific purpose, and each one varies in scope. Some examples of testing are functional testing, integration testing, scenario testing, and unit testing.

Of all these types, unit ...

Get Java EE 8 Development with Eclipse now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.