Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7901619

jtreg needs to run whitebox TestNG tests with -XaddReads:$MODULE=ALL-UNNAMED

XMLWordPrintable

    • b02

      TestNG tests that are in the same package as the API they are testing need to run with -XaddReads:$MODULE=ALL-UNNAMED, otherwise they will get an IllegalAccessError. Here's an example with jdk/test/java/util/regex/PatternStreamTest.java:

      Execution faile[...]sError: superclass access check failed: class java.util.stream.LoggingTestCase (in module java.base) cannot access class org.testng.Assert (in unnamed module @0x78134723) because module java.base does not read unnamed module @0x78134723

      The reason that we aren't seeing this in our test runs is because the java.base module is currently "loose", meaning it reads all unnamed modules (see JDK-8146369). We will fix the java.base module issue once this jtreg issue is fixed. We don't have tests in other areas that run into it.

            jjg Jonathan Gibbons
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: