forax / pro

A Java build tool that works seamlessly with modules
GNU General Public License v3.0
103 stars 15 forks source link

Extract launcher core out of tester plugin #63

Open sormuras opened 6 years ago

sormuras commented 6 years ago

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/

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?

forax commented 6 years ago

This can not be a part of JUnit ?

sormuras commented 6 years ago

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?

sormuras commented 5 years ago

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

sormuras commented 5 years ago

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.

sormuras commented 4 years ago

As of today, JUnit Platform 1.6.0 is GA.

Use junit as a provided tool?

forax commented 4 years ago

yes, go for it !