O'Reilly logo

Learning Jakarta Struts 1.2: a concise and practical tutorial by Stephan Wiesner

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

13.7 Testing: HTTPUnit

As Mozart said, when he wrote music, the notes flowed so fluently and flawlessly onto the paper it was as if he were guided by heavenly inspiration. Alas, we ordinary mortals are bereft of this capacity when we write code, and so we must test our software before release. You can learn a lot from the TestFirst Approach (see Glossary). JUnit is a small application for testing Java methods (http://www.junit.org). It is very well suited for testing the Model classes, but unfortunately not for testing Web interfaces.

HTTPUnit (http://httpunit.sourceforge.net/) is an extension of JUnit, created to solve exactly this problem. It lets us call pages, fill forms, and click buttons. Naturally, it takes longer to set up a test than ...

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