Results 1 to 2 of 2

Thread: Unit testing Hibernate DAO

  1. #1

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

    Default

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •