-
Jun 3rd, 2007, 07:16 AM
#1
InitialContext using AbstractTransactionalSpringContextTests
Hi
I'm running Spring unit tests by subclassing AbstractTransactionalSpringContextTests. Some of my classes attempt to read environment properties from the web.xml, using
context = new javax.naming.InitialContext();
In the unit tests, that context cannot be initialised, error message is
Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
I'd really like to access my web.xml directly, without injecting property values (copy/paste from web.xml) into an environment object. How can I load the web.xml (or even just the env-entry nodes). Using Tomcat for deployment.
Thanks a lot
Simon
btw: I've found quite a few posts describing the exact problem, but no solution. I've come across the MockServletContext, but am not sure if that relates to the issue or not.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules