41
41
import org .hibernate .search .util .impl .integrationtest .mapper .orm .OrmSetupHelper ;
42
42
import org .hibernate .search .util .impl .test .annotation .TestForIssue ;
43
43
44
+ import org .junit .jupiter .api .AfterEach ;
44
45
import org .junit .jupiter .api .BeforeEach ;
45
46
import org .junit .jupiter .api .Test ;
46
- import org .junit .jupiter .api .TestInstance ;
47
47
import org .junit .jupiter .api .extension .RegisterExtension ;
48
- import org .junit .jupiter .params .BeforeParameterizedClassInvocation ;
49
48
import org .junit .jupiter .params .Parameter ;
50
49
import org .junit .jupiter .params .ParameterizedClass ;
51
50
import org .junit .jupiter .params .provider .Arguments ;
56
55
*/
57
56
@ ParameterizedClass
58
57
@ MethodSource ("params" )
59
- @ TestInstance (TestInstance .Lifecycle .PER_CLASS )
60
58
class MassIndexingJobIT {
61
59
62
60
public static List <? extends Arguments > params () {
@@ -79,22 +77,19 @@ public static List<? extends Arguments> params() {
79
77
@ RegisterExtension
80
78
public static OrmSetupHelper ormSetupHelper = OrmSetupHelper .withSingleBackend ( BackendConfigurations .simple () );
81
79
82
- private static EntityManagerFactory emf ;
80
+ private EntityManagerFactory emf ;
83
81
84
82
@ Parameter (0 )
85
83
static boolean jpaCompliance ;
86
84
87
- @ BeforeParameterizedClassInvocation
88
- static void setup () {
85
+ @ BeforeEach
86
+ void initData () {
89
87
emf = ormSetupHelper .start ()
90
88
.withAnnotatedTypes ( Company .class , Person .class , WhoAmI .class , CompanyGroup .class )
91
89
.withProperty ( "hibernate.jpa.compliance.query" , jpaCompliance )
92
90
.withProperty ( HibernateOrmMapperSettings .INDEXING_LISTENERS_ENABLED , false )
93
91
.setup ();
94
- }
95
92
96
- @ BeforeEach
97
- void initData () {
98
93
List <Company > companies = new ArrayList <>();
99
94
List <Person > people = new ArrayList <>();
100
95
List <WhoAmI > whos = new ArrayList <>();
@@ -133,6 +128,11 @@ void initData() {
133
128
} );
134
129
}
135
130
131
+ @ AfterEach
132
+ void tearDown () {
133
+ emf .close ();
134
+ }
135
+
136
136
@ Test
137
137
void simple () throws InterruptedException {
138
138
List <Company > companies = JobTestUtil .findIndexedResults ( emf , Company .class , "name" , "Google" );
0 commit comments