RFR: 8295738: Automate javax/swing/JFileChooser/FileSizeCheck.java [v2]

Alexey Ivanov aivanov at openjdk.org
Fri Oct 21 15:41:40 UTC 2022


On Thu, 20 Oct 2022 23:36:40 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Alexey Ivanov has updated the pull request incrementally with four additional commits since the last revision:
>> 
>>  - Set the locale to US
>>  - Adjust wrapping for error message
>>  - Use local variable to store first error message
>>  - Shorter error message
>
> test/jdk/javax/swing/JFileChooser/FileSizeCheck.java line 128:
> 
>> 126:     private static void createUI() {
>> 127:         // Create temp files
>> 128:         Path dir = Paths.get(".");
> 
> It is better to create a testFolder, and then open the chooser in it, otherwise other files in the current folder may break it(if the test executed standalone)

In my opinion, the current directory is a good enough option. When run in jtreg, it is set to `scratch` which is empty when the test starts; when run manually as a standalone app, the chances you have other files named `000-0000000000` in the current directory are quite low. The test does not depend on the first file being displayed in the first row of the table, it looks for it; yet it depends on all the files being displayed in the sequence without alternating with other files.

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

PR: https://git.openjdk.org/jdk/pull/10802



More information about the client-libs-dev mailing list