I read this book called Java Tools for Extreme Programming, and I heard that it covers just this topic. Have you heard of it? It was the number 1 software development book (under the category software development) for three month on Amazon. I heard the author is a really nice guy too.
Cactus is a simple test framework for unit testing server-side java code (Servlets, EJBs, Tag Libs, Filters, ...). The intent of Cactus is to lower the cost of writing tests for server-side code. It uses JUnit and extends it. Cactus has been developed with the idea of automatic testing in mind and it provides a packaged and simple mechanism based on Ant to automate server-side testing. Cactus implements an in-container strategy (click on the diagram below to understand how it works). An alternative but complementary approach not covered by Cactus is to use Mock Objects (see the Mock vs Container page to understand the differences and why Cactus believes in the usefulness of an in-container approach).
[ October 13, 2002: Message edited by: Rick Hightower ]
Just to add to this, if you want more flexibility in the way that you test JSP custom tags (if you use them of course), then check out the TagUnit testing framework - an open source project that I started up. The key difference is that in Cactus you have to test custom tags by writing the Java code to mimic their lifecycle, whereas TagUnit tests the tags inside the JSP making the tests much easier to write. Apart from that, a combination of Cactus + JUnit + JUnitEE + HttpUnit is a good (although not the only) route. Cheers Simon
Joined: Feb 20, 2002
Cool. I'll check it out. We have been using Cactus to test our tags.
Joined: May 29, 2001
Thanks for the reply. Its a privilege to have recieved replies from two such emminent personalities. I have started with Junit and once I am through , maybe cactus. Reagrds, Milan