HHH-7727 - Mark Envers demo as test source

This commit is contained in:
Lukasz Antoniak 2012-10-28 22:13:14 +01:00
parent 4e434f6197
commit cbe619f9ba
3 changed files with 23 additions and 7 deletions

View File

@ -17,6 +17,16 @@ sourceSets {
srcDir generatedJpaMetamodelSrcDir
}
}
test {
ext.enversDemoJavaDir = file( "src/demo/java" )
ext.enversDemoResourcesDir = file( "src/demo/resources" )
java {
srcDir enversDemoJavaDir
}
resources {
srcDir enversDemoResourcesDir
}
}
}
// Generate JPA2 static metamodel for default revision entities

View File

@ -20,7 +20,6 @@
* Red Hat Author(s): Adam Warski
*/
package org.hibernate.envers.demo;
import java.io.File;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.HashSet;
@ -451,8 +450,6 @@ public class TestConsole {
}
public static void main(String[] args) {
String userDbFile = System.getProperty("java.io.tmpdir") + File.separator + "_versions_demo.db";
Map<String, String> configurationOverrides = new HashMap<String, String>();
EntityManagerFactory emf = Persistence.createEntityManagerFactory("ConsolePU", configurationOverrides);
EntityManager entityManager = emf.createEntityManager();
@ -461,7 +458,10 @@ public class TestConsole {
System.out.println("");
System.out.println("Welcome to EntityVersions demo!");
System.out.println("HSQLDB database file location: " + userDbFile);
// If you would like to use HSQLDB, uncomment relevant entries in
// hibernate-envers/src/demo/resources/META-INF/persistence.xml descriptor and add required JAR libraries.
// String userDbFile = System.getProperty("java.io.tmpdir") + File.separator + "_versions_demo.db";
// System.out.println("HSQLDB database file location: " + userDbFile);
console.populateTestData();
console.start();

View File

@ -1,16 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name="ConsolePU">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>org.hibernate.envers.demo.Address</class>
<class>org.hibernate.envers.demo.Person</class>
<exclude-unlisted-classes />
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.connection.url" value="jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE"/>
<property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
<!--<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.connection.url" value="jdbc:hsqldb:file:${java.io.tmpdir}/_versions_demo.db"/>
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
<property name="hibernate.connection.password" value=""/>-->
<!--<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.connection.url" value="jdbc:mysql:///hibernate_tests?useUnicode=true&amp;characterEncoding=UTF-8"/>