On Tue, 7 Jun 2022 12:19:29 GMT, Magnus Ihse Bursie <i...@openjdk.org> wrote:

> I have failed to reproduce the working conditions that makes a file actually 
> unreadable for the owner on Windows, neither on my GHA test repo, nor 
> locally. 

I had quick look at the CI setup we have access to. It appears that this test 
passes there successfully on Windows. Could it be something to do with Windows 
version being used?

test/jdk/java/util/ResourceBundle/Control/MissingResourceCauseTest.java line 48:

> 46:     private static void callGetBundle(String baseName, Locale locale,
> 47:                                       Class<? extends Throwable> 
> expectedCause) {
> 48:         if (baseName.equals("UnreadableRB") && 
> System.getProperty("os.name").startsWith("Windows")) {

Hello @magicus, perhaps we could do this check in the `main` of this class 
(line 37) before calling the `callGetBundle` for the `UnreadableRB` base name? 
That way this method doesn't have to bother about which `baseName` is being 
passed.

I had a quick look at how other tests do the OS name checks and they use the 
`Platform.isWindows()` API which is part of the test library. I suspect you may 
not be able to use it here though since this `MissingResourceCauseTest` class 
gets launched manually through the `MissingResourceCauseTestRun`. So using 
`System.getProperty` I think is fine. Nit - perhaps we could match this check 
to do whatever `Platform.isWindows()` is doing (which seems to be checking that 
the os name starts with `win`, ignoring the case).

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

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

Reply via email to