From d88d4a8d7bd0c7ab1b6061c373f82f27ae7c2893 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Thu, 12 Mar 2020 14:42:38 +0000 Subject: [PATCH] Re-enabled hibernate-orm-modules --- gradle/libraries.gradle | 4 ++- hibernate-core/hibernate-core.gradle | 30 +++++++++---------- .../hibernate-orm-modules.gradle | 9 +++++- .../module-templates/antlr.xml | 22 ++++++++++++++ .../module-templates/antrl-runtime.xml | 19 ++++++++++++ .../module-templates/hibernate-core.xml | 3 +- .../HibernateEnversOnWildflyTest.java | 7 +++-- 7 files changed, 74 insertions(+), 20 deletions(-) create mode 100644 hibernate-orm-modules/module-templates/antlr.xml create mode 100644 hibernate-orm-modules/module-templates/antrl-runtime.xml diff --git a/gradle/libraries.gradle b/gradle/libraries.gradle index 841eb424a6e9..ae1522d6a16e 100644 --- a/gradle/libraries.gradle +++ b/gradle/libraries.gradle @@ -51,12 +51,14 @@ ext { //GraalVM graalvmVersion = '19.3.1' + antlrVersion = '4.7.1' + libraries = [ // Ant ant: 'org.apache.ant:ant:1.8.2', // Antlr - antlr: 'org.antlr:antlr4:4.7.1', + antlr: "org.antlr:antlr4:${antlrVersion}", // Annotations commons_annotations: "org.hibernate.common:hibernate-commons-annotations:${hibernateCommonsVersion}", diff --git a/hibernate-core/hibernate-core.gradle b/hibernate-core/hibernate-core.gradle index a85142fe820a..fbd2d2f0b957 100644 --- a/hibernate-core/hibernate-core.gradle +++ b/hibernate-core/hibernate-core.gradle @@ -296,21 +296,21 @@ task generateEnversStaticMetamodel( // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // todo (6.0) : fix after fixing hibernate-spatial -//processTestResources { -// doLast { -// copy { -// from file( 'src/test/resources' ) -// into file( "${buildDir}/resources/test" ) -// include 'arquillian.xml' -// include 'org/hibernate/test/wf/ddl/manifest.mf' -// expand wildFlyInstallDir: project( ':hibernate-orm-modules' ).wildFlyInstallDir, -// hibernateMajorMinorVersion: "${project.ormVersion.family}", -// arquillianDeploymentExportDir: "${rootProject.buildDir.absolutePath}/arquillian-deployments" -// } -// } -//} -// -//test.dependsOn ':hibernate-orm-modules:prepareWildFlyForTests' +processTestResources { + doLast { + copy { + from file( 'src/test/resources' ) + into file( "${buildDir}/resources/test" ) + include 'arquillian.xml' + include 'org/hibernate/test/wf/ddl/manifest.mf' + expand wildFlyInstallDir: project( ':hibernate-orm-modules' ).wildFlyInstallDir, + hibernateMajorMinorVersion: "${project.ormVersion.family}", + arquillianDeploymentExportDir: "${rootProject.buildDir.absolutePath}/arquillian-deployments" + } + } +} + +test.dependsOn ':hibernate-orm-modules:prepareWildFlyForTests' // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ test { diff --git a/hibernate-orm-modules/hibernate-orm-modules.gradle b/hibernate-orm-modules/hibernate-orm-modules.gradle index f0ecd1dcc273..cb11a27896fd 100644 --- a/hibernate-orm-modules/hibernate-orm-modules.gradle +++ b/hibernate-orm-modules/hibernate-orm-modules.gradle @@ -34,6 +34,7 @@ ext { // "10" for WildFly 10.x, "11" for 11.x, etc wildFlyMajorVersion = project.wildflyVersion.split( '\\.' )[0] bytebuddyVersion = project.byteBuddyVersion + antlrVersion = project.antlrVersion artifactClassifier = "wildfly-${wildFlyMajorVersion}-dist" wildFlyInstallDir = "$rootProject.buildDir/wildfly" fpackStagingDir = file( "target/featurepack" ) //Target build directory for the Feature Pack @@ -73,7 +74,8 @@ featurepack { variables['slot'] = rootProject.ormVersion.fullName // Just the minor ORM version, e.g. "5.3"; Is used as an alias for the exact version variables['minorSlot'] = rootProject.ormVersion.family - variables['bytebuddySlot'] = bytebuddyVersion + variables['bytebuddySlot'] = antlrVersion + variables['antlrSlot'] = '4.7.1' variables['infinispan2lcSlot'] = 'for-orm-' + rootProject.ormVersion.family //Dependency on another Feature Pack: dependency "org.wildfly:wildfly-feature-pack:${project.wildflyVersion}" // It will assume it is "zip" by default @@ -106,6 +108,9 @@ dependencies { testCompile project( ":hibernate-core" ) testCompile project( ":hibernate-envers" ) testCompile libraries.junit + testCompile 'org.antlr:antlr4-runtime:4.7.1' + + testCompile libraries.antlr testCompile libraries.arquillian_junit_container testCompile libraries.arquillian_protocol_servlet testCompile libraries.shrinkwrap_descriptors_api_javaee @@ -113,9 +118,11 @@ dependencies { testCompile libraries.wildfly_arquillian_container_managed featurePack libraries.byteBuddy + featurePack libraries.antlr featurePack project( ":hibernate-core" ) featurePack project( ":hibernate-envers" ) featurePack "org.wildfly:jipijapa-hibernate5:${wildflyVersion}" + featurePack "org.antlr:antlr4-runtime:4.7.1" } publishing { diff --git a/hibernate-orm-modules/module-templates/antlr.xml b/hibernate-orm-modules/module-templates/antlr.xml new file mode 100644 index 000000000000..8392abcfc3c2 --- /dev/null +++ b/hibernate-orm-modules/module-templates/antlr.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hibernate-orm-modules/module-templates/antrl-runtime.xml b/hibernate-orm-modules/module-templates/antrl-runtime.xml new file mode 100644 index 000000000000..c54c9c220813 --- /dev/null +++ b/hibernate-orm-modules/module-templates/antrl-runtime.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hibernate-orm-modules/module-templates/hibernate-core.xml b/hibernate-orm-modules/module-templates/hibernate-core.xml index ec645f1fa729..b1f402a87be3 100644 --- a/hibernate-orm-modules/module-templates/hibernate-core.xml +++ b/hibernate-orm-modules/module-templates/hibernate-core.xml @@ -20,7 +20,8 @@ - + + diff --git a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateEnversOnWildflyTest.java b/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateEnversOnWildflyTest.java index b1f995cfcedc..8306b569321f 100644 --- a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateEnversOnWildflyTest.java +++ b/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateEnversOnWildflyTest.java @@ -28,6 +28,7 @@ import org.jboss.shrinkwrap.descriptor.api.persistence21.PersistenceDescriptor; import org.jboss.shrinkwrap.descriptor.api.persistence21.PersistenceUnitTransactionType; import org.junit.Test; +import org.junit.jupiter.api.Disabled; import org.junit.runner.RunWith; import static org.junit.Assert.assertEquals; @@ -35,7 +36,9 @@ /** * @author Chris Cranford */ -@RunWith(Arquillian.class) +// todo (6.0) : re-enable the test when envers is fixed + +//@RunWith(Arquillian.class) public class HibernateEnversOnWildflyTest { private static final String ORM_VERSION = Session.class.getPackage().getImplementationVersion(); @@ -70,7 +73,7 @@ private static PersistenceDescriptor persistenceXml() { @Inject private UserTransaction userTransaction; - @Test +// @Test public void testEnversCompatibility() throws Exception { // revision 1 userTransaction.begin();