File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unit testing using dbunit

 
nilu chan
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please advise as how can I unit test this kind of stuff ?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic