This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Testing and the fly likes Unit testing using dbunit 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 "Unit testing using dbunit" Watch "Unit testing using dbunit" New topic
Author

Unit testing using dbunit

nilu chan
Greenhorn

Joined: Aug 31, 2010
Posts: 17
I have written a DAO class which handles all CRUD operations and want to unit test it. The database is already loaded with data. I tried to use dbunit but my application fails to create a connection with the DB as I am using JNDI service for creating a connection at server startup whereas my dbunit test looks for the connection at compile time. How can I overcome this issue? Do I need to do major refactoring? Any useful article on the web replicating a this scenario would also help.

MasterDao.java



DBUtils.java



MasterDaoTest.java




nilu chan
Greenhorn

Joined: Aug 31, 2010
Posts: 17
Please advise as how can I unit test this kind of stuff ?
 
 
subject: Unit testing using dbunit
 
Similar Threads
database access outside of servlet container
Coonection pooling problem.....
CMT and Stateless SessionBean
Database access, potential threading problem?
SQL query takes too long to execute?