From cc21eeb1af22d3b2ab77b37b99509930e6003bce Mon Sep 17 00:00:00 2001 From: Vlad Mihalcea Date: Tue, 20 Sep 2016 20:01:13 +0300 Subject: [PATCH] Skip test failing on Java 1.9 using Gradle --- documentation/documentation.gradle | 11 +++++++++++ .../userguide/fetching/LazyBasicAttributeTest.java | 2 -- .../src/main/java/org/hibernate/testing/Skip.java | 8 -------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/documentation/documentation.gradle b/documentation/documentation.gradle index 38bd11fe9b..b1be184079 100644 --- a/documentation/documentation.gradle +++ b/documentation/documentation.gradle @@ -120,6 +120,17 @@ dependencies { // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } +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/userguide/fetching/LazyBasicAttributeTest.class' + } +} + processTestResources.doLast( { copy { from( sourceSets.test.java.srcDirs ) { diff --git a/documentation/src/test/java/org/hibernate/userguide/fetching/LazyBasicAttributeTest.java b/documentation/src/test/java/org/hibernate/userguide/fetching/LazyBasicAttributeTest.java index 1136ad8292..f8a4d023e7 100644 --- a/documentation/src/test/java/org/hibernate/userguide/fetching/LazyBasicAttributeTest.java +++ b/documentation/src/test/java/org/hibernate/userguide/fetching/LazyBasicAttributeTest.java @@ -16,7 +16,6 @@ import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase; import org.hibernate.userguide.model.Image; import org.hibernate.testing.RequiresDialect; -import org.hibernate.testing.Skip; import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.junit.Test; @@ -61,7 +60,6 @@ public class LazyBasicAttributeTest extends BaseEntityManagerFunctionalTestCase } @Test - @Skip(condition = Skip.JdkVersion._1_9.class, message = "On Java 1.9, bytecode enhancement does not work on pre-release!") public void test() { doInJPA( this::entityManagerFactory, entityManager -> { Image image = new Image(); diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/Skip.java b/hibernate-testing/src/main/java/org/hibernate/testing/Skip.java index da345a79a1..417e0dc591 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/Skip.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/Skip.java @@ -60,12 +60,4 @@ public @interface Skip { } } } - interface JdkVersion { - class _1_9 implements Matcher { - @Override - public boolean isMatch() { - return System.getProperty("java.version").toLowerCase().startsWith( "1.9" ); - } - } - } }