December 2004
Intermediate to advanced
608 pages
11h 47m
English
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 ...