Skip to content

Commit

Permalink
Polish JupiterConfigProvider (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazar-mitrovic committed Sep 23, 2022
2 parents b79c692 + 14c6a08 commit dda0a59
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ public void onLoad(NativeImageConfiguration config) {
for (String className : buildTimeInitializedClasses) {
config.initializeAtBuildTime(className);
}

try {
Class <?> executor = Class.forName("org.junit.jupiter.engine.extension.TimeoutExtension$ExecutorResource");
config.registerAllClassMembersForReflection(executor);
} catch (ClassNotFoundException e) {
debug("Failed to register class for reflection. Reason: %s", e);
}
}

@Override
Expand All @@ -100,13 +107,6 @@ public void onTestClassRegistered(Class<?> testClass, NativeImageConfiguration r
AnnotationUtils.registerClassesFromAnnotationForReflection(testClass, registry, MethodSource.class, JupiterConfigProvider::handleMethodSource);
AnnotationUtils.registerClassesFromAnnotationForReflection(testClass, registry, EnabledIf.class, JupiterConfigProvider::handleEnabledIf);
AnnotationUtils.registerClassesFromAnnotationForReflection(testClass, registry, DisabledIf.class, JupiterConfigProvider::handleDisabledIf);

try {
Class <?> executor = Class.forName("org.junit.jupiter.engine.extension.TimeoutExtension$ExecutorResource");
registry.registerAllClassMembersForReflection(executor);
} catch (ClassNotFoundException e) {
debug("Failed to register class for reflection. Reason: %s", e);
}
}

private static Class<?>[] handleMethodSource(MethodSource annotation) {
Expand Down

0 comments on commit dda0a59

Please sign in to comment.