LocalFileSystem extends ChecksumFileSystem { public File pathToFile(Path path) { return ((RawLocalFileSystem)fs).pathToFile(path); } LocalFileSystem();  LocalFileSystem(FileSystem rawLocalFileSystem); @Override void initialize(URI name, Configuration conf); @Override String getScheme(); FileSystem getRaw(); File pathToFile(Path path); @Override void copyFromLocalFile(boolean delSrc, Path src, Path dst); @Override void copyToLocalFile(boolean delSrc, Path src, Path dst); @Override boolean reportChecksumFailure(Path p, FSDataInputStream in,
                                       long inPos,
                                       FSDataInputStream sums, long sumsPos); @Override boolean supportsSymlinks(); @Override void createSymlink(Path target, Path link, boolean createParent); @Override FileStatus getFileLinkStatus(final Path f); @Override Path getLinkTarget(Path f);  }
@Test public void testFileStatusPipeFile() throws Exception { RawLocalFileSystem origFs = new RawLocalFileSystem(); RawLocalFileSystem fs = spy(origFs); Configuration conf = mock(Configuration.class); fs.setConf(conf); Whitebox.setInternalState(fs, "useDeprecatedFileStatus", false); Path path = new Path("/foo"); File pipe = mock(File.class); when(pipe.isFile()).thenReturn(false); when(pipe.isDirectory()).thenReturn(false); when(pipe.exists()).thenReturn(true); FileStatus stat = mock(FileStatus.class); doReturn(pipe).when(fs).pathToFile(path); doReturn(stat).when(fs).getFileStatus(path); FileStatus[] stats = fs.listStatus(path); assertTrue(stats != null && stats.length == 1 && stats[0] == stat); }