Spring/Hibernate/Junit example of testing DAO against HSQLDB
Posted
by Ryan P.
on Stack Overflow
See other posts from Stack Overflow
or by Ryan P.
Published on 2010-05-18T23:09:06Z
Indexed on
2010/05/18
23:10 UTC
Read the original article
Hit count: 364
Hi guys,
I'm working on trying to implement a JUnit test to check the functionality of a DAO. (The DAO will create/read a basic object/table relationship in HSQLDB).
The trouble I'm having is the persistence of the DAO (for the non-test code) is being completed through an in-house solution using Spring/Hibernate, which eliminates the usual *.hbm.xml templates that most examples I have found contain.
Beacuse of this, I'm having some trouble understanding how to setup a JUnit test to implement the DAO to create/read (just very basic funtionality) to an in-memory HSQLDB. I have found a few examples, but the usage of the in-house persistence means I can't extend some of the classes the examples show (I can't seem to get the application-context.xml setup properly).
Can anyone suggest any projects/examples I could take a look at (or any documentation) to further my understanding of the best way to implement this test functionality? I feel like this should be really simple, but I keep running into problems implementing the examples I have found.
Thanks in advance!
© Stack Overflow or respective owner