Hi Alan:

I tried @compile/module to fix this issue before, but it does not work ,Use CertStatusReqExtensionTests.java as example, the process as below: 1. Create java.base/sun/security/ssl folder in test/sun/security/ssl/StatusStapling. 2. Move the dependency class like TestCase.java TestUtils.java BogusStatusRequest.java into test/sun/security/ssl/StatusStapling/java.base/sun/security/ssl 3. Move CertStatusReqExtensionTests.java into test/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/ , as it's in package sun.security.ssl and access non-public class.
4. Add @compile/module  in CertStatusReqExtensionTests.java as below:
###########################################
@test
@bug 8046321
@compile/module=java.base sun/security/ssl/TestCase.java
@compile/module=java.base sun/security/ssl/TestUtils.java
@compile/module=java.base sun/security/ssl/BogusStatusRequest.java
@compile/module=java.base sun/security/ssl/CertStatusReqExtensionTests.java
@run main/othervm CertStatusReqExtensionTests
#############################################

Bug got this error message:
execStatus=Error. Parse Exceptioin\: Can't find source file\: sun/security/ssl/TestCase.java

Build and run CertStatusReqExtensionTest.java by a wrapper could work , and I saw some existing tests were written in this way.So I think this is a valid solution.Thanks.

Regards
Tim
On 2/16/2016 3:47 PM, Alan Bateman wrote:
On 16/02/2016 03:31, Tim Du wrote:
Hi All:

Please help to review the fix for Jigsaw test bug.Thanks.

Bug: https://bugs.openjdk.java.net/browse/JDK-8134487
Webrev: http://cr.openjdk.java.net/~tidu/8134487/webrev.01/

The test to access non-public class.To workaround the issue , I create the test wrapper to compile test class into the named module with -Xmodule ,-Xpath options and then execute the test with -Xpath ,-m options.
It's not clear to me why these tests need wrappers. I see in the bug that you've tried @compile/module=java.base but you run into problems running the tests. Can you say more about this?

-Alan

Reply via email to