RFR: 8263536: Add missing @compile tags to jpackage tests [v2]

Ioi Lam iklam at openjdk.java.net
Mon Mar 15 19:58:09 UTC 2021


On Mon, 15 Mar 2021 19:41:06 GMT, Alexey Semenyuk <asemenyuk at openjdk.org> wrote:

>> test/jdk/tools/jpackage/windows/WinDirChooserTest.java line 44:
>> 
>>> 42:  * @requires (os.family == "windows")
>>> 43:  * @modules jdk.jpackage/jdk.jpackage.internal
>>> 44:  * @compile WinDirChooserTest.java
>> 
>> Changes like this one is not necessary. `@run` will build WinDirChooserTest automatically.
>> 
>> `@compile` should be added only when necessary, like WinInstallerUiTest.java
>
> It is better to have `@compile` everywhere for consistency. 
> 
> The proper way to run tests is by passing test class name as an argument for test runner, test class should not have `main()` and should have `@Test` annotation for test methods. Some tests have not been updated to follow this design and adding `@compile` to them doesn't make a difference now. But eventually they will be updated and they will need `@compile` anyways.

If this is the plan please update the bug description to reflect this. Otherwise it's not clear why this is done. The `@compile` in those files aren't really "missing" since they are not required. I would suggest changing the bug title to "Add @compile tags to jpackage tests"

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

PR: https://git.openjdk.java.net/jdk/pull/2975


More information about the core-libs-dev mailing list