diff --git a/build.gradle b/build.gradle index a67fae0768..16fa4683f4 100644 --- a/build.gradle +++ b/build.gradle @@ -55,8 +55,8 @@ task release { "the fact that subprojects will appropriately define a release task " + "themselves if they have any release-related activities to perform" - // Force to release with JDK 8. Releasing with JDK 11 is not supported yet: - // - the hibernate-orm-modules tests do not run due to an issue with the ASM version currently used by Gradle + // Force to release with JDK 8. It used to not work on JDK11 because of the hibernate-orm-modules module, + // but this limitation might be resolved now that this module has been deleted? doFirst { if ( !JavaVersion.current().isJava8() || !gradle.ext.testedJavaVersionAsEnum.isJava8() ) { throw new IllegalStateException( "Please use JDK 8 to perform the release." ) diff --git a/documentation/documentation.gradle b/documentation/documentation.gradle index 9d4537fe0a..d70f308364 100644 --- a/documentation/documentation.gradle +++ b/documentation/documentation.gradle @@ -15,7 +15,6 @@ ext { 'hibernate-infinispan', 'hibernate-ehcache', 'hibernate-java8', - 'hibernate-orm-modules', 'hibernate-integrationtest-java-modules', 'release' ] diff --git a/hibernate-core/hibernate-core.gradle b/hibernate-core/hibernate-core.gradle index a819188ff8..3a993d727d 100644 --- a/hibernate-core/hibernate-core.gradle +++ b/hibernate-core/hibernate-core.gradle @@ -245,17 +245,11 @@ processTestResources { 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 { systemProperty 'file.encoding', 'utf-8' beforeTest { descriptor -> diff --git a/hibernate-core/src/test/resources/arquillian.xml b/hibernate-core/src/test/resources/arquillian.xml deleted file mode 100644 index 923d29f3dc..0000000000 --- a/hibernate-core/src/test/resources/arquillian.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - ${wildFlyInstallDir} - - - - - -Dee8.preview.mode=true - -Djava.net.preferIPv4Stack=true - -Djgroups.bind_addr=127.0.0.1 - - - - - diff --git a/hibernate-orm-modules/hibernate-orm-modules.gradle b/hibernate-orm-modules/hibernate-orm-modules.gradle deleted file mode 100644 index 75d9e975be..0000000000 --- a/hibernate-orm-modules/hibernate-orm-modules.gradle +++ /dev/null @@ -1,159 +0,0 @@ -/* - * 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 . - */ - -plugins { - id "org.wildfly.build.provision" version '0.0.11' - id "org.wildfly.build.featurepack" version '0.0.11' -} - - - -apply from: rootProject.file( 'gradle/base-information.gradle' ) -apply plugin: 'java' -apply from: rootProject.file( 'gradle/libraries.gradle' ) - -ext { - // NOTE : `wildflyVersion` comes from libraries.gradle... - - // "10" for WildFly 10.x, "11" for 11.x, etc - wildFlyMajorVersion = project.wildflyVersion.split( '\\.' )[0] - bytebuddyVersion = project.byteBuddyVersion - artifactClassifier = "wildfly-${wildFlyMajorVersion}-dist" - wildFlyInstallDir = "$rootProject.buildDir/wildfly" - fpackStagingDir = file( "target/featurepack" ) //Target build directory for the Feature Pack -} - -description = "Feature Pack of Hibernate ORM modules for WildFly ${project.wildFlyMajorVersion}" - -apply plugin: 'maven-publish' -apply plugin: 'org.hibernate.build.maven-repo-auth' -apply from: rootProject.file( 'gradle/publishing-repos.gradle' ) -apply from: rootProject.file( 'gradle/publishing-pom.gradle' ) - -apply plugin: 'build-dashboard' -apply plugin: 'project-report' - -project.tasks.jar.enabled = false -project.tasks.javadoc.enabled = false - -evaluationDependsOn( ':hibernate-core' ) -evaluationDependsOn( ':hibernate-envers' ) - -configurations { - featurePack { - description = "Dependencies to be included in the published Feature Pack" - } - provisioning { - description = "Dependencies which should be made available to the provisioning of WildFly" - } -} - -repositories { - mavenLocal() - mavenCentral() - maven { - name 'jboss-public' - url 'https://repository.jboss.org/nexus/content/groups/public/' - } -} - -//This builds the WildFly Feature Packs which define the Hibernate ORM modules -// # Definitions of the modules are in /module-templates -// # Versions of the included libraries are defined in the "featurePack" configuration (below) -// # See the "variables" option to replace tokens in the module definitions -// # This just creates the exploded feature pack: does NOT create a zip nor a publication, which are handled by other tasks below. -featurepack { - moduleTemplates = file( 'module-templates' ) //where to find the templates for module.xml files to generate - destinationDir = project.fpackStagingDir - configurationName 'featurePack' - // Variables to be replaced in the template. N.B. not all variables need to be replaced! - // Exact ORM version, e.g. "5.3.0.Final" - 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['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 - //Ensure we declare all source repositories explicitly - autoAddRepositories = false -} - -task createCoreFeaturePackZip( type: Zip, dependsOn: [featurepack] ) { - baseName 'hibernate-orm-jbossmodules' - from project.fpackStagingDir -} - -provision { - dependsOn( createCoreFeaturePackZip ) - dependsOn( ":hibernate-envers:jar") - dependsOn( ":hibernate-core:jar") - configuration = file( 'wildfly-server-provisioning.xml' ) - destinationDir = file( "$project.wildFlyInstallDir" ) - //Override HCANN: - override( 'org.hibernate.common:hibernate-commons-annotations' ) { - version = project.hibernateCommonsVersion - } - variables['wildfly.version'] = project.wildflyVersion - variables['hibernate-orm.version'] = rootProject.ormVersion.fullName - //Ensure we declare all source repositories explicitly - autoAddRepositories = false -} - -dependencies { - testCompile project( ":hibernate-core" ) - testCompile project( ":hibernate-envers" ) - testCompile libraries.junit - 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 project( ":hibernate-core" ) - featurePack project( ":hibernate-envers" ) - featurePack "org.wildfly:jipijapa-hibernate5:${wildflyVersion}" -} - -publishing { - publications { - publishedArtifacts { - artifact( createCoreFeaturePackZip ) { - artifactId 'hibernate-orm-jbossmodules' - description 'Main feature pack of Hibernate ORM: hibernate-core and hibernate-envers, including essential dependencies such as Byte Buddy' - } - } - } -} - -task ciBuild( dependsOn: [clean, test, publish] ) -task release( dependsOn: [clean, test, bintrayUpload] ) - -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// tasks related to in-container (Arquillian + WF) testing - -task prepareWildFlyForTests( dependsOn: [provision] ) { - description = 'Downloads the WildFly distribution, installs it into a local directory, includes present version of Hibernate ORM, JPA 2.2 : ready for integration tests' -} - -test { - exclude 'org/hibernate/wildfly/model/**' -} - - -test.dependsOn prepareWildFlyForTests - -processTestResources { - expand( - [ - wildFlyInstallDir : project.wildFlyInstallDir, - arquillianDeploymentExportDir: "${rootProject.buildDir.absolutePath}/arquillian-deployments" - ] - ) -} - diff --git a/hibernate-orm-modules/module-templates/byte-buddy.xml b/hibernate-orm-modules/module-templates/byte-buddy.xml deleted file mode 100644 index 4fe38e65cd..0000000000 --- a/hibernate-orm-modules/module-templates/byte-buddy.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/hibernate-orm-modules/module-templates/hibernate-core-alias.xml b/hibernate-orm-modules/module-templates/hibernate-core-alias.xml deleted file mode 100644 index 76629f5cda..0000000000 --- a/hibernate-orm-modules/module-templates/hibernate-core-alias.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/hibernate-orm-modules/module-templates/hibernate-core-old-deprecated.xml b/hibernate-orm-modules/module-templates/hibernate-core-old-deprecated.xml deleted file mode 100644 index 0c934089dc..0000000000 --- a/hibernate-orm-modules/module-templates/hibernate-core-old-deprecated.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/hibernate-orm-modules/module-templates/hibernate-core.xml b/hibernate-orm-modules/module-templates/hibernate-core.xml deleted file mode 100644 index 12e4571933..0000000000 --- a/hibernate-orm-modules/module-templates/hibernate-core.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/hibernate-orm-modules/module-templates/hibernate-envers-alias.xml b/hibernate-orm-modules/module-templates/hibernate-envers-alias.xml deleted file mode 100644 index a46c6bb75a..0000000000 --- a/hibernate-orm-modules/module-templates/hibernate-envers-alias.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/hibernate-orm-modules/module-templates/hibernate-envers.xml b/hibernate-orm-modules/module-templates/hibernate-envers.xml deleted file mode 100644 index 2fc49d8a4f..0000000000 --- a/hibernate-orm-modules/module-templates/hibernate-envers.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/hibernate-orm-modules/module-templates/jipijapa-alias.xml b/hibernate-orm-modules/module-templates/jipijapa-alias.xml deleted file mode 100644 index 464929e667..0000000000 --- a/hibernate-orm-modules/module-templates/jipijapa-alias.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/hibernate-orm-modules/module-templates/jipijapa.xml b/hibernate-orm-modules/module-templates/jipijapa.xml deleted file mode 100644 index f41fea1b30..0000000000 --- a/hibernate-orm-modules/module-templates/jipijapa.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 deleted file mode 100644 index b1f995cfce..0000000000 --- a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateEnversOnWildflyTest.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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 . - */ -package org.hibernate.wildfly.integrationtest; - -import java.util.Arrays; - -import javax.inject.Inject; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.transaction.UserTransaction; - -import org.hibernate.Session; -import org.hibernate.envers.AuditReader; -import org.hibernate.envers.AuditReaderFactory; -import org.hibernate.wildfly.model.AuditedEntity; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.persistence21.PersistenceDescriptor; -import org.jboss.shrinkwrap.descriptor.api.persistence21.PersistenceUnitTransactionType; -import org.junit.Test; -import org.junit.runner.RunWith; - -import static org.junit.Assert.assertEquals; - -/** - * @author Chris Cranford - */ -@RunWith(Arquillian.class) -public class HibernateEnversOnWildflyTest { - - private static final String ORM_VERSION = Session.class.getPackage().getImplementationVersion(); - private static final String ORM_MINOR_VERSION = ORM_VERSION.substring( 0, ORM_VERSION.indexOf( ".", ORM_VERSION.indexOf( "." ) + 1 ) ); - - @Deployment - public static WebArchive createDeployment() { - return ShrinkWrap.create( WebArchive.class ) - .addClass( AuditedEntity.class ) - .addAsWebInfResource( EmptyAsset.INSTANCE, "beans.xml" ) - .addAsResource( new StringAsset( persistenceXml().exportAsString() ), "META-INF/persistence.xml" ); - } - - private static PersistenceDescriptor persistenceXml() { - return Descriptors.create( PersistenceDescriptor.class ) - .version( "2.1" ) - .createPersistenceUnit() - .name( "primary" ) - .transactionType( PersistenceUnitTransactionType._JTA ) - .jtaDataSource( "java:jboss/datasources/ExampleDS" ) - .getOrCreateProperties() - // We want to use the ORM from this build instead of the one coming with WildFly - .createProperty().name( "jboss.as.jpa.providerModule" ).value( "org.hibernate:" + ORM_MINOR_VERSION ).up() - .createProperty().name( "hibernate.hbm2ddl.auto" ).value( "create-drop" ).up() - .createProperty().name( "hibernate.allow_update_outside_transaction" ).value( "true" ).up() - .up().up(); - } - - @PersistenceContext - private EntityManager entityManager; - - @Inject - private UserTransaction userTransaction; - - @Test - public void testEnversCompatibility() throws Exception { - // revision 1 - userTransaction.begin(); - entityManager.joinTransaction(); - AuditedEntity entity = new AuditedEntity( 1, "Marco Polo" ); - entityManager.persist( entity ); - userTransaction.commit(); - - // revision 2 - userTransaction.begin(); - entityManager.joinTransaction(); - entity.setName( "George Washington" ); - entityManager.merge( entity ); - userTransaction.commit(); - - entityManager.clear(); - - // verify audit history revision counts - userTransaction.begin(); - final AuditReader auditReader = AuditReaderFactory.get( entityManager ); - assertEquals( Arrays.asList( 1, 2 ), auditReader.getRevisions( AuditedEntity.class, 1 ) ); - userTransaction.commit(); - } -} diff --git a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateModulesOnWildflyTest.java b/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateModulesOnWildflyTest.java deleted file mode 100644 index 99ff429b88..0000000000 --- a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/HibernateModulesOnWildflyTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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 . - */ -package org.hibernate.wildfly.integrationtest; - -import static org.hamcrest.core.IsEqual.equalTo; -import static org.junit.Assert.assertThat; - -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; - -import org.hibernate.Session; -import org.hibernate.wildfly.model.Kryptonite; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.persistence21.PersistenceDescriptor; -import org.jboss.shrinkwrap.descriptor.api.persistence21.PersistenceUnitTransactionType; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * Integration test for using the current Hibernate ORM version on WildFly. - *

- * Gradle will unzip the targeted WildFly version and unpack the module ZIP created by this build into the server's - * module directory. Arquillian is used to start this WildFly instance, run this test on the server and stop the server - * again. - * - * @author Gunnar Morling - */ -@RunWith(Arquillian.class) -public class HibernateModulesOnWildflyTest { - - private static final String ORM_VERSION = Session.class.getPackage().getImplementationVersion(); - private static final String ORM_MINOR_VERSION = ORM_VERSION.substring( 0, ORM_VERSION.indexOf( ".", ORM_VERSION.indexOf( "." ) + 1) ); - - @Deployment - public static WebArchive createDeployment() { - return ShrinkWrap.create( WebArchive.class ) - .addClass( Kryptonite.class ) - .addAsWebInfResource( EmptyAsset.INSTANCE, "beans.xml" ) - .addAsResource( new StringAsset( persistenceXml().exportAsString() ), "META-INF/persistence.xml" ); - } - - private static PersistenceDescriptor persistenceXml() { - return Descriptors.create( PersistenceDescriptor.class ) - .version( "2.1" ) - .createPersistenceUnit() - .name( "primary" ) - .transactionType( PersistenceUnitTransactionType._JTA ) - .jtaDataSource( "java:jboss/datasources/ExampleDS" ) - .getOrCreateProperties() - // We want to use the ORM from this build instead of the one coming with WildFly - .createProperty().name( "jboss.as.jpa.providerModule" ).value( "org.hibernate:" + ORM_MINOR_VERSION ).up() - .createProperty().name( "hibernate.hbm2ddl.auto" ).value( "create-drop" ).up() - .createProperty().name( "hibernate.allow_update_outside_transaction" ).value( "true" ).up() - .up().up(); - } - - @PersistenceContext - private EntityManager entityManager; - - @Test - public void shouldUseHibernateOrm52() { - Session session = entityManager.unwrap( Session.class ); - - Kryptonite kryptonite1 = new Kryptonite(); - kryptonite1.id = 1L; - kryptonite1.description = "Some Kryptonite"; - session.persist( kryptonite1 ); - - // EntityManager methods exposed through Session only as of 5.2 - Kryptonite loaded = session.find( Kryptonite.class, 1L ); - - assertThat( loaded.description, equalTo( "Some Kryptonite" ) ); - } -} diff --git a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/JavassistHibernateModulesOnWildflyTest.java b/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/JavassistHibernateModulesOnWildflyTest.java deleted file mode 100644 index 3a4e396182..0000000000 --- a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/JavassistHibernateModulesOnWildflyTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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 . - */ -package org.hibernate.wildfly.integrationtest; - -import java.util.Properties; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; - -import org.hibernate.Session; -import org.hibernate.bytecode.internal.javassist.BytecodeProviderImpl; -import org.hibernate.bytecode.spi.BasicProxyFactory; -import org.hibernate.bytecode.spi.BytecodeProvider; -import org.hibernate.bytecode.spi.ProxyFactoryFactory; -import org.hibernate.cfg.AvailableSettings; -import org.hibernate.cfg.Environment; -import org.hibernate.wildfly.model.Kryptonite; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.Asset; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.persistence21.PersistenceDescriptor; -import org.jboss.shrinkwrap.descriptor.api.persistence21.PersistenceUnitTransactionType; - -import static org.hamcrest.core.IsEqual.equalTo; -import static org.hamcrest.core.IsNull.notNullValue; -import static org.junit.Assert.assertThat; - -/** - * The purpose of this test is to check that it's still possible to use Javassist as byte code provider with WildFly. - */ -@RunWith(Arquillian.class) -public class JavassistHibernateModulesOnWildflyTest { - - private static final String ORM_VERSION = Session.class.getPackage().getImplementationVersion(); - private static final String ORM_MINOR_VERSION = ORM_VERSION.substring( 0, ORM_VERSION.indexOf( ".", ORM_VERSION.indexOf( "." ) + 1) ); - - @Deployment - public static WebArchive createDeployment() { - return ShrinkWrap.create( WebArchive.class ) - .addClass( Kryptonite.class ) - .addAsWebInfResource( EmptyAsset.INSTANCE, "beans.xml" ) - .addAsResource( persistenceXml(), "META-INF/persistence.xml" ); - } - - private static Asset persistenceXml() { - PersistenceDescriptor persistenceXml = Descriptors.create( PersistenceDescriptor.class ) - .version( "2.1" ) - .createPersistenceUnit() - .name( "primary" ) - .transactionType( PersistenceUnitTransactionType._JTA ) - .jtaDataSource( "java:jboss/datasources/ExampleDS" ) - .getOrCreateProperties() - // We want to use the ORM from this build instead of the one coming with WildFly - .createProperty().name( "jboss.as.jpa.providerModule" ).value( "org.hibernate:" + ORM_MINOR_VERSION ).up() - .createProperty().name( "hibernate.hbm2ddl.auto" ).value( "create-drop" ).up() - .createProperty().name( "hibernate.allow_update_outside_transaction" ).value( "true" ).up() - .up().up(); - return new StringAsset( persistenceXml.exportAsString() ); - } - - @PersistenceContext - private EntityManager entityManager; - - @Test - public void shouldUseHibernateOrm52() { - Session session = entityManager.unwrap( Session.class ); - - Kryptonite kryptonite1 = new Kryptonite(); - kryptonite1.id = 1L; - kryptonite1.description = "Some Kryptonite"; - session.persist( kryptonite1 ); - - // EntityManager methods exposed through Session only as of 5.2 - Kryptonite loaded = session.find( Kryptonite.class, 1L ); - - assertThat( loaded.description, equalTo( "Some Kryptonite" ) ); - } - - @Test - public void shouldBeAbleToCreateProxyWithJavassist() { - Properties properties = new Properties(); - properties.setProperty( AvailableSettings.BYTECODE_PROVIDER, Environment.BYTECODE_PROVIDER_NAME_JAVASSIST ); - - // hibernate.bytecode.provider is a system property. I don't want to apply it - // to the arquillian.xml because it will change the other tests as well. - // I guess this is a more explicit way anyway to test that Javassist is available. - BytecodeProvider provider = Environment.buildBytecodeProvider( properties ); - assertThat( provider.getClass(), equalTo( BytecodeProviderImpl.class ) ); - - ProxyFactoryFactory factory = provider.getProxyFactoryFactory(); - BasicProxyFactory basicProxyFactory = factory.buildBasicProxyFactory( Kryptonite.class, null ); - Object proxy = basicProxyFactory.getProxy(); - assertThat( proxy, notNullValue() ); - } -} diff --git a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/TransactionRollbackTest.java b/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/TransactionRollbackTest.java deleted file mode 100644 index 6f4123451d..0000000000 --- a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/integrationtest/TransactionRollbackTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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 . - */ -package org.hibernate.wildfly.integrationtest; - -import javax.persistence.EntityManager; -import javax.persistence.EntityTransaction; -import javax.persistence.PersistenceContext; - -import org.hibernate.Session; -import org.hibernate.engine.transaction.spi.TransactionImplementor; -import org.hibernate.wildfly.model.Kryptonite; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit.Arquillian; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.asset.EmptyAsset; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.descriptor.api.Descriptors; -import org.jboss.shrinkwrap.descriptor.api.persistence21.PersistenceDescriptor; -import org.jboss.shrinkwrap.descriptor.api.persistence21.PersistenceUnitTransactionType; - -import static org.junit.Assert.assertFalse; - -/** - * @author Andrea Boriero - */ -@RunWith(Arquillian.class) -public class TransactionRollbackTest { - - private static final String ORM_VERSION = Session.class.getPackage().getImplementationVersion(); - private static final String ORM_MINOR_VERSION = ORM_VERSION.substring( 0, - ORM_VERSION.indexOf( - ".", - ORM_VERSION.indexOf( "." ) + 1 - ) - ); - - @Deployment - public static WebArchive createDeployment() { - return ShrinkWrap.create( WebArchive.class ) - .addClass( Kryptonite.class ) - .addAsWebInfResource( EmptyAsset.INSTANCE, "beans.xml" ) - .addAsResource( new StringAsset( persistenceXml().exportAsString() ), "META-INF/persistence.xml" ); - } - - private static PersistenceDescriptor persistenceXml() { - return Descriptors.create( PersistenceDescriptor.class ) - .version( "2.1" ) - .createPersistenceUnit() - .name( "primary" ) - .transactionType( PersistenceUnitTransactionType._RESOURCE_LOCAL ) - .jtaDataSource( "java:jboss/datasources/ExampleDS" ) - .getOrCreateProperties() - // We want to use the ORM from this build instead of the one coming with WildFly - .createProperty() - .name( "jboss.as.jpa.providerModule" ) - .value( "org.hibernate:" + ORM_MINOR_VERSION ) - .up() - .createProperty() - .name( "hibernate.hbm2ddl.auto" ) - .value( "create-drop" ) - .up() - .createProperty() - .name( "hibernate.allow_update_outside_transaction" ) - .value( "true" ) - .up() - .up() - .up(); - } - - @PersistenceContext - private EntityManager entityManager; - - @Test - public void testMarkRollbackOnlyAnUnactiveTransaction() { - EntityTransaction transaction = entityManager.getTransaction(); - final TransactionImplementor hibernateTransaction = (TransactionImplementor) transaction; - hibernateTransaction.markRollbackOnly(); - transaction.rollback(); - assertFalse( transaction.isActive() ); - } - - @Test - public void testMarkRollbackOnlyAnActiveTransaction() { - EntityTransaction transaction = entityManager.getTransaction(); - final TransactionImplementor hibernateTransaction = (TransactionImplementor) transaction; - transaction.begin(); - hibernateTransaction.markRollbackOnly(); - transaction.rollback(); - assertFalse( transaction.isActive() ); - } -} diff --git a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/model/AuditedEntity.java b/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/model/AuditedEntity.java deleted file mode 100644 index 0d6f48950a..0000000000 --- a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/model/AuditedEntity.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 . - */ -package org.hibernate.wildfly.model; - -import javax.persistence.Entity; -import javax.persistence.Id; - -import org.hibernate.envers.Audited; - -/** - * @author Chris Cranford - */ -@Audited -@Entity -public class AuditedEntity { - @Id - private Integer id; - - private String name; - - AuditedEntity() { - - } - - public AuditedEntity(Integer id, String name) { - this.id = id; - this.name = name; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object object) { - if ( this == object ) { - return true; - } - if ( object == null || !( object instanceof AuditedEntity ) ) { - return false; - } - - AuditedEntity that = (AuditedEntity) object; - return !( name != null ? !name.equals( that.name ) : that.name != null ); - } - - @Override - public int hashCode() { - return ( name != null ? name.hashCode() : 0 ); - } -} diff --git a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/model/Kryptonite.java b/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/model/Kryptonite.java deleted file mode 100644 index 3ab61e224b..0000000000 --- a/hibernate-orm-modules/src/test/java/org/hibernate/wildfly/model/Kryptonite.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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 . - */ -package org.hibernate.wildfly.model; - -import javax.persistence.Entity; -import javax.persistence.Id; - -/** - * @author Gunnar Morling - */ -@Entity -public class Kryptonite { - - @Id - public long id; - - public String description; -} diff --git a/hibernate-orm-modules/src/test/resources/arquillian.xml b/hibernate-orm-modules/src/test/resources/arquillian.xml deleted file mode 100644 index 29026d4096..0000000000 --- a/hibernate-orm-modules/src/test/resources/arquillian.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - ${wildFlyInstallDir} - - - - - -Dee8.preview.mode=true - -Djava.net.preferIPv4Stack=true - -Djgroups.bind_addr=127.0.0.1 - - - - - diff --git a/hibernate-orm-modules/wildfly-server-provisioning.xml b/hibernate-orm-modules/wildfly-server-provisioning.xml deleted file mode 100644 index b7bab85a9b..0000000000 --- a/hibernate-orm-modules/wildfly-server-provisioning.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - diff --git a/settings.gradle b/settings.gradle index aa16052c52..0ecb383e96 100644 --- a/settings.gradle +++ b/settings.gradle @@ -63,7 +63,6 @@ include 'hibernate-ehcache' include 'hibernate-infinispan' include 'hibernate-jipijapa' -include 'hibernate-orm-modules' include 'hibernate-graalvm' if ( JavaVersion.current().isJava11Compatible() ) {