|
4 | 4 | */ |
5 | 5 | package org.hibernate.orm.test.array; |
6 | 6 |
|
7 | | -import java.util.Date; |
8 | | - |
9 | | -import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; |
10 | | -import org.junit.Test; |
11 | | - |
12 | 7 | import jakarta.persistence.Column; |
13 | 8 | import jakarta.persistence.ElementCollection; |
14 | 9 | import jakarta.persistence.Entity; |
15 | 10 | import jakarta.persistence.GeneratedValue; |
16 | 11 | import jakarta.persistence.Id; |
17 | 12 | import jakarta.persistence.OrderColumn; |
| 13 | +import org.hibernate.testing.orm.junit.DomainModel; |
| 14 | +import org.hibernate.testing.orm.junit.SessionFactory; |
| 15 | +import org.hibernate.testing.orm.junit.SessionFactoryScope; |
| 16 | +import org.junit.jupiter.api.Test; |
18 | 17 |
|
19 | | -public class DateArrayTest extends BaseCoreFunctionalTestCase { |
| 18 | +import java.util.Date; |
20 | 19 |
|
21 | | - @Override |
22 | | - protected Class<?>[] getAnnotatedClasses() { |
23 | | - return new Class[] { DateArrayEntity.class }; |
24 | | - } |
| 20 | +@DomainModel( |
| 21 | + annotatedClasses = { |
| 22 | + DateArrayTest.DateArrayEntity.class |
| 23 | + } |
| 24 | +) |
| 25 | +@SessionFactory |
| 26 | +public class DateArrayTest { |
25 | 27 |
|
26 | 28 | @Test |
27 | | - public void run() throws InterruptedException { |
28 | | - inTransaction( session -> { |
| 29 | + public void run(SessionFactoryScope scope) { |
| 30 | + scope.inTransaction( session -> { |
29 | 31 | DateArrayEntity entity = new DateArrayEntity(); |
30 | | - entity.setDates( new Date[] { new Date() } ); |
| 32 | + entity.setDates( new Date[] {new Date()} ); |
31 | 33 | session.persist( entity ); |
32 | 34 | } ); |
33 | 35 | } |
34 | 36 |
|
35 | 37 | @Entity(name = "DateArrayEntity") |
36 | | - public class DateArrayEntity { |
| 38 | + public static class DateArrayEntity { |
37 | 39 |
|
38 | 40 | @Id |
39 | 41 | @GeneratedValue |
|
0 commit comments