Skip to content

Commit 6e4e2e5

Browse files
xinglinXing Lin
authored andcommitted
HADOOP-18093. Better exception handling for testFileStatusOnMountLink() in ViewFsBaseTest.java (apache#3918). Contributed by Xing Lin.
Signed-off-by: Ayush Saxena <[email protected]> (cherry picked from commit 0d17b62)
1 parent b46ec61 commit 6e4e2e5

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
@@ -514,7 +514,7 @@ public void testListOnInternalDirsOfMountTable() throws IOException {
514514
Assert.assertTrue("A mount should appear as symlink", fs.isSymlink());
515515
}
516516

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

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

537532
@Test

0 commit comments

Comments
 (0)