On Fri, 20 Mar 2026 16:44:37 GMT, Brian Burkhalter <[email protected]> wrote:
>> On Windows, relax the success criterion of `ListRoots` to the values
>> returned by `File.listRoots` intersecting the values returned by
>> `FileSystem.getRootDirectories` instead of being equal.
>
> Brian Burkhalter has updated the pull request incrementally with one
> additional commit since the last revision:
>
> 8379535: Convert to JUnit
test/jdk/java/io/File/ListRoots.java line 62:
> 60: }
> 61:
> 62: File f = new File(System.getProperty("test.src", "."),
> "ListRoots.java");
At some point we might have to change this to not be dependent on test.src. It
could use a directory on test.classes or even user.dir.
test/jdk/java/io/File/ListRoots.java line 67:
> 65: .map(File::getPath)
> 66: .anyMatch(p -> cp.startsWith(p));
> 67: assertTrue(found, cp + " does not have a recognized root");
Should this be a test method rather than BeforeAll?
test/jdk/java/io/File/ListRoots.java line 74:
> 72: expectedStream =
> 73: StreamSupport.stream(fs.getRootDirectories().spliterator(),
> false)
> 74: .map(Path::toFile);
I think it's a bit too fragile to store a Stream in a static field as it won't
work if used by more than one test method. Shouldn't all this actualSet and
expectedStream move to a test method too.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30301#discussion_r2990564137
PR Review Comment: https://git.openjdk.org/jdk/pull/30301#discussion_r2990567336
PR Review Comment: https://git.openjdk.org/jdk/pull/30301#discussion_r2990578401