Mit freundlichen Grüßen Mirko Friedenhagen —
Mit freundlichen Grüßen Mirko Friedenhagen — > Am 09.04.2026 um 23:54 schrieb Martin Desruisseaux via users > <[email protected]>: > > Hello Jochen > >> Le 09/04/2026 à 23:30, Jochen Wiedmann a écrit : >> My impression is, that unit tests in src/test/java, as executed by >> surefire, share a module with the code, that's being tested (in >> src/main/java). Which is good, in general, because it permits access >> to the implementation details, that are being tested. Is that correct, >> so far? > > Correct, in order to access package-private classes or members, the test code > need to be in the same package, which require that the test code is also in > the same module. For adding test code to a module, the `--patch-module` > option must be used both at compile time and at test runtime. > > >> However, there is another point: It seems important to me, that access >> from external modules to my own works as expected. I would like to >> ensure that by running some tests as a separate module. Is that a >> valid concern? Is that possible, and how? > > It is not possible to access package-private classes or members from another > module, except by using the `--patch-module` option. But that option should > be used only for testing purposes or as temporary patches, not in production. Hi Martin, I understood Jochen wanted to test whether the module separation does work. Do you know whether failsafe could be used for this? Mit freundlichen Grüßen Mirko Friedenhagen --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
