JDK-8211974 : move test/jdk/lib/testlibrary/java/util/jar/*.java to top-level library or a local library
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 12,15
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-10-10
  • Updated: 2024-10-17
  • Resolved: 2020-07-08
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 11 JDK 15 JDK 16
11.0.25-oracleFixed 15 b32Fixed 16Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
move following library classes to top level test lib folder:
. test/jdk/lib/testlibrary/java/util/jar/Compiler.java
. test/jdk/lib/testlibrary/java/util/jar/JarBuilder.java
. test/jdk/lib/testlibrary/java/util/jar/SimpleHttpServer.java

test/jdk/lib/testlibrary/java/util/jar/CreateMultiReleaseTestJars.java creates a very specific .jar files used by several core-libs tests, doesn't make much sense to put into the top-level testlibrary. 

Comments
URL: https://hg.openjdk.java.net/jdk/jdk15/rev/c5202ed40b86 User: iignatyev Date: 2020-07-08 20:54:26 +0000
08-07-2020

1) I'd prefer if we add packages to them 2) you don't need to use @compile, if the tests have proper @library (which is @library /test/lib), you can just say `@build jdk.test.lib.Compiler` and jtreg will take care of finding the right source code.
27-05-2020

thank you :) I have refactored the code, will post webrev ASAP. 1) you mentioned "with corresponding changes in package names " - both JarBuilder and Compiler do not have package declarations in their source code files so I have left them without the package names. Should I add package names or leave as is? 2) the new location for both files is in another test suite so in jtreg test definitions of dependent tests I used @compile tag with ~6 parent directories before the actual path ( e.g. @compile ../../../../../../../test/lib/jdk/test/lib/compiler/Compiler.java) 3) the Compiler class was package local (also seems to be used only by "open/test/jdk/lib/testlibrary/java/util/jar/CreateMultiReleaseTestJars.java") - so in order for the tests to pass I had to make it public (in front of class name and 2 methods with previously package protected access)
27-05-2020

you are very much welcome, Ivan. should you need any other assistance/background/insight/etc, please don't hesitate to reach out to me here or thru DM.
21-05-2020

Hi [~iignatyev], thank you for the prompt and elaborate answer I have a better understanding of the problem now.
21-05-2020

I'd also like to refer you to the comment[1] in JDK-8211289 where it's suggested to remove jdk.testlibrary.SimpleHttpServer, JarBuilder, and Compiler. [1] https://bugs.openjdk.java.net/browse/JDK-8211289?focusedCommentId=14213601&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14213601
21-05-2020

on a closer look, SimpleHttpServer (in its current state) also doesn't look to be generic enough to be "promoted" to top-level test library, so I'd advice for leaving it as-is in open/test/jdk/lib/testlibrary/java/util/jar.
21-05-2020

to sum up, I suggest moving open/test/jdk/lib/testlibrary/java/util/jar/Compiler.java to open/test/lib/jdk/test/lib/compiler/Compiler.java and open/test/jdk/lib/testlibrary/java/util/jar/JarBuilder.java to open/test/lib/jdk/test/lib/util/JarBuilder.java with corresponding changes in package names and the tests which use these classes.
20-05-2020

HI [~isipka], I suggest moving Compiler, JarBuilder, and SimpleHttpServer to proper packages in open/test/lib/, let's say jdk.test.lib.compiler for Compiler, jdk.test.lib.util for JarBuilder, and jdk.test.lib.mrjar for SimpleHttpServer, which gives open/test/lib/jdk/test/lib/compiler/Compiler.java open/test/lib/jdk/test/lib/util/JarBuilder.java open/test/lib/jdk/test/lib/mrjar/SimpleHttpServer.java as I said before, CreateMultiReleaseTestJars is highly coupled w/ mrjar tests, I think it's better to leave it in open/test/jdk/lib/testlibrary/java/util/jar.
20-05-2020

Hi [~iignatyev], please refute or confirm the following statement: " classes residing at these places: open/test/jdk/lib/testlibrary/java/util/jar/Compiler.java open/test/jdk/lib/testlibrary/java/util/jar/CreateMultiReleaseTestJars.java open/test/jdk/lib/testlibrary/java/util/jar/JarBuilder.java open/test/jdk/lib/testlibrary/java/util/jar/SimpleHttpServer.java should be moved like this: open/test/jdk/lib/mrjar/CreateMultiReleaseTestJars.java open/test/jdk/lib/Compiler.java open/test/jdk/lib/JarBuilder.java open/test/jdk/lib/SimpleHttpServer.java " If I got anything wrong please state exact paths from project root directory. Thank you :)
20-05-2020

yes, I meant 'open/test/jdk/lib/mrjar', sorry occasionally I still use paths from "pre-consolidated repo" world.
12-10-2018

I think you mean open/test/jdk/lib/mrjar, open/test/jdk/test/ does not exist.
12-10-2018

I'm totally fine w/ open/test/jdk/lib being retained.
12-10-2018

I suggest to move it to open/test/jdk/test/lib/mrjar.
12-10-2018

do you mean to leave it in open/test/jdk/lib/testlibrary/mrjar? that means open/test/jdk/lib/ will be retained?
12-10-2018

again, your webrev (http://cr.openjdk.java.net/~mli/8211974/webrev.00/) puts it to open/test/lib/jdk/test/lib/util/CreateMultiReleaseTestJars.java, which is in open/test/lib/ and not in open/test/jdk/lib/
12-10-2018

do you mean to put it to open/jdk/test/mrjar? to me, it's much topper than open/jdk/test/lib/util. or you mean something else?
12-10-2018

webrev says 'test/lib/jdk/test/lib/util/CreateMultiReleaseTestJars.java (was test/jdk/lib/testlibrary/java/util/jar/CreateMultiReleaseTestJars.java)'. since jdk/test/lib/util is in jdk/test/lib, anything in jdk/test/lib/util is in jdk/test/lib.
12-10-2018

[~iignatyev] it's put in jdk/test/lib/util, not the top level jdk/test/lib.
12-10-2018

[~mli], as it's stated in the bug description, due to the fact that CreateMultiReleaseTestJars does a very specific job, useful for a handful number of tests, I highly doubt it should be placed in the top level testlibrary.
11-10-2018

http://cr.openjdk.java.net/~mli/8211974/webrev.00/
11-10-2018