Ehcache itself does not interact with databases, so here we test it as a second-level cache of Hibernate ORM, with PostgreSQL as a backing database.
Hibernate has a regression test suite to test integration with Ehcache. It resides in the directory hibernate-ehcache. You can run it exactly like other Hibernate test suites. See here for the procedure.