On Sun, 26 Jun 2022 13:33:40 GMT, Lance Andersen <lan...@openjdk.org> wrote:
> I thought about using TestProvider and then talked myself out of it. So yes, > I can do that. If you have a preferred name other than > `TestOverRideFSPMethods` please let me know The only change that should be needed to TestProvider is to implement the checkAccess method with: Path delegate = theFileSystem.unwrap(file); defaultProvider.checkAccess(delegate, modes); With that change it should be easy to extend and override exists/readAttributesIfExists to record that they are called. The need to run with the test with -Djava.nio.file.spi.DefaultFileSystemProvider=TestProvider goes away too and and should be much simpler to test that the expected delegation. ------------- PR: https://git.openjdk.org/jdk/pull/9249