From d7c7a224ec7fcd450ffb9a99eecfaefcb1a38ef1 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 5 Apr 2019 13:05:45 +0200 Subject: [PATCH] Configured the 5.0.12-tutorials as integration-test for the plugin --- src/it/tutorials-5.0.12/annotations/pom.xml | 24 +++++++++++ .../src/test/resources/hibernate.cfg.xml | 5 +-- src/it/tutorials-5.0.12/basic/pom.xml | 23 +++++++++++ .../src/test/resources/hibernate.cfg.xml | 2 +- src/it/tutorials-5.0.12/entitymanager/pom.xml | 24 +++++++++++ .../test/resources/META-INF/persistence.xml | 2 +- src/it/tutorials-5.0.12/envers/pom.xml | 24 +++++++++++ src/it/tutorials-5.0.12/envers/pom.xml.orig | 41 +++++++++++++++++++ .../test/resources/META-INF/persistence.xml | 2 +- .../tutorials-5.0.12/osgi/managed-jpa/pom.xml | 21 ++++++++++ .../osgi/unmanaged-jpa/pom.xml | 19 +++++++++ .../main/resources/META-INF/persistence.xml | 4 +- .../osgi/unmanaged-native/pom.xml | 19 +++++++++ .../src/main/resources/hibernate.cfg.xml | 2 +- .../src/main/resources/pool-one.properties | 4 +- src/it/tutorials-5.0.12/pom.xml | 1 + .../tutorials-5.0.12/schema-annotations.sql | 7 ++++ src/it/tutorials-5.0.12/schema-basic.sql | 7 ++++ .../tutorials-5.0.12/schema-entitymanager.sql | 7 ++++ src/it/tutorials-5.0.12/schema-envers.sql | 27 ++++++++++++ .../schema-osgi-managed-jpa.sql | 7 ++++ .../schema-osgi-unmanaged-jpa.sql | 7 ++++ .../schema-osgi-unmanaged-native.sql | 26 ++++++++++++ src/it/tutorials-5.0.12/verify.bsh | 19 +++++++++ 24 files changed, 312 insertions(+), 12 deletions(-) create mode 100644 src/it/tutorials-5.0.12/envers/pom.xml.orig create mode 100644 src/it/tutorials-5.0.12/schema-annotations.sql create mode 100644 src/it/tutorials-5.0.12/schema-basic.sql create mode 100644 src/it/tutorials-5.0.12/schema-entitymanager.sql create mode 100644 src/it/tutorials-5.0.12/schema-envers.sql create mode 100644 src/it/tutorials-5.0.12/schema-osgi-managed-jpa.sql create mode 100644 src/it/tutorials-5.0.12/schema-osgi-unmanaged-jpa.sql create mode 100644 src/it/tutorials-5.0.12/schema-osgi-unmanaged-native.sql create mode 100644 src/it/tutorials-5.0.12/verify.bsh diff --git a/src/it/tutorials-5.0.12/annotations/pom.xml b/src/it/tutorials-5.0.12/annotations/pom.xml index 093eca6e..bd3c793f 100644 --- a/src/it/tutorials-5.0.12/annotations/pom.xml +++ b/src/it/tutorials-5.0.12/annotations/pom.xml @@ -23,6 +23,30 @@ true + @project.version@ + + + + + de.juplo + hibernate-maven-plugin + ${hibernate-maven-plugin.version} + + + process-test-classes + + create + + + + + true + true + + + + + diff --git a/src/it/tutorials-5.0.12/annotations/src/test/resources/hibernate.cfg.xml b/src/it/tutorials-5.0.12/annotations/src/test/resources/hibernate.cfg.xml index a9590c18..df29d830 100644 --- a/src/it/tutorials-5.0.12/annotations/src/test/resources/hibernate.cfg.xml +++ b/src/it/tutorials-5.0.12/annotations/src/test/resources/hibernate.cfg.xml @@ -15,7 +15,7 @@ org.h2.Driver - jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE + jdbc:h2:${project.build.directory}/db/test;MVCC=TRUE sa @@ -31,9 +31,6 @@ true - - create - diff --git a/src/it/tutorials-5.0.12/basic/pom.xml b/src/it/tutorials-5.0.12/basic/pom.xml index 49936a74..e4f952c4 100644 --- a/src/it/tutorials-5.0.12/basic/pom.xml +++ b/src/it/tutorials-5.0.12/basic/pom.xml @@ -23,6 +23,29 @@ true + @project.version@ + + + + de.juplo + hibernate-maven-plugin + ${hibernate-maven-plugin.version} + + + process-test-classes + + create + + + + + true + true + + + + + diff --git a/src/it/tutorials-5.0.12/basic/src/test/resources/hibernate.cfg.xml b/src/it/tutorials-5.0.12/basic/src/test/resources/hibernate.cfg.xml index 03d39373..df55e966 100644 --- a/src/it/tutorials-5.0.12/basic/src/test/resources/hibernate.cfg.xml +++ b/src/it/tutorials-5.0.12/basic/src/test/resources/hibernate.cfg.xml @@ -15,7 +15,7 @@ org.h2.Driver - jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE + jdbc:h2:${project.build.directory}/db/test;MVCC=TRUE sa diff --git a/src/it/tutorials-5.0.12/entitymanager/pom.xml b/src/it/tutorials-5.0.12/entitymanager/pom.xml index 2b586d59..8bf2771f 100644 --- a/src/it/tutorials-5.0.12/entitymanager/pom.xml +++ b/src/it/tutorials-5.0.12/entitymanager/pom.xml @@ -23,6 +23,7 @@ true + @project.version@ @@ -33,4 +34,27 @@ + + + + de.juplo + hibernate-maven-plugin + ${hibernate-maven-plugin.version} + + + process-test-classes + + create + + + + + true + org.hibernate.dialect.H2Dialect + true + + + + + diff --git a/src/it/tutorials-5.0.12/entitymanager/src/test/resources/META-INF/persistence.xml b/src/it/tutorials-5.0.12/entitymanager/src/test/resources/META-INF/persistence.xml index 0fc95238..edf70053 100644 --- a/src/it/tutorials-5.0.12/entitymanager/src/test/resources/META-INF/persistence.xml +++ b/src/it/tutorials-5.0.12/entitymanager/src/test/resources/META-INF/persistence.xml @@ -18,7 +18,7 @@ - + diff --git a/src/it/tutorials-5.0.12/envers/pom.xml b/src/it/tutorials-5.0.12/envers/pom.xml index 67542048..14df2963 100644 --- a/src/it/tutorials-5.0.12/envers/pom.xml +++ b/src/it/tutorials-5.0.12/envers/pom.xml @@ -23,6 +23,7 @@ true + @project.version@ @@ -38,4 +39,27 @@ + + + + de.juplo + hibernate-maven-plugin + ${hibernate-maven-plugin.version} + + + process-test-classes + + create + + + + + true + org.hibernate.dialect.H2Dialect + true + + + + + diff --git a/src/it/tutorials-5.0.12/envers/pom.xml.orig b/src/it/tutorials-5.0.12/envers/pom.xml.orig new file mode 100644 index 00000000..67542048 --- /dev/null +++ b/src/it/tutorials-5.0.12/envers/pom.xml.orig @@ -0,0 +1,41 @@ + + + + + 4.0.0 + + + org.hibernate.tutorials + hibernate-tutorials + 5.0.12.Final + ../pom.xml + + + hibernate-tutorial-envers + Hibernate Envers Tutorial + Hibernate tutorial illustrating basic set up and use of Envers + + + + true + + + + + org.hibernate + hibernate-envers + 5.0.12.Final + + + org.hibernate + hibernate-entitymanager + 5.0.12.Final + + + + diff --git a/src/it/tutorials-5.0.12/envers/src/test/resources/META-INF/persistence.xml b/src/it/tutorials-5.0.12/envers/src/test/resources/META-INF/persistence.xml index 45a7dafe..fadc2a30 100644 --- a/src/it/tutorials-5.0.12/envers/src/test/resources/META-INF/persistence.xml +++ b/src/it/tutorials-5.0.12/envers/src/test/resources/META-INF/persistence.xml @@ -18,7 +18,7 @@ - + diff --git a/src/it/tutorials-5.0.12/osgi/managed-jpa/pom.xml b/src/it/tutorials-5.0.12/osgi/managed-jpa/pom.xml index 55ccacd3..35ad150e 100644 --- a/src/it/tutorials-5.0.12/osgi/managed-jpa/pom.xml +++ b/src/it/tutorials-5.0.12/osgi/managed-jpa/pom.xml @@ -12,6 +12,10 @@ 1.0.0 bundle + + @project.version@ + + org.hibernate.javax.persistence @@ -65,6 +69,23 @@ + + de.juplo + hibernate-maven-plugin + ${hibernate-maven-plugin.version} + + + + create + + + + + jdbc:h2:mem:db_managed_jpa;MVCC=TRUE + true + false + + diff --git a/src/it/tutorials-5.0.12/osgi/unmanaged-jpa/pom.xml b/src/it/tutorials-5.0.12/osgi/unmanaged-jpa/pom.xml index 05e394b5..8ee36fea 100644 --- a/src/it/tutorials-5.0.12/osgi/unmanaged-jpa/pom.xml +++ b/src/it/tutorials-5.0.12/osgi/unmanaged-jpa/pom.xml @@ -12,6 +12,10 @@ 1.0.0 bundle + + @project.version@ + + org.hibernate.javax.persistence @@ -76,6 +80,21 @@ + + de.juplo + hibernate-maven-plugin + ${hibernate-maven-plugin.version} + + true + + + + + create + + + + diff --git a/src/it/tutorials-5.0.12/osgi/unmanaged-jpa/src/main/resources/META-INF/persistence.xml b/src/it/tutorials-5.0.12/osgi/unmanaged-jpa/src/main/resources/META-INF/persistence.xml index b0ebfe70..788ccab9 100644 --- a/src/it/tutorials-5.0.12/osgi/unmanaged-jpa/src/main/resources/META-INF/persistence.xml +++ b/src/it/tutorials-5.0.12/osgi/unmanaged-jpa/src/main/resources/META-INF/persistence.xml @@ -15,10 +15,10 @@ - + - \ No newline at end of file + diff --git a/src/it/tutorials-5.0.12/osgi/unmanaged-native/pom.xml b/src/it/tutorials-5.0.12/osgi/unmanaged-native/pom.xml index ab10019e..0e5ad4e4 100644 --- a/src/it/tutorials-5.0.12/osgi/unmanaged-native/pom.xml +++ b/src/it/tutorials-5.0.12/osgi/unmanaged-native/pom.xml @@ -12,6 +12,10 @@ 1.0.0 bundle + + @project.version@ + + org.hibernate.javax.persistence @@ -84,6 +88,21 @@ + + de.juplo + hibernate-maven-plugin + ${hibernate-maven-plugin.version} + + true + + + + + create + + + + diff --git a/src/it/tutorials-5.0.12/osgi/unmanaged-native/src/main/resources/hibernate.cfg.xml b/src/it/tutorials-5.0.12/osgi/unmanaged-native/src/main/resources/hibernate.cfg.xml index 7f9f2380..175a2bf8 100644 --- a/src/it/tutorials-5.0.12/osgi/unmanaged-native/src/main/resources/hibernate.cfg.xml +++ b/src/it/tutorials-5.0.12/osgi/unmanaged-native/src/main/resources/hibernate.cfg.xml @@ -12,7 +12,7 @@ org.h2.Driver - jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE + jdbc:h2:mem:db_unmanaged_native;DB_CLOSE_DELAY=-1;MVCC=TRUE sa org.hibernate.dialect.H2Dialect diff --git a/src/it/tutorials-5.0.12/osgi/unmanaged-native/src/main/resources/pool-one.properties b/src/it/tutorials-5.0.12/osgi/unmanaged-native/src/main/resources/pool-one.properties index 7e1c4cf1..0085971f 100644 --- a/src/it/tutorials-5.0.12/osgi/unmanaged-native/src/main/resources/pool-one.properties +++ b/src/it/tutorials-5.0.12/osgi/unmanaged-native/src/main/resources/pool-one.properties @@ -5,9 +5,9 @@ # See the lgpl.txt file in the root directory or . # jdbc-0.proxool.alias=pool-one -jdbc-0.proxool.driver-url=jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE +jdbc-0.proxool.driver-url=jdbc:h2:mem:db_unmanaged_native;DB_CLOSE_DELAY=-1;MVCC=TRUE jdbc-0.proxool.driver-class=org.h2.Driver jdbc-0.user=sa jdbc-0.password= jdbc-0.proxool.maximum-connection-count=2 -jdbc-0.proxool.house-keeping-test-sql=select CURRENT_DATE \ No newline at end of file +jdbc-0.proxool.house-keeping-test-sql=select CURRENT_DATE diff --git a/src/it/tutorials-5.0.12/pom.xml b/src/it/tutorials-5.0.12/pom.xml index 5aac7936..1e1ed76f 100644 --- a/src/it/tutorials-5.0.12/pom.xml +++ b/src/it/tutorials-5.0.12/pom.xml @@ -70,6 +70,7 @@ src/test/resources + true diff --git a/src/it/tutorials-5.0.12/schema-annotations.sql b/src/it/tutorials-5.0.12/schema-annotations.sql new file mode 100644 index 00000000..48eb18ef --- /dev/null +++ b/src/it/tutorials-5.0.12/schema-annotations.sql @@ -0,0 +1,7 @@ + + create table EVENTS ( + id bigint not null, + EVENT_DATE timestamp, + title varchar(255), + primary key (id) + ); diff --git a/src/it/tutorials-5.0.12/schema-basic.sql b/src/it/tutorials-5.0.12/schema-basic.sql new file mode 100644 index 00000000..c5e2c0e7 --- /dev/null +++ b/src/it/tutorials-5.0.12/schema-basic.sql @@ -0,0 +1,7 @@ + + create table EVENTS ( + EVENT_ID bigint not null, + EVENT_DATE timestamp, + title varchar(255), + primary key (EVENT_ID) + ); diff --git a/src/it/tutorials-5.0.12/schema-entitymanager.sql b/src/it/tutorials-5.0.12/schema-entitymanager.sql new file mode 100644 index 00000000..48eb18ef --- /dev/null +++ b/src/it/tutorials-5.0.12/schema-entitymanager.sql @@ -0,0 +1,7 @@ + + create table EVENTS ( + id bigint not null, + EVENT_DATE timestamp, + title varchar(255), + primary key (id) + ); diff --git a/src/it/tutorials-5.0.12/schema-envers.sql b/src/it/tutorials-5.0.12/schema-envers.sql new file mode 100644 index 00000000..ecec80ef --- /dev/null +++ b/src/it/tutorials-5.0.12/schema-envers.sql @@ -0,0 +1,27 @@ + + create table EVENTS ( + id bigint not null, + EVENT_DATE timestamp, + title varchar(255), + primary key (id) + ); + + create table EVENTS_AUD ( + id bigint not null, + REV integer not null, + REVTYPE tinyint, + EVENT_DATE timestamp, + title varchar(255), + primary key (id, REV) + ); + + create table REVINFO ( + REV integer generated by default as identity, + REVTSTMP bigint, + primary key (REV) + ); + + alter table EVENTS_AUD + add constraint FK5cembm6xahf542q8e4h0pq2t1 + foreign key (REV) + references REVINFO; diff --git a/src/it/tutorials-5.0.12/schema-osgi-managed-jpa.sql b/src/it/tutorials-5.0.12/schema-osgi-managed-jpa.sql new file mode 100644 index 00000000..de92e463 --- /dev/null +++ b/src/it/tutorials-5.0.12/schema-osgi-managed-jpa.sql @@ -0,0 +1,7 @@ +create sequence hibernate_sequence start with 1 increment by 1; + + create table DataPoint ( + id bigint not null, + name varchar(255), + primary key (id) + ); diff --git a/src/it/tutorials-5.0.12/schema-osgi-unmanaged-jpa.sql b/src/it/tutorials-5.0.12/schema-osgi-unmanaged-jpa.sql new file mode 100644 index 00000000..de92e463 --- /dev/null +++ b/src/it/tutorials-5.0.12/schema-osgi-unmanaged-jpa.sql @@ -0,0 +1,7 @@ +create sequence hibernate_sequence start with 1 increment by 1; + + create table DataPoint ( + id bigint not null, + name varchar(255), + primary key (id) + ); diff --git a/src/it/tutorials-5.0.12/schema-osgi-unmanaged-native.sql b/src/it/tutorials-5.0.12/schema-osgi-unmanaged-native.sql new file mode 100644 index 00000000..d89e2801 --- /dev/null +++ b/src/it/tutorials-5.0.12/schema-osgi-unmanaged-native.sql @@ -0,0 +1,26 @@ +create sequence hibernate_sequence start with 1 increment by 1; + + create table DataPoint ( + id bigint not null, + name varchar(255), + primary key (id) + ); + + create table DataPoint_AUD ( + id bigint not null, + REV integer not null, + REVTYPE tinyint, + name varchar(255), + primary key (id, REV) + ); + + create table REVINFO ( + REV integer generated by default as identity, + REVTSTMP bigint, + primary key (REV) + ); + + alter table DataPoint_AUD + add constraint FK43jw6b5mtbfxur0xhyjxynbea + foreign key (REV) + references REVINFO; diff --git a/src/it/tutorials-5.0.12/verify.bsh b/src/it/tutorials-5.0.12/verify.bsh new file mode 100644 index 00000000..9156c4af --- /dev/null +++ b/src/it/tutorials-5.0.12/verify.bsh @@ -0,0 +1,19 @@ +import de.juplo.test.FileComparator; + + +FileComparator comparator = new FileComparator(basedir); + +if (!comparator.isEqual("schema-annotations.sql","annotations/target/create.sql")) + return false; +if (!comparator.isEqual("schema-basic.sql","basic/target/create.sql")) + return false; +if (!comparator.isEqual("schema-entitymanager.sql","entitymanager/target/create.sql")) + return false; +if (!comparator.isEqual("schema-envers.sql","envers/target/create.sql")) + return false; +if (!comparator.isEqual("schema-osgi-managed-jpa.sql","osgi/managed-jpa/target/create.sql")) + return false; +if (!comparator.isEqual("schema-osgi-unmanaged-jpa.sql","osgi/unmanaged-jpa/target/create.sql")) + return false; +if (!comparator.isEqual("schema-osgi-unmanaged-native.sql","osgi/unmanaged-native/target/create.sql")) + return false; -- 2.20.1