JDK-8211358 : modularize test libraries
  • Type: Enhancement
  • Component: other-libs
  • Sub-Component: other
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • Submitted: 2018-10-01
  • Updated: 2023-08-30
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.
Other
tbdUnresolved
Related Reports
Blocks :  
Blocks :  
Blocks :  
Relates :  
Relates :  
Description
as different parts of the test libraries are different in their modules dependencies, it makes sense to divide the libraries into jigsaw modules, this will also make it easier and less error-prone to use and build test libraries.

the proposal suggests using classes' dependency as a guideline of this division and using the name of JDK module they depend in the test library module's name. i.e. the majority of the test library which depends only on public API of  'java.base' will be placed in 'test.base' module; classes which depend on 'java.compiler' -- 'test.compiler', etc.

it's important to mention, as this is necessary for a certain group of tests, e.g. ones which are strict on the list of available modules, that modularization of the test libraries won't prohibit their usage as regular test library, it will still be possible to use them as a regular source-path extension as before.
Comments
modularization of whitebox library will be easier if we first remove usage of sun.hotspot.WhiteBox (JDK-8271707) and remove it completely (JDK-8275662)
20-10-2021

hotspot test libraries have been already split into three independent libraries, and now just need to "converted" into jigsaw modules, and renamed to follow the same naming scheme, so /test/hotspot/jtreg/testlibrary/ctw will be moved to /test/hotspot/jtreg/testlibrary/test.hotspot.ctw and become test.hotspot.ctw named module.
02-10-2018

basing on the data gather by jdeps and how the classes are used, the following test modules are suggested: - test.compile which requires java.compiler and consists of jdk.test.lib.compiler - test.management: requires jdk.management, consists of jdk.test.lib.management - test.dcmd: requiers java.management, constists of jdk.test.lib.dcmd - test.jfr: requiers jdk.jfr, consists of jdk.test.lib.jfr - test.containers: constists of jdk.test.lib.containers.cgroup and has to be built w/ special flags - test.whitebox: constists of sun.hotspot packages, requiers java.management and has to be copiled by tests - test.base: consists of the rest test library classes, depends only on java.base some of these test.* modules also have dependencies on test.base. RedefineClassHelper uses internal package jdk.jartool/sun.tools.jar, instead of introducing an extra module just for this class, it seems to rewrite this class to use JarUtils from test library.
01-10-2018