Skip test failing on Java 1.9 using Gradle

This commit is contained in:
Vlad Mihalcea 2016-09-20 20:01:13 +03:00
parent bd8c3c226d
commit cc21eeb1af
3 changed files with 11 additions and 10 deletions

View File

@ -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( { processTestResources.doLast( {
copy { copy {
from( sourceSets.test.java.srcDirs ) { from( sourceSets.test.java.srcDirs ) {

View File

@ -16,7 +16,6 @@ import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.userguide.model.Image; import org.hibernate.userguide.model.Image;
import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.RequiresDialect;
import org.hibernate.testing.Skip;
import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider; import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider;
import org.junit.Test; import org.junit.Test;
@ -61,7 +60,6 @@ public class LazyBasicAttributeTest extends BaseEntityManagerFunctionalTestCase
} }
@Test @Test
@Skip(condition = Skip.JdkVersion._1_9.class, message = "On Java 1.9, bytecode enhancement does not work on pre-release!")
public void test() { public void test() {
doInJPA( this::entityManagerFactory, entityManager -> { doInJPA( this::entityManagerFactory, entityManager -> {
Image image = new Image(); Image image = new Image();

View File

@ -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" );
}
}
}
} }