Verifying generated SQL in integration-test schemaexport-example
authorKai Moritz <kai@juplo.de>
Tue, 29 Apr 2014 15:52:17 +0000 (17:52 +0200)
committerKai Moritz <kai@juplo.de>
Tue, 29 Apr 2014 16:34:17 +0000 (18:34 +0200)
src/it/schemaexport-example/schema.sql [new file with mode: 0644]
src/it/schemaexport-example/verify.bsh [new file with mode: 0644]

diff --git a/src/it/schemaexport-example/schema.sql b/src/it/schemaexport-example/schema.sql
new file mode 100644 (file)
index 0000000..e8f93ba
--- /dev/null
@@ -0,0 +1,25 @@
+
+    alter table Employee 
+        drop constraint FK_12v0w2dqasbw95xtn8qc2uj83;
+
+    drop table ABTEILUNG if exists;
+
+    drop table Employee if exists;
+
+    create table ABTEILUNG (
+        OID bigint generated by default as identity (start with 1),
+        name varchar(255) not null,
+        primary key (OID)
+    );
+
+    create table Employee (
+        OID bigint generated by default as identity (start with 1),
+        name varchar(81) not null,
+        FK_department bigint,
+        primary key (OID)
+    );
+
+    alter table Employee 
+        add constraint FK_12v0w2dqasbw95xtn8qc2uj83 
+        foreign key (FK_department) 
+        references ABTEILUNG;
diff --git a/src/it/schemaexport-example/verify.bsh b/src/it/schemaexport-example/verify.bsh
new file mode 100644 (file)
index 0000000..6e51858
--- /dev/null
@@ -0,0 +1,7 @@
+import de.juplo.test.FileComparator;
+
+
+FileComparator comparator = new FileComparator(basedir);
+
+if (!comparator.isEqual("schema.sql","schemaexport-example-persistence-impl/target/schema.sql"))
+  return false;