Open sormuras opened 6 years ago
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.
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.
As of today, JUnit Platform 1.6.0 is GA.
Use junit
as a provided tool?
yes, go for it !
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 ... storyTesterRunner.java
-- launching the test run for a given instance ofTestConf
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?