Summary


HttpUnit provides a flexible Java API for interacting with Web servers while maintaining client state and a powerful set of utilities that make writing assertions against HTTP responses easy. This chapter has covered the mechanics of writing basic HttpUnit code; explored the specifics of interacting with forms, tables, cookies, and opened the door to sophisticated automated testing with the development of a link-checking spider.

Functional testing with HttpUnit is more complex than unit testing with JUnit. Web site tests must be carefully structured, and you must strike a constant balance between thoroughness and time spent in test development. Writing a generic test framework like the link checker in this chapter can increase coverage without increasing time spent. The best argument in favor of the framework is that HttpUnit's flexibility lends itself to this type of development.




Professional Java Tools for Extreme Programming
Professional Java Tools for Extreme Programming: Ant, XDoclet, JUnit, Cactus, and Maven (Programmer to Programmer)
ISBN: 0764556177
EAN: 2147483647
Year: 2003
Pages: 228

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net