Apr 14th, 2009, 06:42 PM
Unit testing Hibernate DAO
I have some simple DAO classes that use Hibernate and connect to a real MySQL database.
In my unit test code how can I re-configure the system so it uses an in memory hssql database? I.e. I don't want to run my unit tests on the real database.
Thanks for any help,
Apr 14th, 2009, 07:50 PM
You can use Spring's unit testing framework for this. I assume that you have configured Hibernate in your application context.
In your unit test specific application context, you can plug in your in memory database configuration. You can look up information about using Spring's unit testing framework over here.
Tags for this Thread