mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-06 19:36:03 +00:00
Disable bytecode enhancement for documentation module as well as the test that makes use of this feature if the JDK version is 1.9
This commit is contained in:
parent
2b30cabf2f
commit
bd8c3c226d
@ -32,9 +32,12 @@ apply from: "${rootProject.projectDir}/utilities.gradle"
|
||||
|
||||
apply plugin: 'org.hibernate.orm'
|
||||
|
||||
hibernate {
|
||||
enhance {
|
||||
enableLazyInitialization = true
|
||||
// Java 9 ftw!
|
||||
if ( !JavaVersion.current().isJava9Compatible() ) {
|
||||
hibernate {
|
||||
enhance {
|
||||
enableLazyInitialization = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
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;
|
||||
|
||||
@ -60,6 +61,7 @@ public void releaseResources() {
|
||||
}
|
||||
|
||||
@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();
|
||||
|
@ -60,4 +60,12 @@ public boolean isMatch() {
|
||||
}
|
||||
}
|
||||
}
|
||||
interface JdkVersion {
|
||||
class _1_9 implements Matcher {
|
||||
@Override
|
||||
public boolean isMatch() {
|
||||
return System.getProperty("java.version").toLowerCase().startsWith( "1.9" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user