Skip to content

Commit e954c68

Browse files
xinglinXing Lin
authored andcommitted
HADOOP-18093. Better exception handling for testFileStatusOnMountLink() in ViewFsBaseTest.java (#3918). Contributed by Xing Lin.
Signed-off-by: Ayush Saxena <ayushsaxena@apache.org> (cherry picked from commit 0d17b62)
1 parent b567dcd commit e954c68

File tree

1 file changed

+2
-7
lines changed
  • hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs

1 file changed

+2
-7
lines changed

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFsBaseTest.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ public void testListOnInternalDirsOfMountTable() throws IOException {
515515
Assert.assertTrue("A mount should appear as symlink", fs.isSymlink());
516516
}
517517

518-
@Test
518+
@Test(expected = FileNotFoundException.class)
519519
public void testFileStatusOnMountLink() throws IOException {
520520
Assert.assertTrue("Slash should appear as dir",
521521
fcView.getFileStatus(new Path("/")).isDirectory());
@@ -527,12 +527,7 @@ public void testFileStatusOnMountLink() throws IOException {
527527
checkFileStatus(fcView, "/internalDir/internalDir2/linkToDir3", fileType.isDir);
528528
checkFileStatus(fcView, "/linkToAFile", fileType.isFile);
529529

530-
try {
531-
fcView.getFileStatus(new Path("/danglingLink"));
532-
Assert.fail("Excepted a not found exception here");
533-
} catch ( FileNotFoundException e) {
534-
// as excepted
535-
}
530+
fcView.getFileStatus(new Path("/danglingLink"));
536531
}
537532

538533
@Test

0 commit comments

Comments
 (0)