Added integration-test provided by Erik-Berndt Scheper <erik.berndt.scheper@gmail...
[hibernate4-maven-plugin] / src / it / hibernate4-maven-plugin-envers-sample / README.md
1 Hibernate-4 maven plugin Envers sample project
2 ====================
3
4 Introduction
5 ---------------------
6
7 This is a sample project that can be used to demonstrate the [Hibernate4-maven-plugin](http://juplo.de/hibernate4-maven-plugin/)
8 in combination with the Hibernate Envers module.
9
10 The Maven pom.xml file contains the definitions to run the Hibernate4-maven-plugin.
11
12 The project code contains a JPA entity, an Envers audit revision entity and
13 a single integration test using an in-memory HSQLDB database.
14
15 The integration test performs the following actions:
16
17 *   Initialize a JTA environment using [Atomikos transaction essentials](http://www.atomikos.com/Main/TransactionsEssentials/)
18 *   Startup an XA datasource
19 *   Run the SQL-script to drop any existing tables in the HSQLDB database (script/drop-tables-hsqldb.sql)
20 *   Run the SQL-script to create the tables in the HSQLDB database (create-tables-hsqldb.sql)
21
22         Note: this script is created by the Hibernate4-maven-plugin
23
24 * Load the Hibernate (and Envers) configuration, including the validation of the database schema
25 * Persist and update entities that are audited by Hibernate Envers
26 * Verify the revisions and the audit tables
27
28 Usage
29 ---------------------
30
31 __Rebuild the SQL-script using the Hibernate4-maven-plugin to create the database__
32
33     mvn -PcreateHsqlDbScript clean compile hibernate4:export
34
35 __Build and run the integration tests__
36
37     mvn clean package
38