diff --git a/build.gradle b/build.gradle index e1d8ce2be7..34c4c917b1 100644 --- a/build.gradle +++ b/build.gradle @@ -244,6 +244,10 @@ subprojects { subProject -> // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // testing subProject.tasks.withType( Test.class ).all { task -> + if ( JavaVersion.current().isJava9Compatible() ) { + // Byteman needs this property to be set, https://developer.jboss.org/thread/274997 + task.jvmArgs += ["-Djdk.attach.allowAttachSelf=true"] + } task.jvmArgs += [ '-XX:+HeapDumpOnOutOfMemoryError', "-XX:HeapDumpPath=${project.file( "${project.buildDir}/OOM-dump.hprof" ).absolutePath}", diff --git a/hibernate-core/hibernate-core.gradle b/hibernate-core/hibernate-core.gradle index 94bef1cc24..6b75ea0f29 100644 --- a/hibernate-core/hibernate-core.gradle +++ b/hibernate-core/hibernate-core.gradle @@ -221,25 +221,6 @@ artifacts { tests testJar } -if ( JavaVersion.current().isJava9Compatible() ) { - logger.warn( '[WARN] Skipping Javassist-related tests for hibernate-core due to Javassist JDK 9 incompatibility' ) - - // we need to exclude tests using Javassist enhancement, which does not properly support - // Java 9 yet - https://issues.jboss.org/browse/JASSIST-261 - test { - // rather than wild-cards, keep an explicit list - exclude 'org/hibernate/jpa/test/enhancement/InterceptFieldClassFileTransformerTest.class' - exclude 'org/hibernate/jpa/test/enhancement/runtime/JpaRuntimeEnhancementTest.class' - exclude 'org/hibernate/test/bytecode/enhancement/EnhancerTest.class' - exclude 'org/hibernate/test/bytecode/enhancement/basic/BasicInSessionTest.class' - - // also, any tests using Arquillian for in-container testing with WildFly currently - // need to be excluded because WildFly does not yet work with Java 9 - exclude 'org/hibernate/test/wf/ddl/**' - exclude 'org/hibernate/jpa/test/cdi/**' - } -} - processTestResources { doLast { copy { diff --git a/hibernate-envers/hibernate-envers.gradle b/hibernate-envers/hibernate-envers.gradle index 19d1268ad1..85b9f48cb2 100644 --- a/hibernate-envers/hibernate-envers.gradle +++ b/hibernate-envers/hibernate-envers.gradle @@ -91,16 +91,3 @@ tasks."matrix_mariadb" { println "Starting test: " + descriptor } } - -if ( JavaVersion.current().isJava9Compatible() ) { - logger.warn( '[WARN] Skipping Javassist-related tests for hibernate-envers due to Javassist JDK 9 incompatibility' ) - - // we need to exclude tests using Javassist enhancement, which does not properly support - // Java 9 yet - https://issues.jboss.org/browse/JASSIST-261 - test { - // rather than wild-cards, keep an explicit list - exclude 'org/hibernate/envers/internal/tools/MapProxyTest.class' - exclude 'org/hibernate/envers/test/integration/components/dynamic/AuditedDynamicComponentTest.class' - exclude 'org/hibernate/envers/test/integration/components/dynamic/AuditedDynamicComponentsAdvancedCasesTest.class' - } -} \ No newline at end of file diff --git a/hibernate-hikaricp/hibernate-hikaricp.gradle b/hibernate-hikaricp/hibernate-hikaricp.gradle index a88257e0c2..2cb26c7503 100644 --- a/hibernate-hikaricp/hibernate-hikaricp.gradle +++ b/hibernate-hikaricp/hibernate-hikaricp.gradle @@ -44,10 +44,3 @@ mavenPom { def osgiDescription() { return mavenPom.description } - -if ( JavaVersion.current().isJava9Compatible() ) { - logger.warn( '[WARN] Skipping all tests for hibernate-hikaricp due to Javassist JDK 9 incompatibility' ) - - // Hikari CP relies on Javassist which we know has issues with Java 9 - test.enabled = false -} diff --git a/hibernate-orm-modules/hibernate-orm-modules.gradle b/hibernate-orm-modules/hibernate-orm-modules.gradle index 3612f29c1e..751b670339 100644 --- a/hibernate-orm-modules/hibernate-orm-modules.gradle +++ b/hibernate-orm-modules/hibernate-orm-modules.gradle @@ -72,6 +72,29 @@ dependencies { testCompile libraries.shrinkwrap_descriptors_api_javaee testCompile libraries.shrinkwrap_descriptors_impl_javaee testCompile libraries.wildfly_arquillian_container_managed + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Java 9 ftw! + if ( JavaVersion.current().isJava9Compatible() ) { + compile( 'com.sun.xml.bind:jaxb-impl:2.2.11' ) + compile( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' ) + compile( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' ) + compile( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' ) + compile( 'javax:javaee-api:7.0' ) + + testCompile( 'com.sun.xml.bind:jaxb-impl:2.2.11' ) + testCompile( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' ) + testCompile( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' ) + testCompile( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' ) + testCompile( 'javax:javaee-api:7.0' ) + + testRuntime( 'com.sun.xml.bind:jaxb-impl:2.2.11' ) + testRuntime( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' ) + testRuntime( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' ) + testRuntime( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' ) + testRuntime( 'javax:javaee-api:7.0' ) + } + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } @@ -154,12 +177,6 @@ build.dependsOn createModulesZip // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // tasks related to in-container (Arquillian + WF) testing -if ( JavaVersion.current().isJava9Compatible() ) { - logger.lifecycle( "WARNING - Skipping hibernate-orm-modules tests for Java 9" ) - // WildFly has problems booting in Java 9 - test.enabled = false -} - task installWildFly(type: Copy) { description = 'Downloads the WildFly distribution and installs it into a local directory (if needed)' diff --git a/hibernate-osgi/hibernate-osgi.gradle b/hibernate-osgi/hibernate-osgi.gradle index 5ba874a8ff..4b31f9c785 100644 --- a/hibernate-osgi/hibernate-osgi.gradle +++ b/hibernate-osgi/hibernate-osgi.gradle @@ -412,6 +412,7 @@ publishing { } if ( JavaVersion.current().isJava9Compatible() ) { + logger.warn( '[WARN] Skipping all tests for hibernate-osg due to Karaf issues with JDK 9' ) // Hikari CP relies on Javassist which we know has issues with Java 9 test.enabled = false } diff --git a/hibernate-proxool/hibernate-proxool.gradle b/hibernate-proxool/hibernate-proxool.gradle index 7a4d147ba7..0d99fe30b5 100644 --- a/hibernate-proxool/hibernate-proxool.gradle +++ b/hibernate-proxool/hibernate-proxool.gradle @@ -8,6 +8,31 @@ dependencies { compile project( ':hibernate-core' ) compile( libraries.proxool ) testCompile project( ':hibernate-testing' ) + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Java 9 ftw! + if ( JavaVersion.current().isJava9Compatible() ) { + // The JDK used to run Gradle is Java 9+, and we assume that that is the same + // JDK for executing tasks + compile( 'com.sun.xml.bind:jaxb-impl:2.2.11' ) + compile( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' ) + compile( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' ) + compile( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' ) + compile( 'javax:javaee-api:7.0' ) + + testCompile( 'com.sun.xml.bind:jaxb-impl:2.2.11' ) + testCompile( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' ) + testCompile( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' ) + testCompile( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' ) + testCompile( 'javax:javaee-api:7.0' ) + + testRuntime( 'com.sun.xml.bind:jaxb-impl:2.2.11' ) + testRuntime( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' ) + testRuntime( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' ) + testRuntime( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' ) + testRuntime( 'javax:javaee-api:7.0' ) + } + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } mavenPom { diff --git a/libraries.gradle b/libraries.gradle index f171a3b130..ca982aa978 100644 --- a/libraries.gradle +++ b/libraries.gradle @@ -12,7 +12,7 @@ ext { junitVersion = '4.12' // h2Version = '1.2.145' h2Version = '1.3.176' - bytemanVersion = '3.0.6' + bytemanVersion = '3.0.10' infinispanVersion = '8.2.5.Final' jnpVersion = '5.0.6.CR1' elVersion = '2.2.4' @@ -105,8 +105,8 @@ ext { informix: 'com.ibm.informix:jdbc:4.10.7.20160517', jboss_jta: "org.jboss.jbossts:jbossjta:4.16.4.Final", xapool: "com.experlog:xapool:1.5.0", - mockito: 'org.mockito:mockito-core:2.7.5', - mockito_inline: 'org.mockito:mockito-inline:2.7.5', + mockito: 'org.mockito:mockito-core:2.10.0', + mockito_inline: 'org.mockito:mockito-inline:2.10.0', validator: 'org.hibernate:hibernate-validator:5.2.4.Final', // EL required by Hibernate Validator at test runtime