Skip to content

Commit

Permalink
Re-enabled hibernate-orm-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
dreab8 committed Mar 12, 2020
1 parent 7ee45f6 commit d88d4a8
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 20 deletions.
4 changes: 3 additions & 1 deletion gradle/libraries.gradle
Expand Up @@ -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}",
Expand Down
30 changes: 15 additions & 15 deletions hibernate-core/hibernate-core.gradle
Expand Up @@ -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 {
Expand Down
9 changes: 8 additions & 1 deletion hibernate-orm-modules/hibernate-orm-modules.gradle
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -106,16 +108,21 @@ 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
testCompile libraries.shrinkwrap_descriptors_impl_javaee
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 {
Expand Down
22 changes: 22 additions & 0 deletions hibernate-orm-modules/module-templates/antlr.xml
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Hibernate, Relational Persistence for Idiomatic Java
~
~ License: GNU Lesser General Public License (LGPL), version 2.1 or later.
~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
-->
<module xmlns="urn:jboss:module:1.3" name="org.antlr" slot="${antlrSlot}">
<properties>
<property name="jboss.api" value="private"/>
</properties>

<resources>
<artifact name="${org.antlr:antlr4}"/>
</resources>
<dependencies>
<module name="org.antlr-runtime" slot="${antlrSlot}" />
</dependencies>
<!-- <dependencies>-->
<!-- &lt;!&ndash; ByteBuddy currently uses sun.misc.Unsafe &ndash;&gt;-->
<!-- <module name="sun.jdk"/>-->
</module>
19 changes: 19 additions & 0 deletions hibernate-orm-modules/module-templates/antrl-runtime.xml
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Hibernate, Relational Persistence for Idiomatic Java
~
~ License: GNU Lesser General Public License (LGPL), version 2.1 or later.
~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
-->
<module xmlns="urn:jboss:module:1.3" name="org.antlr-runtime" slot="${antlrSlot}">
<properties>
<property name="jboss.api" value="private"/>
</properties>

<resources>
<artifact name="${org.antlr:antlr4-runtime}"/>
</resources>
<!-- <dependencies>-->
<!-- &lt;!&ndash; ByteBuddy currently uses sun.misc.Unsafe &ndash;&gt;-->
<!-- <module name="sun.jdk"/>-->
</module>
3 changes: 2 additions & 1 deletion hibernate-orm-modules/module-templates/hibernate-core.xml
Expand Up @@ -20,7 +20,8 @@
<module name="javax.transaction.api"/>
<module name="javax.validation.api"/>
<module name="javax.xml.bind.api"/>
<module name="org.antlr"/>
<module name="org.antlr" slot="${antlrSlot}"/>
<module name="org.antlr-runtime" slot="${antlrSlot}"/>
<module name="org.dom4j"/>
<module name="org.jboss.as.jpa.spi"/>
<module name="org.jboss.jandex"/>
Expand Down
Expand Up @@ -28,14 +28,17 @@
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;

/**
* @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();
Expand Down Expand Up @@ -70,7 +73,7 @@ private static PersistenceDescriptor persistenceXml() {
@Inject
private UserTransaction userTransaction;

@Test
// @Test
public void testEnversCompatibility() throws Exception {
// revision 1
userTransaction.begin();
Expand Down

0 comments on commit d88d4a8

Please sign in to comment.