This content has been marked as final.
Show 2 replies
-
1. Re: How to test my J2EE app with JUnit
carpy1970 Jun 8, 2004 3:43 AM (in response to majikshoe)There's an open source extention to JUnit called Cactus which you can use for testing server-side code. It's available from the apache foundation web site. it even contains tasks for ant, so you can automate your testing into you build process.
Another option (assuming you're doing all your JNDI lookups etc from one class, which you should me because it makes your code more maintainable) is to plug in a different implementaion of that class that does not do JNDI lookups etc. for testing. -
2. Re: How to test my J2EE app with JUnit
darranl Jun 8, 2004 5:35 AM (in response to majikshoe)1. Can I get a JNDI resouce from JBoss into a different VM (such as a Datasource made available to JUnit) so I may test these sorts of classes properly?
JNDI can be accessed from a different JVM, however Datasources can not be accessed remotely. If you use Cactus as sugested by Carpy you will be running in the same JVM so will be able to access them.2. If not, can I deploy a datasource config so that it is deployed in a Global scope, rather than "java:" local VM scope?
No