• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JUnit with apache's cactus

 
ashok ks
Ranch Hand
Posts: 55
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the advantage of using JUnit with apache's cactus ?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but then, you'd not test the actual interaction with the container
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic