Skip to content

Commit bba12f0

Browse files
add latest updates from 6.2.22 to hibernate test files
1 parent 8d1b11a commit bba12f0

File tree

6 files changed

+176
-117
lines changed

6 files changed

+176
-117
lines changed

wrapper/build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ plugins {
2424
id("com.github.vlsi.gradle-extensions")
2525
id("com.github.vlsi.ide")
2626
id("com.kncept.junit.reporter")
27+
id("org.checkerframework") version "0.6.34"
2728
}
2829

2930
dependencies {

wrapper/src/test/build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent.*
1919

2020
plugins {
2121
java
22+
id("org.checkerframework") version "0.6.34"
2223
}
2324

2425
repositories {

wrapper/src/test/java/integration/host/TestEnvironment.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public class TestEnvironment implements AutoCloseable {
6868
private static final String PROXIED_DOMAIN_NAME_SUFFIX = ".proxied";
6969
protected static final int PROXY_CONTROL_PORT = 8474;
7070
protected static final int PROXY_PORT = 8666;
71-
private static final String HIBERNATE_VERSION = "6.2.0.CR2";
71+
private static final String HIBERNATE_VERSION = "6.2.22";
7272

7373
private static final TestEnvironmentConfiguration config = new TestEnvironmentConfiguration();
7474
private static final boolean USE_OTLP_CONTAINER_FOR_TRACES = true;

wrapper/src/test/resources/hibernate_files/databases.gradle

+72-9
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ext {
1212
db = project.hasProperty('db') ? project.getProperty('db') : 'h2'
1313
dbHost = System.getProperty( 'dbHost', 'localhost' )
1414
dbService = System.getProperty( 'dbService', '' )
15+
runID = System.getProperty( 'runID', '' )
1516
dbUser = System.getProperty( 'dbUser', 'hibernate_orm_test' )
1617
dbPass = System.getProperty( 'dbPass', 'hibernate_orm_test' )
1718
dbName = System.getProperty( 'dbName', 'hibernate_orm_test' )
@@ -37,8 +38,9 @@ ext {
3738
'jdbc.driver': 'org.h2.Driver',
3839
'jdbc.user' : 'sa',
3940
'jdbc.pass' : '',
40-
'jdbc.url' : 'jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;LOCK_TIMEOUT=10000',
41-
'connection.init_sql' : ''
41+
'jdbc.url' : 'jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE',
42+
'connection.init_sql' : '',
43+
'hibernate.dialect.native_param_markers' : 'true'
4244
],
4345
hsqldb : [
4446
'db.dialect' : 'org.hibernate.dialect.HSQLDialect',
@@ -53,15 +55,15 @@ ext {
5355
'jdbc.driver': 'org.apache.derby.iapi.jdbc.AutoloadedDriver',
5456
'jdbc.user' : 'hibernate_orm_test',
5557
'jdbc.pass' : 'hibernate_orm_test',
56-
'jdbc.url' : 'jdbc:derby:target/tmp/derby/hibernate_orm_test;databaseName=hibernate_orm_test;create=true',
58+
'jdbc.url' : 'jdbc:derby:memory:;databaseName=hibernate_orm_test;create=true',
5759
'connection.init_sql' : ''
5860
],
5961
derby_old : [
6062
'db.dialect' : 'org.hibernate.dialect.DerbyDialect',
6163
'jdbc.driver': 'org.apache.derby.jdbc.EmbeddedDriver',
6264
'jdbc.user' : 'hibernate_orm_test',
6365
'jdbc.pass' : 'hibernate_orm_test',
64-
'jdbc.url' : 'jdbc:derby:target/tmp/derby/hibernate_orm_test;databaseName=hibernate_orm_test;create=true',
66+
'jdbc.url' : 'jdbc:derby:memory:;databaseName=hibernate_orm_test;create=true',
6567
'connection.init_sql' : ''
6668
],
6769
pgsql : [
@@ -97,9 +99,18 @@ ext {
9799
'jdbc.user' : 'hibernate_orm_test',
98100
'jdbc.pass' : 'hibernate_orm_test',
99101
// Disable prepared statement caching to avoid issues with changing schemas
100-
'jdbc.url' : 'jdbc:jtds:sybase://' + dbHost + ':5000/hibernate_orm_test;maxStatements=0;cacheMetaData=false',
102+
'jdbc.url' : 'jdbc:jtds:sybase://' + dbHost + ':9000/hibernate_orm_test;maxStatements=0;cacheMetaData=false',
101103
'connection.init_sql' : 'set ansinull on'
102104
],
105+
sybase_jconn_ci : [
106+
'db.dialect' : 'org.hibernate.dialect.SybaseASEDialect',
107+
'jdbc.driver': 'com.sybase.jdbc4.jdbc.SybDriver',
108+
'jdbc.user' : 'hibernate_orm_test',
109+
'jdbc.pass' : 'hibernate_orm_test',
110+
// Disable prepared statement caching to avoid issues with changing schemas
111+
'jdbc.url' : 'jdbc:sybase:Tds:' + dbHost + ':9000/hibernate_orm_test',
112+
'connection.init_sql' : 'set ansinull on set quoted_identifier on'
113+
],
103114
mysql : [
104115
'db.dialect' : 'org.hibernate.dialect.MySQLDialect',
105116
'jdbc.driver': 'com.mysql.cj.jdbc.Driver',
@@ -137,7 +148,7 @@ ext {
137148
'jdbc.driver': 'com.mysql.jdbc.Driver',
138149
'jdbc.user' : 'hibernate_orm_test',
139150
'jdbc.pass' : 'hibernate_orm_test',
140-
'jdbc.url' : 'jdbc:mysql://' + dbHost + '/hibernate_orm_test',
151+
'jdbc.url' : 'jdbc:mysql://' + dbHost + ':4000/hibernate_orm_test',
141152
'connection.init_sql' : ''
142153
],
143154
oracle : [
@@ -149,6 +160,14 @@ ext {
149160
'connection.init_sql' : ''
150161
],
151162
oracle_ci : [
163+
'db.dialect' : 'org.hibernate.dialect.OracleDialect',
164+
'jdbc.driver': 'oracle.jdbc.OracleDriver',
165+
'jdbc.user' : 'hibernate_orm_test',
166+
'jdbc.pass' : 'hibernate_orm_test',
167+
'jdbc.url' : 'jdbc:oracle:thin:@' + dbHost + ':1521/freepdb1',
168+
'connection.init_sql' : ''
169+
],
170+
oracle_xe_ci : [
152171
'db.dialect' : 'org.hibernate.dialect.OracleDialect',
153172
'jdbc.driver': 'oracle.jdbc.OracleDriver',
154173
'jdbc.user' : 'hibernate_orm_test',
@@ -168,13 +187,49 @@ ext {
168187
oracle_cloud_autonomous_tls : [
169188
'db.dialect' : 'org.hibernate.dialect.OracleDialect',
170189
'jdbc.driver': 'oracle.jdbc.OracleDriver',
171-
'jdbc.user' : 'hibernate_orm_test',
190+
'jdbc.user' : 'hibernate_orm_test_' + runID,
191+
'jdbc.pass' : 'Oracle_19_Password',
192+
// Requires dbHost (pointing to the right cloud region) AND dbService (unique database name).
193+
//
194+
// To avoid hibernate-spatial tests failure, JVM must be enabled as stated in documentation:
195+
// https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/autonomous-oracle-java.html
196+
'jdbc.url' : 'jdbc:oracle:thin:@(description=(retry_count=5)(retry_delay=1)(address=(protocol=tcps)(port=1521)(host=' + dbHost + '.oraclecloud.com))(connect_data=(service_name=' + dbService + '_tp.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))?oracle.jdbc.enableQueryResultCache=false&oracle.jdbc.thinForceDNSLoadBalancing=true&tcp.nodelay=yes',
197+
'connection.init_sql' : ''
198+
],
199+
oracle_cloud_db19c : [
200+
'db.dialect' : 'org.hibernate.dialect.OracleDialect',
201+
'jdbc.driver': 'oracle.jdbc.OracleDriver',
202+
'jdbc.user' : 'hibernate_orm_test_' + runID,
172203
'jdbc.pass' : 'Oracle_19_Password',
173204
// Requires dbHost (pointing to the right cloud region) AND dbService (unique database name).
174205
//
175206
// To avoid hibernate-spatial tests failure, JVM must be enabled as stated in documentation:
176207
// https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/autonomous-oracle-java.html
177-
'jdbc.url' : 'jdbc:oracle:thin:@(description=(retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=' + dbHost + '.oraclecloud.com))(connect_data=(service_name=' + dbService + '_low.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)))',
208+
'jdbc.url' : 'jdbc:oracle:thin:@' + dbHost + ':1521/' + dbService,
209+
'connection.init_sql' : ''
210+
],
211+
oracle_cloud_db21c : [
212+
'db.dialect' : 'org.hibernate.dialect.OracleDialect',
213+
'jdbc.driver': 'oracle.jdbc.OracleDriver',
214+
'jdbc.user' : 'hibernate_orm_test_' + runID,
215+
'jdbc.pass' : 'Oracle_21_Password',
216+
// Requires dbHost (pointing to the right cloud region) AND dbService (unique database name).
217+
//
218+
// To avoid hibernate-spatial tests failure, JVM must be enabled as stated in documentation:
219+
// https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/autonomous-oracle-java.html
220+
'jdbc.url' : 'jdbc:oracle:thin:@' + dbHost + ':1521/' + dbService,
221+
'connection.init_sql' : ''
222+
],
223+
oracle_cloud_db23c : [
224+
'db.dialect' : 'org.hibernate.dialect.OracleDialect',
225+
'jdbc.driver': 'oracle.jdbc.OracleDriver',
226+
'jdbc.user' : 'hibernate_orm_test_' + runID,
227+
'jdbc.pass' : 'Oracle_23_Password',
228+
// Requires dbHost (pointing to the right cloud region) AND dbService (unique database name).
229+
//
230+
// To avoid hibernate-spatial tests failure, JVM must be enabled as stated in documentation:
231+
// https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/autonomous-oracle-java.html
232+
'jdbc.url' : 'jdbc:oracle:thin:@' + dbHost + ':1521/' + dbService,
178233
'connection.init_sql' : ''
179234
],
180235
mssql : [
@@ -256,6 +311,14 @@ ext {
256311
'jdbc.url' : 'jdbc:firebirdsql://' + dbHost +'/hibernate_orm_test?charSet=utf-8;TRANSACTION_READ_COMMITTED=read_committed,rec_version,wait,lock_timeout=5',
257312
'connection.init_sql' : ''
258313
],
314+
altibase : [
315+
'db.dialect' : 'org.hibernate.community.dialect.AltibaseDialect',
316+
'jdbc.driver': 'Altibase.jdbc.driver.AltibaseDriver',
317+
'jdbc.user' : 'sys',
318+
'jdbc.pass' : 'manager',
319+
'connection.init_sql' : '',
320+
'jdbc.url' : 'jdbc:Altibase://' + dbHost + ':20300/mydb?force_clob_bind=true'
321+
],
259322
]
260323
}
261324

@@ -266,7 +329,7 @@ if ( processTestResourcesTask != null ) {
266329
processTestResourcesTask.inputs.property( 'dbHost', dbHost )
267330
// processTestResourcesTask.inputs.property( "gradle.libs.versions.h2", project.getProperty( "gradle.libs.versions.h2", "2.1.214" ) )
268331
// processTestResourcesTask.inputs.property( "gradle.libs.versions.h2gis", project.getProperty( "gradle.libs.versions.h2gis", "2.1.0" ) )
269-
// processTestResourcesTask.inputs.property( "gradle.libs.versions.hsqldb", project.getProperty( "gradle.libs.versions.hsqldb", "2.7.1" ) )
332+
// processTestResourcesTask.inputs.property( "gradle.libs.versions.hsqldb", project.getProperty( "gradle.libs.versions.hsqldb", "2.7.2" ) )
270333
// processTestResourcesTask.inputs.property( "gradle.libs.versions.derby", project.getProperty( "gradle.libs.versions.derby", "10.15.2.0" ) )
271334
processTestResourcesTask.filter( ReplaceTokens, tokens: dbBundle[db] )
272335
}

wrapper/src/test/resources/hibernate_files/hibernate-core.gradle

+25-14
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ plugins {
1010
id 'org.hibernate.build.xjc-jakarta'
1111
}
1212

13+
repositories {
14+
gradlePluginPortal()
15+
}
16+
1317
description = 'Hibernate\'s core ORM functionality'
1418

1519
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
1620
apply plugin: 'org.hibernate.orm.antlr'
1721
apply plugin: 'org.hibernate.matrix-test'
1822

19-
2023
configurations {
2124
tests {
2225
description = 'Configuration for the produced test jar'
@@ -45,6 +48,7 @@ dependencies {
4548
compileOnly jakartaLibs.jsonbApi
4649
compileOnly libs.jackson
4750
compileOnly libs.jacksonXml
51+
compileOnly dbLibs.postgresql
4852

4953
testImplementation project(':hibernate-testing')
5054
testImplementation project(':hibernate-ant')
@@ -62,14 +66,15 @@ dependencies {
6266
}
6367
testImplementation "joda-time:joda-time:2.3"
6468
testImplementation files('/app/libs/aws-advanced-jdbc-wrapper-2.3.3.jar')
65-
testImplementation dbLibs.postgresql
66-
testImplementation dbLibs.mysql
6769
testImplementation dbLibs.h2
6870

6971
testRuntimeOnly libs.byteBuddy
7072
testRuntimeOnly testLibs.weld
7173
testRuntimeOnly testLibs.wildFlyTxnClient
74+
testRuntimeOnly jakartaLibs.jsonb
7275
testRuntimeOnly libs.jackson
76+
testRuntimeOnly libs.jacksonXml
77+
testRuntimeOnly libs.jacksonJsr310
7378

7479
testAnnotationProcessor project( ':hibernate-jpamodelgen' )
7580

@@ -105,10 +110,8 @@ sourceSets {
105110
}
106111
}
107112

108-
// resources inherently exclude sources
109113
test {
110114
resources {
111-
srcDir 'src/test/java'
112115
srcDir 'src/test/resources'
113116
srcDir 'src/test/bundles'
114117
}
@@ -240,13 +243,16 @@ tasks.withType( Test.class ).each { test ->
240243
test.jvmArgs( ['--add-opens', 'java.base/java.security=ALL-UNNAMED'] )
241244
test.jvmArgs( ['--add-opens', 'java.base/java.lang=ALL-UNNAMED'] )
242245

246+
//Avoid Log4J2 classloader leaks:
247+
test.jvmArgs( ['-Dlog4j2.disableJmx=true'] )
248+
243249
test.beforeTest { descriptor ->
244250
//println "Starting test: " + descriptor
245251
}
246252
}
247253

248254
// Tests with records
249-
if ( gradle.ext.javaVersions.test.release.asInt() >= 17 && gradle.ext.javaToolchainEnabled ) {
255+
if ( jdkVersions.test.release.asInt() >= 17 && jdkVersions.explicit ) {
250256

251257
// Add a new source set, which contains tests that can run on JDK17+
252258
sourceSets {
@@ -256,15 +262,15 @@ if ( gradle.ext.javaVersions.test.release.asInt() >= 17 && gradle.ext.javaToolch
256262
}
257263
// Refer to the main test resources to avoid processing variables twice
258264
resources {
259-
srcDir 'target/resources/test'
265+
srcDirs tasks.processTestResources
260266
}
261267
}
262268
}
263269

264270
// For the new source set, we need to configure the source and target version to 17
265271
compileTestJava17Java {
266272
javaCompiler = javaToolchains.compilerFor {
267-
languageVersion = gradle.ext.javaVersions.test.compiler
273+
languageVersion = jdkVersions.test.compiler
268274
}
269275
sourceCompatibility = 17
270276
targetCompatibility = 17
@@ -275,6 +281,7 @@ if ( gradle.ext.javaVersions.test.release.asInt() >= 17 && gradle.ext.javaToolch
275281
// The source set gets a custom configuration which extends the normal test implementation config
276282
configurations {
277283
testJava17Implementation.extendsFrom(testImplementation, testRuntimeOnly)
284+
testJava17CompileOnly.extendsFrom(testCompileOnly)
278285
}
279286

280287
// Add the output from src/main/java as dependency
@@ -287,14 +294,14 @@ if ( gradle.ext.javaVersions.test.release.asInt() >= 17 && gradle.ext.javaToolch
287294
// We execute the Java 17 tests in a custom test task
288295
task testJava17(type: Test) {
289296
javaLauncher = javaToolchains.launcherFor {
290-
languageVersion = gradle.ext.javaVersions.test.launcher
297+
languageVersion = jdkVersions.test.launcher
291298
}
292299
useJUnitPlatform()
293300
testClassesDirs = sourceSets.testJava17.output.classesDirs
294301
classpath = sourceSets.testJava17.runtimeClasspath
295302

296-
if ( gradle.ext.javaVersions.test.launcher.asInt() >= 19 ) {
297-
logger.warn( "The version of Java bytecode that will be tested is not supported by Bytebuddy by default. " +
303+
if ( jdkVersions.test.launcher.asInt() >= 19 ) {
304+
logger.warn( "The version of Java bytecode that will be tested is not supported by Byte Buddy by default. " +
298305
" Setting 'net.bytebuddy.experimental=true'." )
299306
systemProperty 'net.bytebuddy.experimental', true
300307
}
@@ -305,9 +312,13 @@ if ( gradle.ext.javaVersions.test.release.asInt() >= 17 && gradle.ext.javaToolch
305312
check.dependsOn testJava17
306313
}
307314

308-
javadoc {
315+
tasks.named( "javadoc", Javadoc ) {
309316
configure(options) {
310-
overview = 'src/main/javadoc/overview.html'
311-
stylesheetFile = new File(projectDir, 'src/main/javadoc/stylesheet.css')
317+
overview = rootProject.file( "shared/javadoc/overview.html" )
312318
}
313319
}
320+
321+
tasks.sourcesJar.dependsOn ':hibernate-core:generateGraphParser'
322+
tasks.sourcesJar.dependsOn ':hibernate-core:generateHqlParser'
323+
tasks.sourcesJar.dependsOn ':hibernate-core:generateSqlScriptParser'
324+
tasks.sourcesJar.dependsOn ':hibernate-core:generateOrderingParser'

0 commit comments

Comments
 (0)