scordio/jimfs-junit-jupiter

File system cannot be configured when `JimfsTempDirFactory` is used as default factory

Closed this issue · 2 comments

File system cannot be configured when `JimfsTempDirFactory` is used as default factory

A new property could be added:

jimfs.junit.jupiter.tempdir.configuration.default

which accepts one of the Configuration values (case-insensitive), like junit.jupiter.tempdir.cleanup.mode.default.

It is now possible to use the jimfs.junit.jupiter.tempdir.configuration.default configuration parameter, which sets the default Jimfs configuration to use and expects one of the following values (case-insensitive):

  • FOR_CURRENT_PLATFORM: appropriate to the current platform (default)
  • OS_X: for a Mac OS X-like file system
  • UNIX: for a UNIX-like file system
  • WINDOWS: for a Windows-like file system

For example, the following defines a Windows-like temporary directory regardless of the platform the test is running on:

jimfs.junit.jupiter.tempdir.configuration.default=windows

All Jimfs-based temporary directories will be configured accordingly unless @JimfsTempDir is used and its value attribute is set.