|
1 | 1 | package org.hibernate.orm.test.cut.generic;
|
2 | 2 |
|
3 |
| -import org.hibernate.Session; |
4 |
| -import org.hibernate.Transaction; |
5 |
| - |
6 | 3 | import org.hibernate.testing.TestForIssue;
|
7 |
| -import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; |
8 |
| -import org.junit.Test; |
| 4 | +import org.hibernate.testing.orm.junit.DomainModel; |
| 5 | +import org.hibernate.testing.orm.junit.SessionFactory; |
| 6 | +import org.hibernate.testing.orm.junit.SessionFactoryScope; |
| 7 | +import org.junit.jupiter.api.Test; |
| 8 | +import org.junit.jupiter.api.condition.DisabledIfSystemProperty; |
9 | 9 |
|
10 | 10 |
|
11 | 11 | @TestForIssue(jiraKey = "HHH-17019")
|
12 |
| -public class GenericCompositeUserTypeTest extends BaseCoreFunctionalTestCase { |
13 |
| - |
14 |
| - @Override |
15 |
| - protected Class<?>[] getAnnotatedClasses() { |
16 |
| - return new Class<?>[] { |
17 |
| - GenericCompositeUserTypeEntity.class |
18 |
| - }; |
19 |
| - } |
20 |
| - |
21 |
| - @Test |
22 |
| - public void hhh17019Test() throws Exception { |
23 |
| - Session s = openSession(); |
24 |
| - Transaction tx = s.beginTransaction(); |
25 |
| - |
26 |
| - EnumPlaceholder<Weekdays, Weekdays> placeholder = new EnumPlaceholder<>( Weekdays.MONDAY, Weekdays.SUNDAY ); |
27 |
| - GenericCompositeUserTypeEntity entity = new GenericCompositeUserTypeEntity( placeholder ); |
28 |
| - |
29 |
| - s.persist( entity ); |
30 |
| - |
31 |
| - tx.commit(); |
32 |
| - s.close(); |
33 |
| - } |
| 12 | +@DomainModel( |
| 13 | + annotatedClasses = { |
| 14 | + GenericCompositeUserTypeEntity.class |
| 15 | + } |
| 16 | +) |
| 17 | +@SessionFactory |
| 18 | +public class GenericCompositeUserTypeTest { |
| 19 | + |
| 20 | + @Test |
| 21 | + @DisabledIfSystemProperty(named = "java.vm.name", matches = "\\b.*OpenJ9.*\\b", disabledReason = "https://github.com/eclipse-openj9/openj9/issues/19369") |
| 22 | + public void hhh17019Test(SessionFactoryScope scope) { |
| 23 | + scope.inTransaction( session -> { |
| 24 | + EnumPlaceholder<Weekdays, Weekdays> placeholder = new EnumPlaceholder<>( Weekdays.MONDAY, Weekdays.SUNDAY ); |
| 25 | + GenericCompositeUserTypeEntity entity = new GenericCompositeUserTypeEntity( placeholder ); |
| 26 | + |
| 27 | + session.persist( entity ); |
| 28 | + } ); |
| 29 | + } |
34 | 30 | }
|
0 commit comments