[
https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147438#comment-17147438
]
Christian Stein commented on SUREFIRE-1811:
-------------------------------------------
Pavel - here are the two that I know of:
#
[https://github.com/sormuras/junit-platform-maven-plugin#module-infotest-support]
Demo project: [https://github.com/micromata/sawdust] -
[modular-patch-runtime|https://github.com/micromata/sawdust/tree/master/modular-patch-runtime]
# [https://github.com/java9-modularity/gradle-modules-plugin#how-does-it-work]
Gili - if your main module refers to a test module, you need to publish your
test module as well. How should a user ever build a working module graph?
Ad option 1: Why should test libraries stay on the classpath? JUnit wants to
hide packages, too. Why the difference in syntax, compilation, runtime, etc ...
when running extra- vs in-module tests? Both use cases should feel similar to
the test authors.
Ad option 2: Not an option (for me). See above.
Ad option 3: This is not "Christian's approach" – that's what javac, javadoc,
java, and friends offer. Patch module was added for testing.
> [...] Your integration test should not reference implementation details. [...]
They don't. In-module tests are 90+% pristine unit tests, extra-modular tests
are my integration tests.
> Add resources to JPMS test module
> ---------------------------------
>
> Key: SUREFIRE-1811
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1811
> Project: Maven Surefire
> Issue Type: New Feature
> Components: Maven Failsafe Plugin
> Affects Versions: 3.0.0-M5
> Reporter: Pavel_K
> Priority: Major
>
> I am testing version 3.0.0-M5 with two module-info in one project - one main
> and one for test. My test project is here
> https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with
> resources. For example, I have src/main/resources/META-INF/persistence.xml
> file that is not copied to test module. Because of this it is not possible to
> find resource in test module and it is necessary to use something like this
> https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72
> .
> In target/test-classes/META-INF/jpms.args I see:
> {code:java}
> --patch-module
> my.project=/home/..../hibernate-h2-test4/src/main/java,
> /home/.../hibernate-h2-test4/target/generated-sources/annotations
> {code}
> As I understand test module will NOT contain resources from the module under
> test? I mean that test module will NOT contain
> /home/..../hibernate-h2-test4/src/main/resources?
> That's why I suggest to include src/main/resources in test module.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)