How you usually test your serverside applications?
Doshi Milan
Ranch Hand
Joined: May 29, 2001
Posts: 112
posted
0
Dear friends, How you usually test your serverside applications?I also mean Servlets , JSPs , besides EJBs. Thanks and regards, Milan Doshi
Rick Hightower
Author
Ranch Hand
Joined: Feb 20, 2002
Posts: 350
posted
0
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.
<giggle> At eBlox we used Cactus to unit test out Local EJBs, Custom Tags, Servlets, JSP Support classes, Struts actions, etc. Cactus a.k.a J2EEUnit
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
Rick Hightower
Author
Ranch Hand
Joined: Feb 20, 2002
Posts: 350
posted
0
Cool. I'll check it out. We have been using Cactus to test our tags.
Doshi Milan
Ranch Hand
Joined: May 29, 2001
Posts: 112
posted
0
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
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: How you usually test your serverside applications?