[
https://issues.apache.org/jira/browse/SUREFIRE-1557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16590728#comment-16590728
]
Christian Stein commented on SUREFIRE-1557:
-------------------------------------------
> If one deletes all {{module-info.java}} files, the build succeeds.
This is the expected and supported behaviour. Therefore, I changed the issue
type from "Bug" to "Improvement".
Declaring a module descriptor within your test sources _opens_ a total new box
of possible test setup configurations. At the moment, there are only two
_tools_ that support test module descriptors that I know of:
* *java + junit-platform-console* -
[https://github.com/junit-team/junit5-samples/tree/master/junit5-modular-world]
- especially the _test-patch-...jsh_ scripts are interesting
* *pro* - [https://github.com/forax/pro]
You may use the "java + junit-platform-console" tool way with every other build
tool out there. See this Gradle task, for example:
[https://github.com/junit-team/junit5/blob/548de1f589b2609b14e8af05e1a356d3a7aa6099/junit-platform-commons-java-9/junit-platform-commons-java-9.gradle#L45-L59]
At the moment, I'm rolling out a dedicated JUnit Platform Maven Plugin that
wraps the "java + junit-platform-console" solution. Hoping to learn how make it
work first, and the transfer the knowledge to the Surefire JUnit Platform
Provider. Feel free and invited to beta-test that plugin:
[https://github.com/sormuras/junit-platform-maven-plugin]
> Test modular build on Java 10
> -----------------------------
>
> Key: SUREFIRE-1557
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1557
> Project: Maven Surefire
> Issue Type: Improvement
> Affects Versions: 2.22.0
> Reporter: Tor Egil Jacobsen
> Priority: Major
>
> A modular build on GitHub,
> [jactor-rises|https://github.com/jactor-rises/jactor-rises/tree/feature/junit.jupiter_configuration],
> fails when running with surefire 2.22.0
> All tests run perfectly fine in my IntelliJ idea. When building with maven,
> all surefire reports fails with an {{InaccessableObjectException}} with
> message similar to this one: {{java.lang.reflect.InaccessibleObjectException:
> Unable to make com.github.jactor.rises.commons.dto.UserDtoTest() accessible:
> module jactor.rises.commons does not "opens
> com.github.jactor.rises.commons.dto" to unnamed module @3fc2959f}}
> If one deletes all {{module-info.java}} files, the build succeeds. I thought
> that during unit testing, the module should be opened by the surefire plugin.
> It beats the purpose of having modular jar-files if we need to open the
> module in order to test it...
> Based on the issue created for the junit-team: [junit5-jupiter-starter-maven
> out of date?|https://github.com/junit-team/junit5-samples/issues/81]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)