Skip to content

Commit 54de8eb

Browse files
authored
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 0d17b62)
1 parent 0f0ebf9 commit 54de8eb

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

524-
@Test
524+
@Test(expected = FileNotFoundException.class)
525525
public void testFileStatusOnMountLink() throws IOException {
526526
Assert.assertTrue("Slash should appear as dir",
527527
fcView.getFileStatus(new Path("/")).isDirectory());
@@ -533,12 +533,7 @@ public void testFileStatusOnMountLink() throws IOException {
533533
checkFileStatus(fcView, "/internalDir/internalDir2/linkToDir3", fileType.isDir);
534534
checkFileStatus(fcView, "/linkToAFile", fileType.isFile);
535535

536-
try {
537-
fcView.getFileStatus(new Path("/danglingLink"));
538-
Assert.fail("Excepted a not found exception here");
539-
} catch ( FileNotFoundException e) {
540-
// as excepted
541-
}
536+
fcView.getFileStatus(new Path("/danglingLink"));
542537
}
543538

544539
@Test

0 commit comments

Comments
 (0)