javahibernatewicketopen-session-in-viewwicket-tester

WicketTester with Hibernate


I'm currently figuring out how to make my Wicket Application testable.

Basically, it is a Wicket / Hibernate / Apache Derby setup. Hibernate is used as a filter (as seen on: http://community.jboss.org/wiki/OpenSessionInView / see HibernateSessionRequestFilter) and has a hibernate.cfg.xml file as configuration.

What I want to do is be able to use WicketTester with a custom database that I can rebuild from scratch each testrun. Ideally, a test would contain the connection parameters for Hibernate

Basically, my question is on how to dynamically or at startup-time switch my database?

And more abstract: what is a good approach for this kind of testing?


Solution

  • See Unit Testing Hibernate with HSQLDB.