Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GEODE-9526: Fix path computation in DiskStore test (#6777)
PROBLEM `DiskStoreCommandsDUnitTest.verifyDiskStoreInServer(...)` incorrectly assumes thatif a file path does not start with a file separator, it must be relative. It attempts to convert such a path to absolute by prepending the current directory onto it: ``` String absoluteDiskDirectoryName = diskDirectoryName.startsWith(File.separator) ? diskDirectoryName : CURRENT_DIRECTORY + File.separator + diskDirectoryName; ``` On Windows, an absolute file path can begin with a letter, e.g. `C:\Users\geode\AppData\Local\Temp\junit783716437098694709\DISKSTORE`. The test incorrectly interprets a path like this as relative, and prepends the current directory onto it, producing an invalid path. It then uses this incorrect path in an assertion, causing the test to fail when it should pass. SOLUTION Use Java's `Path` implementation for the OS to compute the absolute form of the given file path.
- Loading branch information