HADOOP-18093. Better exception handling for testFileStatusOnMountLink() in ViewFsBaseTest.java (#3918). Contributed by Xing Lin. (#3931)

Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
(cherry picked from commit 0d17b629ff)
This commit is contained in:
Xing Lin 2022-01-26 08:23:50 -08:00 committed by GitHub
parent 0f0ebf9439
commit 54de8eb956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 7 deletions

View File

@ -521,7 +521,7 @@ abstract public class ViewFsBaseTest {
Assert.assertTrue("A mount should appear as symlink", fs.isSymlink());
}
@Test
@Test(expected = FileNotFoundException.class)
public void testFileStatusOnMountLink() throws IOException {
Assert.assertTrue("Slash should appear as dir",
fcView.getFileStatus(new Path("/")).isDirectory());
@ -533,12 +533,7 @@ abstract public class ViewFsBaseTest {
checkFileStatus(fcView, "/internalDir/internalDir2/linkToDir3", fileType.isDir);
checkFileStatus(fcView, "/linkToAFile", fileType.isFile);
try {
fcView.getFileStatus(new Path("/danglingLink"));
Assert.fail("Excepted a not found exception here");
} catch ( FileNotFoundException e) {
// as excepted
}
fcView.getFileStatus(new Path("/danglingLink"));
}
@Test