Extract launcher core out of tester plugin
I'd like to extract the core functionality from the tester-plugin into a standalone module living on "central". This new module could be used by any framework, including pro, that needs to launch the JUnit Platform in a modular testing environment.
Types to be extracted
From package: https://github.com/forax/pro/blob/master/plugins/tester/src/main/java/com.github.forax.pro.plugin.tester/com/github/forax/pro/plugin/tester/
-
TestConf.java-- holding the test setup configuration fixture ... story -
TesterRunner.java-- launching the test run for a given instance ofTestConf - parts of
TesterPlugin.java-- doing bootstrap work creating module layer, class loaders, etc... like:
https://github.com/forax/pro/blob/cae819eeb0e63b81045c8461742314e9cec7b6bb/plugins/tester/src/main/java/com.github.forax.pro.plugin.tester/com/github/forax/pro/plugin/tester/TesterPlugin.java#L86-L100
What do you think, @forax?
This can not be a part of JUnit ?
Good idea. Should work ... but would require --release 9 or higher, thus turn junit-platform-launcher into a mrjar, or it lands in a dedicated JUnit Platform project.
@junit-team What do you think?
Started project junit-platform-isolator https://github.com/sormuras/junit-platform-isolator -- it cares for isolating main, test, and platform classes at test runtime. After it has reached 1.0 GA statues, pro's tester plugin could use that library and prune the launcher code here.
Isolator
https://github.com/sormuras/junit-platform-isolator/blob/master/junit-platform-isolator-base-8/src/main/java/de/sormuras/junit/platform/isolator/Isolator.java#L65-L70
Module Loader
https://github.com/sormuras/junit-platform-isolator/blob/master/junit-platform-isolator-java-11/src/main/java/de/sormuras/junit/platform/isolator/OverlaySingleton.java#L16-L25
Runner/Worker
https://github.com/sormuras/junit-platform-isolator/tree/master/junit-platform-isolator-worker/src/main/java/de/sormuras/junit/platform/isolator/worker
Note
The first client of junit-platform-isolator is the JUnit Platform Maven Plugin: https://github.com/sormuras/junit-platform-maven-plugin
This can not be a part of JUnit?
With https://github.com/junit-team/junit5/issues/797 being implemented and shipping soon with JUnit Platform 1.6.x ... pro/tester (and other test run launching programs) may use this java.util.spi.ToolProvider entry-point to launch a test run. Inputs are two printer writer (or streams) for expected/normal and error output and an array of arguments. A run yields an integer exit code.
yes, go for it !