[jdk8u-dev] RFR: 8327993: [8u] Unify test libraries into single test library - step 2

Zdenek Zambersky zzambers at openjdk.org
Wed Mar 13 15:18:25 UTC 2024


On Tue, 12 Mar 2024 15:25:32 GMT, Zdenek Zambersky <zzambers at openjdk.org> wrote:

> This is second step in the effort to unify duplicate test libraries in jdk8 into single shared test library (as in newer jdks). Motivation is to remove code duplication and make backporting simpler. It only affects tests. More details in [step 1](https://github.com/openjdk/jdk8u-dev/pull/294).
> 
> This changeset eliminates duplicate test lib in hotspot ( `hotspot/test/testlibrary` ) by unifying it with shared test library ( `test/lib` ). Hotspot tests have been updated to use (unified) shared test library.
> 
> 
> **DETAILS:**
> Unification of test libraries was done on per file basis, comparing (diff) classes from both libraries and deciding on approach used. (Generally, files in shared test lib (originally coming from jfr backport) are more updated. However there were some compatibility problems with jdk8 in some places.)
> 
> - Legend:
>   - kept - kept existing file in shared test library as is
>   - same - files in both libraries (hotspot, shared) are effectively same (copyright/package differences etc.) 
>   - superset - file in shared test library is superset (in terms of API) of hotspot one
> 
> - testlib **packageless** (test/lib)
>   - **`ClassFileInstaller.java`** - kept (same)
>   - **`RedefineClassHelper.java`**  - used updated one from hs test lib (was missing in shared lib)
> 
> - testlib **general** (test/lib/jdk/test/lib)
>   - **`Asserts.java`**  - kept (superset)
>   - **`BuildHelper.java`**  - kept (same)
>   - **`ByteCodeLoader.java`**  - kept (superset)
>   - **`JDKToolFinder.java`**  - kept (same)
>   - **`JDKToolLauncher.java`**  - kept, with reverted [changes from JDK-8178415](https://github.com/openjdk/jdk11u-dev/commit/05d6891929153c34d101c05a7e04185ebbd05849) to match one from hs test lib (otherwise no real differences)
>   - **`Platform.java`** - kept shared version (superset), with some fixes. Updated debug build detection code as jdk8 does not have  `jdk.debug` system property. Removed `areCustomLoadersSupportedForCDS` as this is only useful for appcds tests (not in jdk8)
>   - **`Utils.java`**  - kept, added missing `getUnsafe()` method, required by hotspot tests
> 
> - testlib **cli** (test/lib/jdk/test/lib/cli)
>   - only used by hotspot tests, classes in shared test lib were unused so far
>   - used updated files from hotspot test lib, as shared version contained [incompatible changes from JDK-8054892](https://github.com/zzambers/jdk11u-dev/commit/29f7c15af9c8b8199765186c188e9a280f559766) (not backported to jdk8) and did not work with hotspot tests
> 
> - testlib **compiler**  (t...

Aditional testing:
jdk_jfr: [OK](https://github.com/zzambers/jdk-tester/actions/runs/8263995480/job/22606616559)
jdk_core: [OK](https://github.com/zzambers/jdk-tester/actions/runs/8264016483/job/22610644189) (no regressions to [master](https://github.com/zzambers/jdk-tester/actions/runs/8264248125/job/22607448750); AKISerialNumber.java was [fixed](https://github.com/openjdk/jdk8u-dev/pull/436) in meantime)

-------------

PR Comment: https://git.openjdk.org/jdk8u-dev/pull/467#issuecomment-1994638222


More information about the jdk8u-dev mailing list