HDFS-14466. Add a regression test for HDFS-14323.

Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
(cherry picked from commit 00dd843a1a)
This commit is contained in:
Masatake Iwasaki 2019-07-11 17:40:25 +09:00 committed by Akira Ajisaka
parent 3e3bbb7f5e
commit 9ed2c22d57
No known key found for this signature in database
GPG Key ID: C1EDBB9CA400FD50
1 changed files with 14 additions and 0 deletions

View File

@ -469,4 +469,18 @@ public class TestWebHdfsUrl {
}
}
@Test
public void testWebHdfsUrlEncoding() throws Exception {
final WebHdfsFileSystem fs =
(WebHdfsFileSystem) FileSystem.get(uri, WebHdfsTestUtil.createConf());
// characters which should not be urlencoded.
final String unreserved = "_-!.~'()*";
final String punct = ",:$&=";
String path = "/testWebHdfsUrlEncoding" + unreserved + punct;
URL url =
WebHdfsTestUtil.toUrl(fs, GetOpParam.Op.LISTSTATUS, new Path(path));
WebHdfsTestUtil.LOG.info(url.getPath());
assertEquals(WebHdfsFileSystem.PATH_PREFIX + path, url.getPath());
}
}