Skip to content

thinkinglabs/jpa2-integration-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jpa2-integration-tests

Build Status

This is an example on how you can test your JPA2 annotations against your real database schema taking schema migrations into account.

The integration tests first applies your database migrations against an in-memory database and then runs the test.

The example uses a lousy model of a company with employees. I would like to use a more complete model. Any better ideas are welcome.

How to build

The project was started at the time I didn't know better, so unfortunately it uses Apache Maven for building. There are plans to change the build tool.

To build and run the tests:

mvn clean install

Database migrations

The database migrations are expressed using Liquibase. For the definition, I used YAML which seemed a good idea, but I am a bit disappointed in the result. In my opinion the XML specification is far more expressive then the YAML version. And if you have an IDE that can handle the XML Schemas (which most can today), it is far more productive to specify it using XML as your IDE helps you with the completion (which is not happening with YAML).

Credits

The concept of how to test your JPA2 annotations is explained in the GOOS book by Nat Pryce and Steve Freeman.

About

How to test JPA2 annotations against a database schema

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages