Skip to content

Commit 0d17b62

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

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

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

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

545540
@Test

0 commit comments

Comments
 (0)