[jdk8u-dev] RFR: 8305329: [8u] Unify test libraries into single test library - step 1 [v3]

Zdenek Zambersky zzambers at openjdk.org
Mon Nov 6 15:55:30 UTC 2023


On Mon, 6 Nov 2023 15:42:11 GMT, Zdenek Zambersky <zzambers at openjdk.org> wrote:

>> I would like to start effort to unify test libraries in openjdk 8 into one unified library. This is first step of that effort, which moves newest copy of jdk test library (added with jfr backport) from `jdk/test/lib` to `test/lib`. For more details please continue reading. 
>> 
>> **Problem:**
>> Test libraries in jdk8 are a bit messy.
>> There are currently 3 different test libraries:
>> - hotspot testlibrary - placed in [hotspot/test/testlibrary](https://github.com/openjdk/jdk8u-dev/tree/89aeae16e85ddfbd581cb86d0b0480b1e2d50e99/hotspot/test/testlibrary), (pkgs `com.oracle.java.testlibrary`, `sun.hotspot...` ), includes testlibrary tests in [hotspot/test/testlibrary_tests](https://github.com/openjdk/jdk8u-dev/tree/89aeae16e85ddfbd581cb86d0b0480b1e2d50e99/hotspot/test/testlibrary_tests)
>> - jdk testlibrary (old) - placed in [jdk/test/lib/testlibrary](https://github.com/openjdk/jdk8u-dev/tree/master/jdk/test/lib/testlibrary), (pkgs `jdk.testlibrary`, `com.oracle.testlibrary.jsr292`)
>> - jdk test lib - placed directly in [jdk/test/lib](https://github.com/openjdk/jdk8u-dev/tree/master/jdk/test/lib), was added with [jfr backport](https://github.com/openjdk/jdk8u-dev/commit/df7e09043392d5952d522a28702c6e5ec3e8492e), (pkgs `jdk.test.lib` `sun.hotspot...`)
>> 
>> Many test library classes exist in multiple different copies (using different pkgs). Few examples:
>> - Platform.java - 3 copies ([hs](https://github.com/openjdk/jdk8u-dev/blob/89aeae16e85ddfbd581cb86d0b0480b1e2d50e99/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java), [jdk (old)](https://github.com/openjdk/jdk8u-dev/blob/master/jdk/test/lib/testlibrary/jdk/testlibrary/Platform.java), [jdk (jfr)](https://github.com/openjdk/jdk8u-dev/blob/master/jdk/test/lib/jdk/test/lib/Platform.java))
>> - OutputAnalyzer.java - 3 copies ([hs](https://github.com/openjdk/jdk8u-dev/blob/89aeae16e85ddfbd581cb86d0b0480b1e2d50e99/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java), [jdk (old)](https://github.com/openjdk/jdk8u-dev/blob/master/jdk/test/lib/testlibrary/jdk/testlibrary/OutputAnalyzer.java), [jdk (jfr)](https://github.com/openjdk/jdk8u-dev/blob/master/jdk/test/lib/jdk/test/lib/process/OutputAnalyzer.java))
>> - WhiteBox.java - 2 copies ([hotspot](https://github.com/openjdk/jdk8u-dev/blob/89aeae16e85ddfbd581cb86d0b0480b1e2d50e99/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java), [jdk (jfr)](https://github.com/openjdk/jdk8u-dev/blob/master/jdk/test/lib/sun/hotspot/WhiteBox.j...
>
> Zdenek Zambersky has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
> 
>  - Fixed library tag of additional tests after rebase
>  - Removed lib classes, which do not compile on JDK8
>  - Moved test lib

I have rebased changes on current master to fix conflict as shown by GH. (Bot does not like rebasing, but I find it less evil and more readable, than merging in master.)

Rebase using `git rebase master` worked out of box, no manual interaction was needed. I verified that renamed [NetworkConfiguration.java](https://github.com/zzambers/jdk8u-dev/blob/jtreg-lib/test/lib/jdk/test/lib/NetworkConfiguration.java) contains changes by [JDK-8207404 backport](https://github.com/openjdk/jdk8u-dev/pull/347). There is only small change on top fixing `@library` tag in affected tests. I have found no other issues.

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

PR Comment: https://git.openjdk.org/jdk8u-dev/pull/294#issuecomment-1795197636


More information about the jdk8u-dev mailing list