O'Reilly logo

Apache Jakarta and Beyond: A Java Programmer’s Introduction by Larne Pekowsky

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 5. Testing Web Sites with HTTPUnit

The ability to test Java classes with a tool like JUnit is of great utility and importance. Because many applications are deployed as Web sites, it would also be tremendously useful to automate the testing of such applications. Manual testing of Web sites consists of a user interacting with the site through a browser, so any automated testing tool should mimic this interaction as closely as possible.

JUnit can be used as a first step toward this ideal testing tool. Writing a JUnit test is a matter of writing a Java class, so anything that can be expressed in Java can be tested. Listing 5.1 demonstrates this flexibility by showing a JUnit test that ensures that the string “Hello” appears on the first page ...

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