From 7e4df3f805c6155ba3f534230958862b1fbbdba6 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Thu, 29 Aug 2024 13:02:09 +0200 Subject: [PATCH] HHH-18543 Skip GenericCompositeUserTypeTest for JVM OpenJ9 --- .../generic/GenericCompositeUserTypeTest.java | 46 +++++++++---------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cut/generic/GenericCompositeUserTypeTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cut/generic/GenericCompositeUserTypeTest.java index bd96bbc83e..f4caec7a98 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cut/generic/GenericCompositeUserTypeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cut/generic/GenericCompositeUserTypeTest.java @@ -1,34 +1,30 @@ package org.hibernate.orm.test.cut.generic; -import org.hibernate.Session; -import org.hibernate.Transaction; - import org.hibernate.testing.TestForIssue; -import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; -import org.junit.Test; +import org.hibernate.testing.orm.junit.DomainModel; +import org.hibernate.testing.orm.junit.SessionFactory; +import org.hibernate.testing.orm.junit.SessionFactoryScope; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfSystemProperty; @TestForIssue(jiraKey = "HHH-17019") -public class GenericCompositeUserTypeTest extends BaseCoreFunctionalTestCase { +@DomainModel( + annotatedClasses = { + GenericCompositeUserTypeEntity.class + } +) +@SessionFactory +public class GenericCompositeUserTypeTest { - @Override - protected Class[] getAnnotatedClasses() { - return new Class[] { - GenericCompositeUserTypeEntity.class - }; - } + @Test + @DisabledIfSystemProperty(named = "java.vm.name", matches = "\\b.*OpenJ9.*\\b", disabledReason = "https://github.com/eclipse-openj9/openj9/issues/19369") + public void hhh17019Test(SessionFactoryScope scope) { + scope.inTransaction( session -> { + EnumPlaceholder placeholder = new EnumPlaceholder<>( Weekdays.MONDAY, Weekdays.SUNDAY ); + GenericCompositeUserTypeEntity entity = new GenericCompositeUserTypeEntity( placeholder ); - @Test - public void hhh17019Test() throws Exception { - Session s = openSession(); - Transaction tx = s.beginTransaction(); - - EnumPlaceholder placeholder = new EnumPlaceholder<>( Weekdays.MONDAY, Weekdays.SUNDAY ); - GenericCompositeUserTypeEntity entity = new GenericCompositeUserTypeEntity( placeholder ); - - s.persist( entity ); - - tx.commit(); - s.close(); - } + session.persist( entity ); + } ); + } }