This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes Cactus vs StrutsTestCase Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Cactus vs StrutsTestCase" Watch "Cactus vs StrutsTestCase" New topic
Author

Cactus vs StrutsTestCase

Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

I am joining a new project within two weeks that is going to use Struts, Hibernate, XDoclets, Ant etc. together in a Debian O/S plus Oracle backend. For that project we found that there are two primary testing strategies used in server-side testing: mock object (MO) and in-container (IC). I got a look of what is what but would like to know which approach is generally usedmore?
We also found two open source projects are popular for this testing - Apache Cactus and StrutsTestCase. Now which one should fit better testing Struts applications?
Any comment or lights please? :roll:


Ashik Uzzaman
Senior Member of Technical Staff, Salesforce.com, San Francisco, CA, USA.
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Personally, I don't like either solution. My perference is to not unit test Struts Actions at all. Generally, it is a good idea to keep as much business logic out of the Struts Actions as possible. If you achieve this goal then there is actually very little in the Actions that need to be tested, mainly routing logic, and this should be covered by funtionality tests... not unit tests.
The business logic that the Struts Actions use, can and should be unit tested. These classes, if designed properly, will be decoupled from Struts and the Servlet API. This removes the need for in-Container testing entirely.
Constructing applications in this fashion will make unit testing easier, faster, and more reliable. Furthermore, this will also lead to a more flexible and maintainable application.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Moving toTesting, Testing, One, Two, Three.
[ January 17, 2004: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cactus vs StrutsTestCase
 
Similar Threads
struts and cactus
Cactus plugin ???
How to test Struts Plugins
Can we perform unit testing with JUnit for Struts1 application
Cactus vs StrutsTestCase