Skip to content

Commit 8a207e5

Browse files
christophstroblfniephaus
authored andcommitted
Add initial support for hibernate-orm:hibernate-core:6.5.0.CR1
Move over and adapt tests from hibernate 6.2 to generate metadata via generate-metadata script. Fixed compilation issues and removed no longer supported dialects. Updated metadata generation to include Logger setup. Updated metadata filter to ignore hibernate internal code generation facilities.
1 parent 119e91b commit 8a207e5

35 files changed

+2343
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[
2+
"reflect-config.json",
3+
"resource-config.json"
4+
]

metadata/org.hibernate.orm/hibernate-core/6.5.0.CR1/reflect-config.json

Lines changed: 988 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"resources":{
3+
"includes":[
4+
{
5+
"condition":{"typeReachable":"org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl"},
6+
"pattern":"\\QMETA-INF/persistence.xml\\E"
7+
},
8+
{
9+
"condition":{"typeReachable":"org.hibernate.internal.util.ConfigHelper"},
10+
"pattern":"\\Qhibernate.properties\\E"
11+
},
12+
{
13+
"condition":{"typeReachable":"org.hibernate.boot.jaxb.internal.stax.LocalSchemaLocator"},
14+
"pattern":"\\Qorg/hibernate/hibernate-configuration-3.0.dtd\\E"
15+
},
16+
{
17+
"condition":{"typeReachable":"org.hibernate.boot.jaxb.internal.stax.LocalSchemaLocator"},
18+
"pattern":"\\Qorg/hibernate/hibernate-mapping-3.0.dtd\\E"
19+
},
20+
{
21+
"condition":{"typeReachable":"org.hibernate.boot.xsd.LocalXsdResolver"},
22+
"pattern":"\\Qorg/hibernate/jpa/persistence_2_0.xsd\\E"
23+
},
24+
{
25+
"condition": {"typeReachable": "org.hibernate.boot.xsd.LocalXsdResolver"},
26+
"pattern": "\\Qorg/hibernate/jpa/persistence_3_0.xsd\\E"
27+
},
28+
{
29+
"condition": {"typeReachable": "org.hibernate.boot.xsd.LocalXsdResolver"},
30+
"pattern": "\\Qorg/hibernate/jpa/persistence_3_1.xsd\\E"
31+
}
32+
]}
33+
}

metadata/org.hibernate.orm/hibernate-core/index.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
[
2+
{
3+
"metadata-version": "6.5.0.CR1",
4+
"default-for": "6\\.5\\..*",
5+
"module": "org.hibernate.orm:hibernate-core",
6+
"tested-versions": [
7+
"6.5.0.CR1"
8+
]
9+
},
210
{
311
"latest": true,
412
"metadata-version": "6.2.0.Final",

tests/src/index.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,12 @@
442442
"name" : "org.hibernate.orm:hibernate-core",
443443
"versions" : [ "6.2.0.Final" ]
444444
} ]
445+
}, {
446+
"test-project-path" : "org.hibernate.orm/hibernate-core/6.5.0.CR1",
447+
"libraries" : [ {
448+
"name" : "org.hibernate.orm:hibernate-core",
449+
"versions" : [ "6.5.0.CR1" ]
450+
} ]
445451
}, {
446452
"test-project-path" : "org.hibernate.orm/hibernate-envers/6.1.1.Final",
447453
"libraries" : [ {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
gradlew.bat
2+
gradlew
3+
gradle/
4+
build/
5+
generated-metadata/
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
# Hibernate ORM
3+
4+
The metadata has been generated by executing the following script:
5+
6+
```bash
7+
./generate-metadata.sh
8+
```
9+
10+
The generated metadata can be found in the `generated-metadata` directory.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright and related rights waived via CC0
3+
*
4+
* You should have received a copy of the CC0 legalcode along with this
5+
* work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
6+
*/
7+
8+
plugins {
9+
id "org.graalvm.internal.tck"
10+
}
11+
12+
String libraryVersion = tck.testedLibraryVersion.get()
13+
14+
dependencies {
15+
testImplementation "org.hibernate.orm:hibernate-core:$libraryVersion"
16+
testImplementation 'org.assertj:assertj-core:3.22.0'
17+
testImplementation 'com.h2database:h2:2.1.214'
18+
testImplementation 'jakarta.validation:jakarta.validation-api:3.0.2'
19+
testImplementation 'org.postgresql:postgresql:42.6.0'
20+
testImplementation 'com.oracle.database.jdbc:ojdbc11:21.9.0.0'
21+
testImplementation 'org.jboss.logging:jboss-logging:3.5.0.Final'
22+
23+
testImplementation 'ch.qos.logback:logback-classic:1.4.5'
24+
}
25+
26+
task updateGeneratedMetadata {
27+
doLast {
28+
final ant = new groovy.ant.AntBuilder()
29+
final metadataDir = project.projectDir.toString() + "/generated-metadata"
30+
31+
// replace typeReachable value for entries generated by IdentifierGeneratorTest test class
32+
ant.replace(file: metadataDir + "/reflect-config.json",
33+
token: "org_hibernate_orm.hibernate_core.IdentifierGeneratorTest",
34+
value: "org.hibernate.id.factory.internal.StandardIdentifierGeneratorFactory")
35+
}
36+
}
37+
38+
task deleteGeneratedMetadata(type: Delete) {
39+
delete files(project.projectDir.toString() + "/generated-metadata")
40+
}
41+
42+
graalvmNative {
43+
agent {
44+
defaultMode = "conditional"
45+
modes {
46+
conditional {
47+
userCodeFilterPath = "metadata-conditions-filter.json"
48+
extraFilterPath = "metadata-extra-filter.json"
49+
}
50+
}
51+
metadataCopy {
52+
inputTaskNames.add("test")
53+
outputDirectories.add("generated-metadata")
54+
mergeWithExisting = true
55+
}
56+
}
57+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
./gradlew deleteGeneratedMetadata
4+
./gradlew test --tests "org_hibernate_orm.hibernate_core.H2DialectHibernateTest" -Pagent metadataCopy
5+
./gradlew test --tests "org_hibernate_orm.hibernate_core.MariaDBDialectHibernateTest" -Pagent metadataCopy
6+
./gradlew test --tests "org_hibernate_orm.hibernate_core.MSSQLDialectHibernateTest" -Pagent metadataCopy
7+
./gradlew test --tests "org_hibernate_orm.hibernate_core.MySQLDialectHibernateTest" -Pagent metadataCopy
8+
./gradlew test --tests "org_hibernate_orm.hibernate_core.OracleDialectHibernateTest" -Pagent metadataCopy
9+
./gradlew test --tests "org_hibernate_orm.hibernate_core.PostgresDialectHibernateTest" -Pagent metadataCopy
10+
./gradlew test --tests "org_hibernate_orm.hibernate_core.HibernateDialectTest" -Pagent metadataCopy
11+
./gradlew test --tests "org_hibernate_orm.hibernate_core.LoggerTest" -Pagent metadataCopy
12+
./gradlew test --tests "org_hibernate_orm.hibernate_core.IdentifierGeneratorTest" -Pagent metadataCopy
13+
./gradlew test --tests "org_hibernate_orm.hibernate_core.OptimizerTest" -Pagent metadataCopy
14+
./gradlew test --tests "org_hibernate_orm.hibernate_core.EntityManagerTest" -Pagent metadataCopy
15+
./gradlew updateGeneratedMetadata
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
library.version = 6.5.0.CR1
2+
metadata.dir = org.hibernate.orm/hibernate-core/6.5.0.CR1/

0 commit comments

Comments
 (0)