samedi 25 avril 2015

Unit testing after adding database with hibernate

I've added database functionality using hibernate to a system which was in memory up to this point. When all the data was it memory I was able to use Junit which restored the original data after each test. Is there a way to achieve the same result with the new hibernate addition? By "the same result" I mean start with the database at its original state, do test which can alter the database, and restore the database to its original posion.

Up until now my ideas are:

  1. In memory database (which is an hibernate feature) but that won't allow me to use my actual data.
  2. Add "testing flag" to me DOA won't commit the changes if set.

I am sure there is a better solution, but I haven't found anything better yet.

Aucun commentaire:

Enregistrer un commentaire