NareshKumar wrote:
I am new to DBUnit library, please clarify me regarding the below statements at the earliest:
According to my knowledge dbunit is mainly used in setting up the proper test data in the database, before execution of a particular test case/suite.
My Question: Is DBUnit an in-memory database (or) can we setup DBunit as an in memory database?
You need to pick a database technology to use with dbunit.
I'm working on a project now where we use two database technologies with dbunit. For simple query testing we use hsql as an in-memory datasource which is fast an relatively easy to populate.
For queries which rely on stored procedures or functions, we connect to a test instance of SQL server which we populate with xml data using dbunit, but is also pre-configured with the user functions we need.
To make things easier, we're using a Spring application.xml file to define the data sources and dao references. Our Junit setup methods open up the application.xml file, extracts the DAO object(s) it needs and uses the IDataSet object to populate the tables we need for the test.