File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Testing and the fly likes Unit testting for Struts application -JUnit or Cactus? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Unit testting for Struts application -JUnit or Cactus?" Watch "Unit testting for Struts application -JUnit or Cactus?" New topic
Author

Unit testting for Struts application -JUnit or Cactus?

Anitha Rajamuthu
Greenhorn

Joined: Jul 07, 2008
Posts: 2
Hi,

I am newbee to testing!

Have planned to use JUnit to perform unit testing for our existing struts application.

Had a glance over JUnit and Cactus . What is the difference between these two framework?To write testcases for struts action classes,forms and EJB's which framework we should go for?


We are using WSAD 5x IDE , I invoked JUnit plug in into it and i was able to write and execute a simple JUnit testcase for a sample add application and able to run JUnit and test the same.

Is it possible to write testcases for struts action classes,forms ..etc using JUnit syntax itself or we should go for cactus to start with the same.

Please, put your valuable guidance and suggestion on the same ASAP.

Thanks in advance.

Ani
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31057
    
232

Ani,
Welcome to JavaRanch!

First some terminology: unit tests are those which run without a server (or database), integration tests do use a server and database. JUnit is a framework that can be used for unit or integration testing. Cactus extends JUnit to provide more features for integration testing.

First you need to decide if you want to do unit testing or integration testing or both. I recommend writing JUnit unit tests for the lower level classes first (actions, EJBs, etc.) Then you can use Cactus to write an integration test to test the end to end/in container part.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unit testting for Struts application -JUnit or Cactus?