This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Testing and the fly likes JUnitEE vs Cactus Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » Testing
Reply Bookmark "JUnitEE vs Cactus" Watch "JUnitEE vs Cactus" New topic
Author

JUnitEE vs Cactus

Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Hi,
Both of the websites for these frameworks make note of each other.

I'm just not too clear right now on how they differ from each other. Both frameworks note that one can use the other. Cactus notes that you can use JUnitEE to run your tests from a browser and JUnitEE notes that Cactus has a really useful ant task.

Does anyone have experience with either or both of these tools? I'd like to hear your opinions

cactus: http://jakarta.apache.org/cactus/
junitee: http://junitee.sourceforge.net/
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1860
JUnitEE is a much simpler framework than Cactus, and provides a mechanism with which to invoke regular JUnit tests inside the container. You write your JUnit tests as normal and deploy them along with your application. You then (from your browser) request a predefined Servlet and tell it which JUnit tests to run. The results are then presented to you in a readble HTML form.
Cactus on the other hand is a much more complex beast and provides you with a ready-made set of classes from which you can write tests for Servlets, JSPs, taglibs and EJBs.
With JUnitEE, writing standard JUnit tests doesn't provide you with easy access to the environment, meaning that you can't easily run assertions on things like the current ServletRequest, response, etc. The classes (test cases) that you extend in Cactus provide you with wrappers to the actual objects that are currently "live" within the server. In other words, you can actually get access to things like the current ServletRequest and run assertions against it.
<shameless plug>
The thing that I don't like about Cactus is its support for testing JSP custom tags as you have to test them by writing the code to mimic the way that the JSP container uses them. If you need to test custom tags, check out TagUnit for an alternative that allows you to write tests within JSP.
</shameless plug>
Cheers
Simon
Tina Coleman
Ranch Hand

Joined: Dec 12, 2001
Posts: 150
I've set up my JUnit tests as part of my Ant build process in the past to verify that a build was good. Is that possible with either of these frameworks? E.g., I write test cases to test my servlet, and then as part of the build/deploy cycle, run the test set to verify that all is well in development land.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JUnitEE vs Cactus
 
Similar Threads
Using JUnit remotely
the cactus framework eclipse plugin
Mixing Junit & Cactus tests - but wanting to run from client with minimal classpath
Please suggest Testing strategy for JCA adapter
Freeware Tool to test JSP