File tree Expand file tree Collapse file tree 5 files changed +35
-75
lines changed
hibernate-core/src/test/java/org/hibernate/orm/test/mapping/access Expand file tree Collapse file tree 5 files changed +35
-75
lines changed Original file line number Diff line number Diff line change 1515import jakarta .persistence .Id ;
1616import jakarta .persistence .JoinColumn ;
1717
18- import org .hibernate .orm .test .jpa .BaseEntityManagerFunctionalTestCase ;
19-
20- import org .junit .Test ;
21-
22- import static org .hibernate .testing .transaction .TransactionUtil .doInJPA ;
18+ import org .hibernate .testing .orm .junit .EntityManagerFactoryScope ;
19+ import org .hibernate .testing .orm .junit .Jpa ;
20+ import org .junit .jupiter .api .Test ;
2321
2422/**
2523 * @author Vlad Mihalcea
2624 */
27- public class ElementCollectionAccessTest extends BaseEntityManagerFunctionalTestCase {
28-
29- @ Override
30- protected Class <?>[] getAnnotatedClasses () {
31- return new Class <?>[] {
32- Book .class
33- };
34- }
25+ @ Jpa (annotatedClasses = {ElementCollectionAccessTest .Book .class })
26+ public class ElementCollectionAccessTest {
3527
3628 @ Test
37- public void test () {
38- doInJPA ( this :: entityManagerFactory , entityManager -> {
29+ public void test (EntityManagerFactoryScope scope ) {
30+ scope . inTransaction ( entityManager -> {
3931 Book book = new Book ();
4032 book .setId (1L );
4133 book .setTitle ("High-Performance Java Persistence" );
Original file line number Diff line number Diff line change 1111import jakarta .persistence .Entity ;
1212import jakarta .persistence .Id ;
1313
14- import org .hibernate .orm .test .jpa .BaseEntityManagerFunctionalTestCase ;
15-
16- import org .junit .Test ;
17-
18- import static org .hibernate .testing .transaction .TransactionUtil .doInJPA ;
14+ import org .hibernate .testing .orm .junit .EntityManagerFactoryScope ;
15+ import org .hibernate .testing .orm .junit .Jpa ;
16+ import org .junit .jupiter .api .Test ;
1917
2018/**
2119 * @author Vlad Mihalcea
2220 */
23- public class EmbeddableAccessTest extends BaseEntityManagerFunctionalTestCase {
24-
25- @ Override
26- protected Class <?>[] getAnnotatedClasses () {
27- return new Class <?>[] {
28- Book .class
29- };
30- }
21+ @ Jpa (annotatedClasses = {EmbeddableAccessTest .Book .class })
22+ public class EmbeddableAccessTest {
3123
3224 @ Test
33- public void test () {
34- doInJPA ( this :: entityManagerFactory , entityManager -> {
25+ public void test (EntityManagerFactoryScope scope ) {
26+ scope . inTransaction ( entityManager -> {
3527 Book book = new Book ();
3628 book .setId (1L );
3729 book .setTitle ("High-Performance Java Persistence" );
Original file line number Diff line number Diff line change 77import jakarta .persistence .Entity ;
88import jakarta .persistence .Id ;
99
10- import org .hibernate .orm .test .jpa .BaseEntityManagerFunctionalTestCase ;
11-
12- import org .junit .Test ;
13-
14- import static org .hibernate .testing .transaction .TransactionUtil .doInJPA ;
10+ import org .hibernate .testing .orm .junit .EntityManagerFactoryScope ;
11+ import org .hibernate .testing .orm .junit .Jpa ;
12+ import org .junit .jupiter .api .Test ;
1513
1614/**
1715 * @author Vlad Mihalcea
1816 */
19- public class FieldAccessTest extends BaseEntityManagerFunctionalTestCase {
20-
21- @ Override
22- protected Class <?>[] getAnnotatedClasses () {
23- return new Class <?>[] {
24- Book .class
25- };
26- }
17+ @ Jpa (annotatedClasses = {FieldAccessTest .Book .class })
18+ public class FieldAccessTest {
2719
2820 @ Test
29- public void test () {
30- doInJPA ( this :: entityManagerFactory , entityManager -> {
21+ public void test (EntityManagerFactoryScope scope ) {
22+ scope . inTransaction ( entityManager -> {
3123 Book book = new Book ();
3224 book .setId (1L );
3325 book .setTitle ("High-Performance Java Persistence" );
Original file line number Diff line number Diff line change 1010import jakarta .persistence .Id ;
1111import jakarta .persistence .Version ;
1212
13- import org .hibernate .orm .test .jpa .BaseEntityManagerFunctionalTestCase ;
14-
15- import org .junit .Test ;
16-
17- import static org .hibernate .testing .transaction .TransactionUtil .doInJPA ;
13+ import org .hibernate .testing .orm .junit .EntityManagerFactoryScope ;
14+ import org .hibernate .testing .orm .junit .Jpa ;
15+ import org .junit .jupiter .api .Test ;
1816
1917/**
2018 * @author Vlad Mihalcea
2119 */
22- public class PropertyAccessOverrideTest extends BaseEntityManagerFunctionalTestCase {
23-
24- @ Override
25- protected Class <?>[] getAnnotatedClasses () {
26- return new Class <?>[] {
27- Book .class
28- };
29- }
20+ @ Jpa (annotatedClasses = {PropertyAccessOverrideTest .Book .class })
21+ public class PropertyAccessOverrideTest {
3022
3123 @ Test
32- public void test () {
33- doInJPA ( this :: entityManagerFactory , entityManager -> {
24+ public void test (EntityManagerFactoryScope scope ) {
25+ scope . inTransaction ( entityManager -> {
3426 Book book = new Book ();
3527 book .setId (1L );
3628 book .setTitle ("High-Performance Java Persistence" );
Original file line number Diff line number Diff line change 77import jakarta .persistence .Entity ;
88import jakarta .persistence .Id ;
99
10- import org .hibernate .orm .test .jpa .BaseEntityManagerFunctionalTestCase ;
11-
12- import org .junit .Test ;
13-
14- import static org .hibernate .testing .transaction .TransactionUtil .doInJPA ;
10+ import org .hibernate .testing .orm .junit .EntityManagerFactoryScope ;
11+ import org .hibernate .testing .orm .junit .Jpa ;
12+ import org .junit .jupiter .api .Test ;
1513
1614/**
1715 * @author Vlad Mihalcea
1816 */
19- public class PropertyAccessTest extends BaseEntityManagerFunctionalTestCase {
20-
21- @ Override
22- protected Class <?>[] getAnnotatedClasses () {
23- return new Class <?>[] {
24- Book .class
25- };
26- }
17+ @ Jpa (annotatedClasses = {PropertyAccessTest .Book .class })
18+ public class PropertyAccessTest {
2719
2820 @ Test
29- public void test () {
30- doInJPA ( this :: entityManagerFactory , entityManager -> {
21+ public void test (EntityManagerFactoryScope scope ) {
22+ scope . inTransaction ( entityManager -> {
3123 Book book = new Book ();
3224 book .setId (1L );
3325 book .setTitle ("High-Performance Java Persistence" );
You can’t perform that action at this time.
0 commit comments