O'Reilly logo

JUnit in Action by Ted Husted, Vincent Massol

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Unit-testing JSPs and taglibs

This chapter covers

  • Unit-testing a JSP in isolation with Cactus and mock objects

  • Running Cactus JSP tests with Maven

  • Unit-testing taglibs with Cactus

  • Unit-testing taglibs with mock objects and MockMaker

 

A test that can’t be repeated is worthless.

 
 --Brian Marick

In this chapter, we’ll continue with the Administration application we introduced in chapter 9. In chapter 9, we focused on unit-testing the servlet component of the application. In this chapter, we concentrate on the view components—namely the JavaServer Pages (JSPs) and custom tag libraries (taglibs).

We’ll cover unit-testing JSPs and taglibs with both Cactus and mock objects. The two techniques are complementary. Mock objects excel at writing focused, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required