ServletUnit -- How to acquire data sources?

Gordon Henriksen <[email protected]>
Newsgroups gmane.comp.web.httpunit.devel
Message-ID <[email protected]>
I'm evaluating ServletUnit for a new project. It's our first major  
server-side Java project.

ServletUnit looks like a useful framework (as long as it's conforming  
and un-buggy, anyhow), but I've got one question before I move ahead.  
How do I configure ServletUnit to create a JDBC data source? I'd like  
the servlet under test to be able to retrieve a database connection  
from JNDI much as if it were configured in the application server. I  
looked back through the archives and didn't notice any questions of  
the nature.

If that configuration is particularly complex, I'm considering  
backing off from ServletUnit and instead sticking to HttpUnit, with  
local test app servers for each developer; although convenient, and  
potentially powerful for replicating exceptional scenarios, the  
ServletUnit test environment is getting awfully disconnected from a  
realistic deployment environment. Application servers provide their  
own connection pools and soforth, and I assume I couldn't easily get  
a handle on the same implementations while running code under  
ServletUnit, which for most tests strikes me as a risk rather than a  
benefit.

Frankly, I don't think the systems group or co-developers will thank  
me for advocating a JNDI-based configuration, anyhow (“baroque” seems  
rather kind, from every angle), so I'm tempted to roll a .properties- 
based configuration. Do others have experience that to validate or  
refute this opinion?

— G



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.