Skip to content

Commit 9608b39

Browse files
committed
Apply the database configuration testing to the documentation module
1 parent c62c367 commit 9608b39

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

documentation/documentation.gradle

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.apache.tools.ant.filters.ReplaceTokens
12
import org.asciidoctor.gradle.AsciidoctorTask
23
/*
34
* Hibernate, Relational Persistence for Idiomatic Java
@@ -69,8 +70,27 @@ dependencies {
6970
testCompile( project(path: ':hibernate-entitymanager', configuration: 'tests') )
7071

7172
testRuntime( libraries.h2 )
73+
testRuntime( libraries.hsqldb )
74+
testRuntime( libraries.postgresql )
75+
testRuntime( libraries.mysql )
7276
}
7377

78+
processTestResources.doLast( {
79+
copy {
80+
from( sourceSets.test.java.srcDirs ) {
81+
include '**/*.properties'
82+
include '**/*.xml'
83+
}
84+
into sourceSets.test.output.classesDir
85+
}
86+
copy {
87+
ext.targetDir = file( "${buildDir}/resources/test" )
88+
from file('src/test/resources')
89+
into targetDir
90+
filter( ReplaceTokens, tokens: dbBundle[db] );
91+
}
92+
} )
93+
7494
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7595
// grouping tasks - declaration, see below for task dependency definitions
7696
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

documentation/src/test/resources/hibernate.properties

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
# See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
66
#
77

8-
hibernate.dialect org.hibernate.dialect.H2Dialect
9-
hibernate.connection.driver_class org.h2.Driver
10-
hibernate.connection.url jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;LOCK_TIMEOUT=10000
11-
hibernate.connection.username sa
8+
hibernate.dialect @db.dialect@
9+
hibernate.connection.driver_class @jdbc.driver@
10+
hibernate.connection.url @jdbc.url@
11+
hibernate.connection.username @jdbc.user@
12+
hibernate.connection.password @jdbc.pass@
1213

1314
hibernate.connection.pool_size 5
1415

0 commit comments

Comments
 (0)