• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JUnitEE vs Cactus

 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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/
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic