aspose file tools*
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
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 ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unit testing using dbunit