|
@@ -412,6 +412,26 @@ public class TestDistributedFileSystem {
|
|
final UserGroupInformation ugi = UserGroupInformation.createUserForTesting(
|
|
final UserGroupInformation ugi = UserGroupInformation.createUserForTesting(
|
|
current.getShortUserName() + "x", new String[]{"user"});
|
|
current.getShortUserName() + "x", new String[]{"user"});
|
|
|
|
|
|
|
|
+ try {
|
|
|
|
+ ((DistributedFileSystem) hdfs).getFileChecksum(new Path(
|
|
|
|
+ "/test/TestNonExistingFile"));
|
|
|
|
+ fail("Expecting FileNotFoundException");
|
|
|
|
+ } catch (FileNotFoundException e) {
|
|
|
|
+ assertTrue("Not throwing the intended exception message", e.getMessage()
|
|
|
|
+ .contains("File does not exist: /test/TestNonExistingFile"));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ Path path = new Path(
|
|
|
|
+ "/test/TestExistingDir/");
|
|
|
|
+ hdfs.mkdirs(path);
|
|
|
|
+ ((DistributedFileSystem) hdfs).getFileChecksum(path);
|
|
|
|
+ fail("Expecting FileNotFoundException");
|
|
|
|
+ } catch (FileNotFoundException e) {
|
|
|
|
+ assertTrue("Not throwing the intended exception message", e.getMessage()
|
|
|
|
+ .contains("File does not exist: /test/TestExistingDir"));
|
|
|
|
+ }
|
|
|
|
+
|
|
//hftp
|
|
//hftp
|
|
final String hftpuri = "hftp://" + nnAddr;
|
|
final String hftpuri = "hftp://" + nnAddr;
|
|
System.out.println("hftpuri=" + hftpuri);
|
|
System.out.println("hftpuri=" + hftpuri);
|