HADOOP-18093. Better exception handling for testFileStatusOnMountLink() in ViewFsBaseTest.java (#3918). Contributed by Xing Lin. (#3929)
Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
(cherry picked from commit 0d17b629ff
)
This commit is contained in:
parent
ef1a2b478b
commit
d613776b64
@ -522,7 +522,7 @@ public void testListOnInternalDirsOfMountTable() throws IOException {
|
|||||||
Assert.assertTrue("A mount should appear as symlink", fs.isSymlink());
|
Assert.assertTrue("A mount should appear as symlink", fs.isSymlink());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = FileNotFoundException.class)
|
||||||
public void testFileStatusOnMountLink() throws IOException {
|
public void testFileStatusOnMountLink() throws IOException {
|
||||||
Assert.assertTrue("Slash should appear as dir",
|
Assert.assertTrue("Slash should appear as dir",
|
||||||
fcView.getFileStatus(new Path("/")).isDirectory());
|
fcView.getFileStatus(new Path("/")).isDirectory());
|
||||||
@ -534,12 +534,7 @@ public void testFileStatusOnMountLink() throws IOException {
|
|||||||
checkFileStatus(fcView, "/internalDir/internalDir2/linkToDir3", fileType.isDir);
|
checkFileStatus(fcView, "/internalDir/internalDir2/linkToDir3", fileType.isDir);
|
||||||
checkFileStatus(fcView, "/linkToAFile", fileType.isFile);
|
checkFileStatus(fcView, "/linkToAFile", fileType.isFile);
|
||||||
|
|
||||||
try {
|
|
||||||
fcView.getFileStatus(new Path("/danglingLink"));
|
fcView.getFileStatus(new Path("/danglingLink"));
|
||||||
Assert.fail("Excepted a not found exception here");
|
|
||||||
} catch ( FileNotFoundException e) {
|
|
||||||
// as excepted
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user