JDK-8139430 : Refactor test library to decrease module dependencies of tests
  • Type: Bug
  • Component: core-libs
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-10-12
  • Updated: 2025-10-08
  • Resolved: 2015-11-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u481Fixed 9 b96Fixed
Related Reports
Relates :  
Relates :  
Description
Some tests in jdk/test build the whole library like this:
@build jdk.testlibrary.*
thus inheriting module dependencies of all classes within the library.

One particular example is these tests:
test/java/io/InputStream/ReadAllBytes.java
test/java/io/InputStream/ReadNBytes.java
which inherit dependencies on java.management module through jdk.testlibrary.InputArguments class

Another example is this: 
jdk.testlibrary.ProcessTools.getProcessId() depends on java.management.
jdk.testlibrary.Utils.tryFindJvmPid(String) depends ProcessTools
jdk.testlibrary.OutputAnalyzer.asLines(String) depends on Utils
This makes all tests depending on OutputAnalyzer to depend on java.management.
Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/25b577ea72d5 User: lana Date: 2015-12-10 00:27:01 +0000
10-12-2015

URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/25b577ea72d5 User: mchung Date: 2015-11-23 20:37:00 +0000
23-11-2015

This is a good example one why you don't want to put too many different classes providing different functionality in one library.
12-10-2015