So, in this how-to we will set up a unit-tests dedicated persistence unit and use HSQLDB as in-memory database for unit tests.

via Unit test JPA Entities with in-memory database « Eskatos’s thoughts.