RFR: 8159523. Fix tests depending on absence of -limitmods in VM arguments.
Alan Bateman
Alan.Bateman at oracle.com
Tue Nov 1 10:23:17 UTC 2016
On 31/10/2016 21:39, Alexandre (Shura) Iline wrote:
> :
> Which syntax would be better?
>
> 1. Requiring explicit ALL-UNNAMED
> .addExports("java.base", “jdk.internal.misc”, ALL_UNNAMED)
> .addExports("java.base", "jdk.internal.reflect”, ALL_UNNAMED)
> 2. Treating ALL-UNNAMED as a default
> .addExports("java.base", “jdk.internal.misc”)
> .addExports("java.base", "jdk.internal.reflect”)
>
> Same for addReads(…) and, I assume, addOpens(…).
>
> With any of the two, I am in favor of removing addExports(String), addReads(String) and addOpens(String) methods. If a complete string parameter needs to be passed (such as for negative tests), it could be passed through the vmOptions(String …) method.
>
> What do you think?
>
All very subjective and I'm sure others will have different opinions.
For these three options then the value has two parts, `--add-reads
<source-module>=<target-module>` for example, and the simplest is to
just provide a method that takes two parameters, e.g.
:
.addReads("m1, "m2")
.addExports("java.base", "jdk.internal.misc=ALL-UNNAMED")
.addOpens("java.base", "jdk.internal.misc=m1,m2")
.build();
The resulting tests should be very readable. Also it has the benefit
that we can send bad values, important for many of these tests because
they are probing behavior with bad modules, packages, ...
For addModules then `String module, String... rest` should work nicely:
.addModules("java.corba")
.addModules("java.naming", "java.xml.bind")
.addModules("jdk.attach,jdk.jdi")
-Alan
More information about the jigsaw-dev
mailing list