24
24
import java .util .function .Supplier ;
25
25
26
26
import org .hibernate .testing .bytecode .enhancement .extension .BytecodeEnhanced ;
27
- import org .hibernate .testing .junit4 .BaseUnitTestCase ;
28
27
import org .junit .jupiter .api .Assertions ;
29
28
import org .junit .jupiter .api .ClassOrderer ;
30
29
import org .junit .jupiter .api .DisplayNameGenerator ;
31
30
import org .junit .jupiter .api .MethodOrderer ;
32
31
import org .junit .jupiter .api .TestInstance ;
33
32
import org .junit .jupiter .api .extension .ExecutionCondition ;
33
+ import org .junit .jupiter .api .extension .Extension ;
34
34
import org .junit .jupiter .api .extension .ExtensionContext ;
35
+ import org .junit .jupiter .api .extension .TestInstantiationAwareExtension ;
35
36
import org .junit .jupiter .api .io .CleanupMode ;
36
37
import org .junit .jupiter .api .io .TempDirFactory ;
37
38
import org .junit .jupiter .api .parallel .ExecutionMode ;
48
49
import org .junit .platform .engine .ExecutionRequest ;
49
50
import org .junit .platform .engine .TestDescriptor ;
50
51
import org .junit .platform .engine .UniqueId ;
52
+ import org .junit .platform .engine .reporting .OutputDirectoryProvider ;
51
53
import org .junit .platform .engine .support .hierarchical .EngineExecutionContext ;
52
54
import org .junit .platform .engine .support .hierarchical .HierarchicalTestEngine ;
53
55
import org .junit .platform .engine .support .hierarchical .ThrowableCollector ;
@@ -127,6 +129,7 @@ private void addEnhancementCheck(boolean enhance, String[] testEnhancedClasses,
127
129
descriptor .getTestClass ().getName ()
128
130
),
129
131
descriptor .getTestClass (),
132
+ descriptor ::getEnclosingTestClasses ,
130
133
jc ,
131
134
enhance ,
132
135
testEnhancedClasses
@@ -162,6 +165,7 @@ private void replaceWithEnhanced(Class<?> enhanced, ClassBasedTestDescriptor des
162
165
convertUniqueId ( child .getUniqueId (), enhancementContextId ),
163
166
updated .getTestClass (),
164
167
findMethodReplacement ( updated , testMethod ),
168
+ updated ::getEnclosingTestClasses ,
165
169
configuration
166
170
)
167
171
);
@@ -173,6 +177,7 @@ private void replaceWithEnhanced(Class<?> enhanced, ClassBasedTestDescriptor des
173
177
convertUniqueId ( child .getUniqueId (), enhancementContextId ),
174
178
updated .getTestClass (),
175
179
findMethodReplacement ( updated , testMethod ),
180
+ updated ::getEnclosingTestClasses ,
176
181
configuration
177
182
) );
178
183
}
@@ -251,6 +256,11 @@ private DelegatingJupiterConfiguration(JupiterConfiguration configuration, Objec
251
256
);
252
257
}
253
258
259
+ @ Override
260
+ public Predicate <Class <? extends Extension >> getFilterForAutoDetectedExtensions () {
261
+ return configuration .getFilterForAutoDetectedExtensions ();
262
+ }
263
+
254
264
@ Override
255
265
public Optional <String > getRawConfigurationParameter (String s ) {
256
266
return configuration .getRawConfigurationParameter ( s );
@@ -276,6 +286,11 @@ public boolean isExtensionAutoDetectionEnabled() {
276
286
return configuration .isExtensionAutoDetectionEnabled ();
277
287
}
278
288
289
+ @ Override
290
+ public boolean isThreadDumpOnTimeoutEnabled () {
291
+ return configuration .isThreadDumpOnTimeoutEnabled ();
292
+ }
293
+
279
294
@ Override
280
295
public ExecutionMode getDefaultExecutionMode () {
281
296
return configuration .getDefaultExecutionMode ();
@@ -320,6 +335,16 @@ public CleanupMode getDefaultTempDirCleanupMode() {
320
335
public Supplier <TempDirFactory > getDefaultTempDirFactorySupplier () {
321
336
return configuration .getDefaultTempDirFactorySupplier ();
322
337
}
338
+
339
+ @ Override
340
+ public TestInstantiationAwareExtension .ExtensionContextScope getDefaultTestInstantiationExtensionContextScope () {
341
+ return configuration .getDefaultTestInstantiationExtensionContextScope ();
342
+ }
343
+
344
+ @ Override
345
+ public OutputDirectoryProvider getOutputDirectoryProvider () {
346
+ return configuration .getOutputDirectoryProvider ();
347
+ }
323
348
}
324
349
325
350
private static class DelegatingDisplayNameGenerator implements DisplayNameGenerator {
@@ -342,13 +367,13 @@ private String prefix() {
342
367
}
343
368
344
369
@ Override
345
- public String generateDisplayNameForNestedClass (Class <?> aClass ) {
346
- return prefix () + delegate .generateDisplayNameForNestedClass ( aClass );
370
+ public String generateDisplayNameForNestedClass (List < Class <?>> enclosingInstanceTypes , Class <?> nestedClass ) {
371
+ return prefix () + delegate .generateDisplayNameForNestedClass ( enclosingInstanceTypes , nestedClass );
347
372
}
348
373
349
374
@ Override
350
- public String generateDisplayNameForMethod (Class <?> aClass , Method method ) {
351
- return prefix () + delegate .generateDisplayNameForMethod ( aClass , method );
375
+ public String generateDisplayNameForMethod (List < Class <?>> enclosingInstanceTypes , Class <?> testClass , Method testMethod ) {
376
+ return prefix () + delegate .generateDisplayNameForMethod ( enclosingInstanceTypes , testClass , testMethod );
352
377
}
353
378
}
354
379
@@ -357,12 +382,11 @@ private static class EnhancementWorkedCheckMethodTestDescriptor extends TestMeth
357
382
private final boolean enhanced ;
358
383
private final String [] classes ;
359
384
360
- public EnhancementWorkedCheckMethodTestDescriptor (UniqueId uniqueId , Class <?> testClass ,
361
- JupiterConfiguration configuration ,
362
- boolean enhanced , String [] classes ) {
385
+ public EnhancementWorkedCheckMethodTestDescriptor (UniqueId uniqueId , Class <?> testClass , Supplier <List <Class <?>>> enclosingInstanceTypes , JupiterConfiguration configuration , boolean enhanced , String [] classes ) {
363
386
super (
364
387
prepareId ( uniqueId , testMethod ( enhanced ) ),
365
388
testClass , testMethod ( enhanced ),
389
+ enclosingInstanceTypes ,
366
390
configuration
367
391
);
368
392
this .enhanced = enhanced ;
0 commit comments