Home Freemagazine Issue3 Database Testing with DbUnit



Database Testing with DbUnit
Posted on: October 8, 2010 at 12:00 AM
DbUnit is an open source Framework created by Manuel Laflamme. This is a powerful tool for simplifying Unit Testing of the database operations.

Database Testing with DbUnit

       


DbUnit:

DbUnit is an open source Framework created by Manuel Laflamme. This is a powerful tool for simplifying Unit Testing of the database operations. It extends the popular JUnit test framework that puts the database into known state while the test executes. This strategy helps to avoid the problem that can occur when one test corrupts the database and causes subsequent test to fail. DbUnit provides a very simple XML based mechanism for loading the test data, in the form of data set in XML file, before a test runs. Moreover the database can be placed back into its pre-test state at the completion of the test.
 

  1. Setting up the environment
    To run the example of DbUnit in Eclipse, we need jar files of DbUnit, JUnit and Jakarta Commons IO. DbUnit is available from DbUnit web site, http://www.dbunit.org. JUnit is available from http:// www.junit.org. commons-io-1.3.2.jar can be found from http://mirrors.kahuki.com/ apache/commons/io/binaries /commons-io- 1.3.2-bin.zip. Now these jar files are required to be added in the referenced library of your testing directory.

Read more at:

http://www.javajazzup.com/issue3/page40.shtml

 

       

Related Tags for Database Testing with DbUnit:


More Tutorials from this section

Ask Questions?    Discuss: Database Testing with DbUnit  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.