|
@@ -249,6 +249,7 @@ public class TestLocalFileSystem {
|
|
|
assertEquals(1, fileSchemeCount);
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
public void testHasFileDescriptor() throws IOException {
|
|
|
Configuration conf = new Configuration();
|
|
|
LocalFileSystem fs = FileSystem.getLocal(conf);
|
|
@@ -258,4 +259,17 @@ public class TestLocalFileSystem {
|
|
|
new RawLocalFileSystem().new LocalFSFileInputStream(path), 1024);
|
|
|
assertNotNull(bis.getFileDescriptor());
|
|
|
}
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testListStatusWithColons() throws IOException {
|
|
|
+ Configuration conf = new Configuration();
|
|
|
+ LocalFileSystem fs = FileSystem.getLocal(conf);
|
|
|
+ File colonFile = new File(TEST_ROOT_DIR, "foo:bar");
|
|
|
+ colonFile.mkdirs();
|
|
|
+ colonFile.createNewFile();
|
|
|
+ FileStatus[] stats = fs.listStatus(new Path(TEST_ROOT_DIR));
|
|
|
+ assertEquals("Unexpected number of stats", 1, stats.length);
|
|
|
+ assertEquals("Bad path from stat", colonFile.getAbsolutePath(),
|
|
|
+ stats[0].getPath().toUri().getPath());
|
|
|
+ }
|
|
|
}
|