<settingsFile>src/it/settings.xml</settingsFile>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<postBuildHookScript>verify</postBuildHookScript>
+ <addTestClassPath>true</addTestClassPath>
</configuration>
<executions>
<execution>
--- /dev/null
+
+ drop table test_simple if exists;
+
+ create table test_simple (
+ uuid varchar(36) not null,
+ content clob,
+ externalid varchar(148),
+ sources varchar(255),
+ primary key (uuid)
+ );
+
+ create index idx_test_simple_tuple on test_simple (sources, uuid);
--- /dev/null
+
+ drop table test_simple cascade constraints;
+
+ create table test_simple (
+ uuid varchar2(36 char) not null,
+ content clob,
+ externalid varchar2(148 char),
+ sources varchar2(255 char),
+ primary key (uuid)
+ );
+
+ create index idx_test_simple_tuple on test_simple (sources, uuid);
<packaging>jar</packaging>
<properties>
<!--hibernate.skip>false</hibernate.skip-->
- <hibernate.exportdir>${project.build.directory}/hibernate4-schema/another/subdir</hibernate.exportdir>
</properties>
<dependencies>
<dependency>
</goals>
<configuration>
<hibernateDialect>org.hibernate.dialect.H2Dialect</hibernateDialect>
- <outputFile>${hibernate.exportdir}/h2.sql</outputFile>
+ <outputFile>h2.sql</outputFile>
</configuration>
</execution>
<execution>
</goals>
<configuration>
<hibernateDialect>org.hibernate.dialect.PostgreSQL82Dialect</hibernateDialect>
- <outputFile>${hibernate.exportdir}/postgres.sql</outputFile>
+ <outputFile>postgres.sql</outputFile>
</configuration>
</execution>
<execution>
</goals>
<configuration>
<hibernateDialect>org.hibernate.dialect.Oracle10gDialect</hibernateDialect>
- <outputFile>${hibernate.exportdir}/oracle.sql</outputFile>
+ <outputFile>oracle.sql</outputFile>
</configuration>
</execution>
</executions>
--- /dev/null
+
+ drop table if exists test_simple cascade;
+
+ create table test_simple (
+ uuid varchar(36) not null,
+ content text,
+ externalid varchar(148),
+ sources varchar(255),
+ primary key (uuid)
+ );
+
+ create index idx_test_simple_tuple on test_simple (sources, uuid);
--- /dev/null
+import de.juplo.test.FileComparator;
+
+
+FileComparator comparator = new FileComparator(basedir);
+
+if (!comparator.isEqual("h2.sql","target/h2.sql"))
+ return false;
+if (!comparator.isEqual("oracle.sql","target/oracle.sql"))
+ return false;
+if (!comparator.isEqual("postgres.sql","target/postgres.sql"))
+ return false;
--- /dev/null
+package de.juplo.test;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+
+
+public class FileComparator
+{
+ private final File basedir;
+ private BufferedReader expectedReader;
+ private BufferedReader foundReader;
+
+ public FileComparator(File basedir)
+ {
+ this.basedir = basedir;
+ }
+
+ public boolean isEqual(final String expectedFile, final String foundFile)
+ throws
+ FileNotFoundException,
+ IOException
+ {
+ File file;
+ String expected, found;
+
+ file = new File(basedir, expectedFile);
+ expectedReader = new BufferedReader(new FileReader(file));
+
+ file = new File(basedir, foundFile);
+ foundReader = new BufferedReader(new FileReader(file));
+
+
+ while ((expected = expectedReader.readLine()) != null)
+ {
+ found = foundReader.readLine();
+ if (!expected.equals(found))
+ {
+ System.err.println("Mismatch!");
+ System.err.println("Expected: " + expected);
+ System.err.println("Found: " + found);
+ return false;
+ }
+ }
+
+ if ((found = foundReader.readLine()) != null)
+ {
+ System.err.println("Found more content than expected!");
+ System.err.println("Starting with: " + found);
+ return false;
+ }
+
+ return true;
+ }
+}
\ No newline at end of file