modules and tests
forax at univ-mlv.fr
forax at univ-mlv.fr
Fri Nov 25 15:23:56 UTC 2016
----- Mail original -----
> De: "Alan Bateman" <Alan.Bateman at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>, "Sander Mak" <sander.mak at luminis.eu>
> Cc: "jigsaw-dev" <jigsaw-dev at openjdk.java.net>
> Envoyé: Jeudi 24 Novembre 2016 16:41:03
> Objet: Re: modules and tests
> On 24/11/2016 14:39, Remi Forax wrote:
>> :
>> to Alan:
>> currently you can not get your test framework as a service and you can not
>> declare your test as a provider for a test infrastructure like jenkins (i.e.
>> there is no --uses and --provides).
> Fair point, uses/provides can't currently be augmented via the
> command-line but this is only because it hasn't been needed.
maybe, (it's a rhetorical maybe), instead of sending all the directives of the module descriptor as command line arguments, a simpler solution is to use a module descriptor ...
>
>>
>> to Alan and Sander:
>> setting command line arguments or using a build tool to fiddle them for you is
>> exactly what we do not want here! We want fidelity between the compile time
>> configuration and the runtime configuration. Having to play with -Xpatch at
>> runtime is conceptually exactly like setting the classpath. I don't want to
>> explain to the Java devs that we have fidelity between compile-time and runtime
>> on source code but not on test code.
>>
> I hope in time that there will be support from the tools, plugins, test
> runners ... so that regular developers don't need to be concerned with this.
Let me try to summarize this issue, because javac doesn't merge module descriptors, the recommended solution is to use some javac command line options and the corresponding java options.
These options were first introduced to ease the transition from the classpath world to modulepath world but you want to re-target them to make them part of the whole jigsaw experience.
For build tools like Maven or Gradle, they do not need to use these java options because they can merge the module descriptors because they control the compilation and the execution of the tests.
For other tools, because they only see part of the process, either the compilation or the execution of the tests, people will have to send the options by hands or as Jochen has suggested, for test runners, you can create a Layer and programmatically do what the options does but it change the environment and you still have to know the test configuration one way or the other.
Instead of waiting for tools to cope, i think it's far easier to change javac (one tool) to restore the semantics that exists before the introduction of jigsaw which is that you can have two folders one for the source and one for the test and it just works.
>
> -Alan
Rémi
More information about the jigsaw-dev
mailing list