From: Kai Moritz Date: Sat, 16 May 2015 12:14:44 +0000 (+0200) Subject: Added script to check outcome of the hibernate-tutorials X-Git-Tag: hibernate4-maven-plugin-1.1.0~1 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=94e6b2e93fe107e75c9d20aa1eb3126e78a5ed0a;p=hibernate4-maven-plugin Added script to check outcome of the hibernate-tutorials --- diff --git a/src/it/tutorials/schema-annotations.sql b/src/it/tutorials/schema-annotations.sql new file mode 100644 index 00000000..8448e8a2 --- /dev/null +++ b/src/it/tutorials/schema-annotations.sql @@ -0,0 +1,9 @@ + + drop table EVENTS if exists; + + create table EVENTS ( + id bigint not null, + EVENT_DATE timestamp, + title varchar(255), + primary key (id) + ); diff --git a/src/it/tutorials/schema-basic.sql b/src/it/tutorials/schema-basic.sql new file mode 100644 index 00000000..4da1a3c1 --- /dev/null +++ b/src/it/tutorials/schema-basic.sql @@ -0,0 +1,9 @@ + + drop table EVENTS if exists; + + create table EVENTS ( + EVENT_ID bigint not null, + EVENT_DATE timestamp, + title varchar(255), + primary key (EVENT_ID) + ); diff --git a/src/it/tutorials/schema-entitymanager.sql b/src/it/tutorials/schema-entitymanager.sql new file mode 100644 index 00000000..8448e8a2 --- /dev/null +++ b/src/it/tutorials/schema-entitymanager.sql @@ -0,0 +1,9 @@ + + drop table EVENTS if exists; + + create table EVENTS ( + id bigint not null, + EVENT_DATE timestamp, + title varchar(255), + primary key (id) + ); diff --git a/src/it/tutorials/schema-envers.sql b/src/it/tutorials/schema-envers.sql new file mode 100644 index 00000000..44643fa8 --- /dev/null +++ b/src/it/tutorials/schema-envers.sql @@ -0,0 +1,33 @@ + + drop table EVENTS if exists; + + drop table EVENTS_AUD if exists; + + drop table REVINFO if exists; + + 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 FK_3hegaqrrpmx0jj0c8qacjtira + foreign key (REV) + references REVINFO; diff --git a/src/it/tutorials/schema-osgi-managed-jpa.sql b/src/it/tutorials/schema-osgi-managed-jpa.sql new file mode 100644 index 00000000..66738bb5 --- /dev/null +++ b/src/it/tutorials/schema-osgi-managed-jpa.sql @@ -0,0 +1,8 @@ + + drop table DataPoint if exists; + + create table DataPoint ( + id bigint generated by default as identity, + name varchar(255), + primary key (id) + ); diff --git a/src/it/tutorials/schema-osgi-unmanaged-jpa.sql b/src/it/tutorials/schema-osgi-unmanaged-jpa.sql new file mode 100644 index 00000000..66738bb5 --- /dev/null +++ b/src/it/tutorials/schema-osgi-unmanaged-jpa.sql @@ -0,0 +1,8 @@ + + drop table DataPoint if exists; + + create table DataPoint ( + id bigint generated by default as identity, + name varchar(255), + primary key (id) + ); diff --git a/src/it/tutorials/schema-osgi-unmanaged-native.sql b/src/it/tutorials/schema-osgi-unmanaged-native.sql new file mode 100644 index 00000000..37165353 --- /dev/null +++ b/src/it/tutorials/schema-osgi-unmanaged-native.sql @@ -0,0 +1,31 @@ + + drop table DataPoint if exists; + + drop table DataPoint_AUD if exists; + + drop table REVINFO if exists; + + create table DataPoint ( + id bigint generated by default as identity, + 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 FK_7pdslro8w1n74eqwmorrn0hnb + foreign key (REV) + references REVINFO; diff --git a/src/it/tutorials/verify.bsh b/src/it/tutorials/verify.bsh new file mode 100644 index 00000000..4164d8b0 --- /dev/null +++ b/src/it/tutorials/verify.bsh @@ -0,0 +1,19 @@ +import de.juplo.test.FileComparator; + + +FileComparator comparator = new FileComparator(basedir); + +if (!comparator.isEqual("schema-annotations.sql","annotations/target/schema.sql")) + return false; +if (!comparator.isEqual("schema-basic.sql","basic/target/schema.sql")) + return false; +if (!comparator.isEqual("schema-entitymanager.sql","entitymanager/target/schema.sql")) + return false; +if (!comparator.isEqual("schema-envers.sql","envers/target/schema.sql")) + return false; +if (!comparator.isEqual("schema-osgi-managed-jpa.sql","osgi/managed-jpa/target/schema.sql")) + return false; +if (!comparator.isEqual("schema-osgi-unmanaged-jpa.sql","osgi/unmanaged-jpa/target/schema.sql")) + return false; +if (!comparator.isEqual("schema-osgi-unmanaged-native.sql","osgi/unmanaged-native/target/schema.sql")) + return false;