Chapter 12. Testing web components

This chapter covers

  • Testing HTTP session data
  • Testing static and dynamic web pages
  • Testing JSP components
  • Testing servlet code
  • Testing dynamic data before it is displayed
  • Using ServletUnit to simulate the web container

In this chapter we provide recipes for testing web components in isolation, rather than testing the web application as a whole. We divided the chapters this way because we use different technologies and approaches to test a web application than we do to test its components—the servlets, JSPs, Velocity templates, and what have you that make up the application. In short, we test web applications from end to end using HtmlUnit, something described in detail in chapter 13, “Testing J2EE Applications,” ...

Get JUnit Recipes 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.