@@ -323,8 +323,6 @@ public Class<?> loadClass(String name) throws ClassNotFoundException {
323
323
}
324
324
325
325
if (isQuarkusTest && !isIntegrationTest ) {
326
-
327
- preloadTestResourceClasses (inspectionClass );
328
326
QuarkusClassLoader runtimeClassLoader = getQuarkusClassLoader (inspectionClass , profile );
329
327
Class <?> clazz = runtimeClassLoader .loadClass (name );
330
328
@@ -334,14 +332,13 @@ public Class<?> loadClass(String name) throws ClassNotFoundException {
334
332
}
335
333
336
334
} catch (NoSuchMethodException e ) {
337
- // TODO better handling of these
338
- System .err .println ("Could not get method " + e );
335
+ log .error ("Could not get method " + e );
339
336
throw new RuntimeException (e );
340
337
} catch (InvocationTargetException e ) {
341
- System . err . println ("Could not invoke " + e );
338
+ log . error ("Could not invoke " + e );
342
339
throw new RuntimeException (e );
343
340
} catch (IllegalAccessException e ) {
344
- System . err . println ("Could not access " + e );
341
+ log . error ("Could not access " + e );
345
342
throw new RuntimeException (e );
346
343
}
347
344
@@ -378,42 +375,6 @@ private boolean registersQuarkusTestExtensionWithExtendsWith(Class<?> inspection
378
375
379
376
}
380
377
381
- /*
382
- * What's this for?
383
- * It's a bit like detecting the location in a privacy test or detecting the lab environment in an emissions test and then
384
- * deciding how to behave.
385
- * We're special-casing behaviour for a hard-coded selection of test packages. Yuck!
386
- * TODO Hopefully, once https://github.com/quarkusio/quarkus/issues/45785 is done, it will not be needed.
387
- * Some tests, especially in kubernetes-client and openshift-client, check config to decide whether to start a dev service.
388
- * That happens at augmentation, which happens before test execution.
389
- * In the old model, the test class would have already been loaded by JUnit first, and it would have had a chance to write
390
- * config to the system properties.
391
- * That config would influence whether dev services were started.
392
- * TODO even without 45785 it might be nice to find a better way, perhaps rewriting the AbstractKubernetesTestResource test
393
- * resource to work differently?
394
- *
395
- */
396
- private void preloadTestResourceClasses (Class <?> fromCanary ) {
397
- try {
398
- Class <Annotation > ca = (Class <Annotation >) peekingClassLoader
399
- .loadClass ("io.quarkus.test.common.QuarkusTestResource" );
400
- List <Annotation > ans = AnnotationSupport .findRepeatableAnnotations (fromCanary , ca );
401
- for (Annotation a : ans ) {
402
- Method m = a
403
- .getClass ()
404
- .getMethod (VALUE );
405
- Class <?> resourceClass = (Class <?>) m .invoke (a );
406
- // Only do this hack for the resources we know need it, since it can cause failures in other areas
407
- if (resourceClass .getName ().contains ("Kubernetes" )) {
408
- getParent ().loadClass (resourceClass .getName ());
409
- }
410
- }
411
- } catch (ClassNotFoundException | InvocationTargetException | NoSuchMethodException | IllegalAccessException e ) {
412
- // In some projects, these classes are not on the canary classpath. That's fine, we know there's nothing to preload.
413
- log .debug ("Canary classloader could not preload test resources:" + e );
414
- }
415
- }
416
-
417
378
private boolean registersQuarkusTestExtensionOnField (Class <?> inspectionClass ) {
418
379
419
380
try {
0 commit comments