It's not a secret anymore!*
The moose likes Testing and the fly likes JUnit with  apache's  cactus Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "JUnit with  apache Watch "JUnit with  apache New topic
Author

JUnit with apache's cactus

ashok ks
Ranch Hand

Joined: Oct 31, 2003
Posts: 55
what is the advantage of using JUnit with apache's cactus ?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Cactus lets you run your JUnit tests inside a J2EE container while plain JUnit can only execute the tests within a vanilla JVM. This is an important difference if you want to, for example, test something that uses a DataSource from the JNDI tree or looks up an EJB from the same. In my experience, these tests are not that useful -- I prefer to mock up the JNDI context and other container-related interfaces so that I can execute the unit tests locally.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
but then, you'd not test the actual interaction with the container


42
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Jeroen Wenting:
but then, you'd not test the actual interaction with the container
Yes, but that's why we have automated functional tests
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Jeroen Wenting:
but then, you'd not test the actual interaction with the container

OTOH, testing inside the container can be painfully slow, so that we may want to run those tests less often.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JUnit with apache's cactus
 
Similar Threads
Tutorial for Cactus, JUnit
Server side testing
JUnit and Cactus
Welcome to Vincent Massol
Cactus and Junit