demery-pivotal opened a new pull request #6777:
URL: https://github.com/apache/geode/pull/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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]