Hi, Max.

Excerpt from JTReg documentation:
=========================================================================================================
@modules <module>[/<package>]+
Express a dependence on a modules in the system being tested, and optionally, 
on selected internal packages in some or all of those modules.

If no dependencies are specified explicitly, a default set of dependencies will 
be read from the modules entry in test suite configuration files.

A test will not be run if the system being tested does not contain all of the 
specified modules.

Note: Specifying an entry that includes a dependence on an internal package is 
essentially equivalent to using -XaddExports:<module>/<package>ALL-UNNAMED when 
the test is compiled and run.
=========================================================================================================


Before the suggested fix, the test in question would fail on a system with no 
jdk.crypto.pkcs11. That could be emulated by:
$ jtreg ... -javaoptions:"-limitmods jdk.jartool" 
jdk/security/jarsigner/Spec.java
...
FAILED: jdk/security/jarsigner/Spec.java
...
$ jtreg ... -javaoptions:"-limitmods jdk.jartool,jdk.crypto.pkcs11" 
jdk/security/jarsigner/Spec.java
...
Passed: jdk/security/jarsigner/Spec.java
...
$ 

With my fix, the test will not be selected for execution when there is no 
jdk.crypto.pkcs11:
$ jtreg ... -javaoptions:"-limitmods jdk.jartool" 
jdk/security/jarsigner/Spec.java
...
Test results: no tests selected
…
$

Shura



> On Aug 16, 2016, at 5:30 PM, Weijun Wang <weijun.w...@oracle.com> wrote:
> 
> Hi Shura
> 
> I am looking at test/jdk/security/jarsigner/Spec.java.
> 
> IMHO, even on a Solaris, without the SunPKCS11 provider at runtime, this test 
> should be able to find Signature and MessageDigest implementations from the 
> SunRsaSign and SUN provider.
> 
> Is the new @modules dependency necessary? In fact, I am curious how you note 
> this test. Does it fail with some special settings?
> 
> Thanks
> Max
> 
> On 8/17/2016 1:17, Alexandre (Shura) Iline wrote:
>> Hi.
>> 
>> Please review fixes related to module dependencies in a few jdk tests:
>> http://cr.openjdk.java.net/~shurailine/8163126/webrev.00/index.html
>> 
>> The review contains a few cases where jdk.zipfs is added to the module list. 
>> This is happening because all TestNG tests which use compiler API require 
>> jdk.zipfs to be able to read the testng jar. This is unfortunate but there 
>> is no easy way around that.
>> 
>> Shura
>> 
>> 
>> 

Reply via email to