Announcement Announcement Module
Collapse
No announcement yet.
Unit testing Hibernate DAO Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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,
    Fred

  • #2
    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.

    http://static.springframework.org/sp...e/testing.html

    Comment

    Working...
    X