-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test against JDK 9 modules #425
Comments
Hi JUnit team, Is there a plan to add module-info to junit5 or even better to junit4? I have a problem using junit4 as unnamed module when testing jdk module, e.g. jaxb-api. It might need to be fixed in JDK though, thus just a question above. Thank you. |
Regarding JUnit 4, I am not aware of any intent to provide explicit JDK 9 support (even in the form of Regarding JUnit 5, we are not currently planning to include |
@avalez we don't want JUnit 4 to require JDK 9, so JUnit 4 will not have a |
Thank you for the information! |
UPDATE We cannot even test now with Gradle. 😢 Attempting to build JUnit 5 against JDK 9-ea+149 results in the following:
NOTE: this happens even if you add the following to
|
UPDATE: The following gets us one step closer.
But even with that, we now run into the following issue with Ruby regarding
It looks like we'll have to wait for Gradle to publish something that works with JDK 9, unless somebody else can provide further guidance in the interim. |
@sbrannen FWIW I managed to get my gradle working with more of a hack than anything haha Because Gradle launches these separate applications that use java, it wasn't enough just to add the arguments to
You may need more or less items depending on whats being compiled. After that I also added it to
Also dont forget to update
|
This issue originally got me past a sticking point thanks to @cal-pratt, so I thought I would share the new simpler workaround available for the latest Java 9 Jigsaw EA build. I added JAVA_OPTS is used by the gradle wrapper: export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --permit-illegal-access' gradle.properites:
See http://mail.openjdk.java.net/pipermail/jigsaw-dev/2017-March/011763.html |
@jamespedwards42 unfortunately seems the junit 5 build not/no longer be working under the latest JDK 9 preview:
I have been used the options you described with the additional |
@reinhapa Sorry, I haven't tried any of this on this project. But the previous solutions worked for my Gradle Java 9 project. And then this new flag was just announced yesterday. In order to use the
I think it will soon be added to the regular EA builds as well (https://jdk9.java.net/download/) |
@jamespedwards42 hmm, just tried it successfully thanks for the tip. |
Thanks for sharing your experiences and tips, everybody! I've also had a look at the Big Kill Switch for disabling strong encapsulation on Java 9, and we'll be investigating further during the M5 time frame. |
#775 is dedicated to get JUnit 5 compile and run on Java 9 "classpath style". |
We'll need to keep an eye on JigSaw as apparently there is not yet a consensus in the expert group. IBM, RedHat and others will vote "no" in the ballot to release the public review. In the past, we've seen major proposals dropped when they failed to meet Java release dead-lines so the question may well be whether Java 9 has module support or not. |
Added Related Pull Requests section to the initial issue description. |
This commit includes the service providing interface `ModuleClassFinder` in package `org.junit.platform.commons.util`. Its default implementation will rely on Java 9 features introduced by the Java Platform Module System. The usage of the new module selection options on Java 8 will result in no-op as there is no module system in place. Summary of changes: * Add ModuleSelector to the Platform discovery package. * Add ModuleSelector to the Jupiter discovery package. * Add ModuleSelector to the Vintage discovery package. * Add ModuleUtils to the platform commons utilities toolbox. * Add option `--select-module` to the console launcher. * Add option `--scan-module-path` to the console launcher. Addresses #425
This commit includes the service providing interface `ModuleClassFinder` in package `org.junit.platform.commons.util`. Its default implementation will rely on Java 9 features introduced by the Java Platform Module System. The usage of the new module selection options on Java 8 will result in no-op as there is no module system in place. Summary of changes: * Add ModuleSelector to the Platform discovery package. * Add ModuleSelector to the Jupiter discovery package. * Add ModuleSelector to the Vintage discovery package. * Add ModuleUtils to the platform commons utilities toolbox. * Add option `--select-module` to the console launcher. * Add option `--scan-module-path` to the console launcher. Addresses #425
This commit includes the service providing interface `ModuleClassFinder` in package `org.junit.platform.commons.util`. Its default implementation will rely on Java 9 features introduced by the Java Platform Module System. The usage of the new module selection options on Java 8 will result in no-op as there is no module system in place. Summary of changes: * Add ModuleSelector to the Platform discovery package. * Add ModuleSelector to the Jupiter discovery package. * Add ModuleSelector to the Vintage discovery package. * Add ModuleUtils to the platform commons utilities toolbox. * Add option `--select-module` to the console launcher. * Add option `--scan-module-path` to the console launcher. Addresses #425
This commit includes the service providing interface `ModuleClassFinder` in package `org.junit.platform.commons.util`. Its default implementation will rely on Java 9 features introduced by the Java Platform Module System. The usage of the new module selection options on Java 8 will result in no-op as there is no module system in place. Summary of changes: * Add ModuleSelector to the Platform discovery package. * Add ModuleSelector to the Jupiter discovery package. * Add ModuleSelector to the Vintage discovery package. * Add ModuleUtils to the platform commons utilities toolbox. * Add option `--select-module` to the console launcher. * Add option `--scan-module-path` to the console launcher. Addresses #425
This commit includes the service providing interface `ModuleClassFinder` in package `org.junit.platform.commons.util`. Its default implementation will rely on Java 9 features introduced by the Java Platform Module System. The usage of the new module selection options on Java 8 will result in no-op as there is no module system in place. Summary of changes: * Add ModuleSelector to the Platform discovery package. * Add ModuleSelector to the Jupiter discovery package. * Add ModuleSelector to the Vintage discovery package. * Add ModuleUtils to the platform commons utilities toolbox. * Add option `--select-module` to the console launcher. * Add option `--scan-module-path` to the console launcher. Addresses #425
This commit includes the service providing interface `ModuleClassFinder` in package `org.junit.platform.commons.util`. Its default implementation will rely on Java 9 features introduced by the Java Platform Module System. The usage of the new module selection options on Java 8 will result in no-op as there is no module system in place. Summary of changes: * Add ModuleSelector to the Platform discovery package. * Add ModuleSelector to the Jupiter discovery package. * Add ModuleSelector to the Vintage discovery package. * Add ModuleUtils to the platform commons utilities toolbox. * Add option `--select-module` to the console launcher. * Add option `--scan-module-path` to the console launcher. Addresses #425
This commit includes the service providing interface `ModuleClassFinder` in package `org.junit.platform.commons.util`. Its default implementation will rely on Java 9 features introduced by the Java Platform Module System. The usage of the new module selection options on Java 8 will result in no-op as there is no module system in place. Summary of changes: * Add ModuleSelector to the Platform discovery package. * Add ModuleSelector to the Jupiter discovery package. * Add ModuleSelector to the Vintage discovery package. * Add ModuleUtils to the platform commons utilities toolbox. * Add option `--select-module` to the console launcher. * Add option `--scan-module-path` to the console launcher. Addresses #425
This commit contains the default ClassFinder implementation that scans Java 9 modules for testable classes. Therefore you need JDK 9 to compile this sub-project. Addresses #425
This commit includes the service providing interface `ModuleClassFinder` in package `org.junit.platform.commons.util`. Its default implementation will rely on Java 9 features introduced by the Java Platform Module System. The usage of the new module selection options on Java 8 will result in no-op as there is no module system in place. Summary of changes: * Add ModuleSelector to the Platform discovery package. * Add ModuleSelector to the Jupiter discovery package. * Add ModuleSelector to the Vintage discovery package. * Add ModuleUtils to the platform commons utilities toolbox. * Add option `--select-module` to the console launcher. * Add option `--scan-module-path` to the console launcher. Addresses #425
This commit includes the service providing interface `ModuleClassFinder` in package `org.junit.platform.commons.util`. Its default implementation will rely on Java 9 features introduced by the Java Platform Module System. The usage of the new module selection options on Java 8 will result in no-op as there is no module system in place. Summary of changes: * Add ModuleSelector to the Platform discovery package. * Add ModuleSelector to the Jupiter discovery package. * Add ModuleSelector to the Vintage discovery package. * Add ModuleUtils to the platform commons utilities toolbox. * Add option `--select-module` to the console launcher. * Add option `--scan-module-path` to the console launcher. Addresses #425
This commit contains the default ClassFinder implementation that scans Java 9 modules for testable classes. Therefore you need JDK 9 to compile this sub-project. Addresses #425
This commit includes the service providing interface `ModuleClassFinder` in package `org.junit.platform.commons.util`. Its default implementation will rely on Java 9 features introduced by the Java Platform Module System. The usage of the new module selection options on Java 8 will result in no-op as there is no module system in place. Summary of changes: * Add ModuleSelector to the Platform discovery package. * Add ModuleSelector to the Jupiter discovery package. * Add ModuleSelector to the Vintage discovery package. * Add ModuleUtils to the platform commons utilities toolbox. * Add option `--select-module` to the console launcher. * Add option `--scan-module-path` to the console launcher. Addresses #425
This commit contains the default ModuleClassFinder implementation that scans Java 9 modules for testable classes. Therefore you need JDK 9 to build this sub-project. Addresses #425
The sub project junit-platform-commons-java-9 and the sample project junit5-modular-world tackle most of the deliverables listed in the initial description. Thus, closing this issue. Please open new issues if you encounter problem testing JPMS modules. |
@sormuras, can you please check off the Deliverables you covered and mark the ones you didn't cover with an ❌ so that we know what the status quo is? |
reopened in order to address open deliverables |
All covered, all checked. |
Thanks! 👍 |
Status Quo
JUnit 5 currently builds and runs against JDK 9 early access builds (including Jigsaw builds), but we do not yet have any tests in place that run against user code built with module info.
Related Pull Requests
ModuleUtils
withClassFinder
SPIorg.junit.platform.commons.jpms
Related Issues
Further Resources
Deliverables
clazz.getPackage().getImplementationVersion()
and related methods for retrieving JAR versioning metadata for classes loaded from named modules.--patch-module module=file(;file)*
The text was updated successfully, but these errors were encountered: