From 9608b3904a2ef8483600e137084b3da788aa4980 Mon Sep 17 00:00:00 2001 From: Vlad Mihalcea Date: Tue, 22 Mar 2016 15:16:21 +0200 Subject: [PATCH] Apply the database configuration testing to the documentation module --- documentation/documentation.gradle | 20 +++++++++++++++++++ .../src/test/resources/hibernate.properties | 9 +++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/documentation/documentation.gradle b/documentation/documentation.gradle index e52467bbe9..7ae6595f32 100644 --- a/documentation/documentation.gradle +++ b/documentation/documentation.gradle @@ -1,3 +1,4 @@ +import org.apache.tools.ant.filters.ReplaceTokens import org.asciidoctor.gradle.AsciidoctorTask /* * Hibernate, Relational Persistence for Idiomatic Java @@ -69,8 +70,27 @@ dependencies { testCompile( project(path: ':hibernate-entitymanager', configuration: 'tests') ) testRuntime( libraries.h2 ) + testRuntime( libraries.hsqldb ) + testRuntime( libraries.postgresql ) + testRuntime( libraries.mysql ) } +processTestResources.doLast( { + copy { + from( sourceSets.test.java.srcDirs ) { + include '**/*.properties' + include '**/*.xml' + } + into sourceSets.test.output.classesDir + } + copy { + ext.targetDir = file( "${buildDir}/resources/test" ) + from file('src/test/resources') + into targetDir + filter( ReplaceTokens, tokens: dbBundle[db] ); + } +} ) + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // grouping tasks - declaration, see below for task dependency definitions // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/documentation/src/test/resources/hibernate.properties b/documentation/src/test/resources/hibernate.properties index cda8dd0f91..5b40489d55 100644 --- a/documentation/src/test/resources/hibernate.properties +++ b/documentation/src/test/resources/hibernate.properties @@ -5,10 +5,11 @@ # See the lgpl.txt file in the root directory or . # -hibernate.dialect org.hibernate.dialect.H2Dialect -hibernate.connection.driver_class org.h2.Driver -hibernate.connection.url jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;LOCK_TIMEOUT=10000 -hibernate.connection.username sa +hibernate.dialect @db.dialect@ +hibernate.connection.driver_class @jdbc.driver@ +hibernate.connection.url @jdbc.url@ +hibernate.connection.username @jdbc.user@ +hibernate.connection.password @jdbc.pass@ hibernate.connection.pool_size 5