diff --git a/plugins/tester/src/main/java/com.github.forax.pro.plugin.tester/com/github/forax/pro/plugin/tester/TesterPlugin.java b/plugins/tester/src/main/java/com.github.forax.pro.plugin.tester/com/github/forax/pro/plugin/tester/TesterPlugin.java index bcf5598..d93b05b 100644 --- a/plugins/tester/src/main/java/com.github.forax.pro.plugin.tester/com/github/forax/pro/plugin/tester/TesterPlugin.java +++ b/plugins/tester/src/main/java/com.github.forax.pro.plugin.tester/com/github/forax/pro/plugin/tester/TesterPlugin.java @@ -3,6 +3,7 @@ import static com.github.forax.pro.api.MutableConfig.derive; import java.io.IOException; +import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.UndeclaredThrowableException; @@ -88,9 +89,11 @@ private int execute(TesterConf tester, Path testPath) throws IOException { var loader = createTestClassLoader(tester, testPath, moduleName); var testConfClass = load(loader, TestConf.class); - var testConf = create(testConfClass, new Class[] { java.lang.module.ModuleDescriptor.class, boolean.class}, moduleDescriptor, tester.parallel()); + var testConfTypes = new Class[] {ModuleDescriptor.class, boolean.class}; + var testConf = create(testConfClass, testConfTypes, moduleDescriptor, tester.parallel()); var runnerClass = load(loader, TesterRunner.class); - var runner = (IntSupplier) create(runnerClass, new Class[] { testConfClass }, testConf); + var runnerTypes = new Class[] {testConfClass}; + var runner = (IntSupplier) create(runnerClass, runnerTypes, testConf); try { var future = executor.submit(runner::getAsInt); diff --git a/plugins/tester/src/main/java/com.github.forax.pro.plugin.tester/com/github/forax/pro/plugin/tester/TesterRunner.java b/plugins/tester/src/main/java/com.github.forax.pro.plugin.tester/com/github/forax/pro/plugin/tester/TesterRunner.java index 03b68ac..764695a 100644 --- a/plugins/tester/src/main/java/com.github.forax.pro.plugin.tester/com/github/forax/pro/plugin/tester/TesterRunner.java +++ b/plugins/tester/src/main/java/com.github.forax.pro.plugin.tester/com/github/forax/pro/plugin/tester/TesterRunner.java @@ -34,15 +34,16 @@ private static int launchJUnitPlatform(TestConf testConf) { var moduleName = testConf.moduleName(); var moduleNameAndVersion = testConf.moduleNameAndVersion(); var parallel = testConf.parallel(); - + var builder = LauncherDiscoveryRequestBuilder.request(); builder.selectors(selectModule(moduleName)); - builder.configurationParameter("junit.jupiter.execution.parallel.enabled", "" + parallel); + builder.configurationParameter("junit.jupiter.execution.parallel.enabled", Boolean.toString(parallel)); - var startTimeMillis = System.currentTimeMillis(); + var launcher = LauncherFactory.create(); var launcherDiscoveryRequest = builder.build(); var summaryGeneratingListener = new SummaryGeneratingListener(); - LauncherFactory.create().execute(launcherDiscoveryRequest, summaryGeneratingListener); + var startTimeMillis = System.currentTimeMillis(); + launcher.execute(launcherDiscoveryRequest, summaryGeneratingListener); var duration = System.currentTimeMillis() - startTimeMillis; var summary = summaryGeneratingListener.getSummary(); int failures = (int) summary.getTestsFailedCount();