Details
-
Test
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1-win, 2.1.0-beta, 1.3.0, 3.0.0-alpha1
-
Windows
-
Reviewed
Description
TestFSMainOperationsLocalFileSystem extends Class FSMainOperationsBaseTest. PathFilter FSMainOperationsBaseTest#TEST_X_FILTER checks if a path has "x" and "X" in its name.
final private static PathFilter TEST_X_FILTER = new PathFilter() { public boolean accept(Path file) { if(file.getName().contains("x") || file.toString().contains("X")) return true; else return false;
Some of the test cases construct a path by combining path "TEST_ROOT_DIR" with a customized partial path.
The problem is that "TEST_ROOT_DIR" may also has "X" in its name. The path check will pass even if the customized partial path doesn't have "X". However, for this case the path filter is supposed to reject this path.
An easy fix is to change "file.toString().contains("X")" to "file.getName().contains("X")". Note that org.apache.hadoop.fs.Path.getName() only returns the final component of this path.
Attachments
Attachments
Issue Links
- is part of
-
HADOOP-8645 Stabilize branch-1-win
- Resolved
- relates to
-
HADOOP-8444 Fix the tests FSMainOperationsBaseTest.java and F ileContextMainOperationsBaseTest.java to avoid potential test failure
- Closed