HDFS-2233. Add WebUI tests with URI reserved chars. Contributed by Eli Collins

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1158025 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eli Collins 2011-08-15 21:47:00 +00:00
parent b2b976a03b
commit 2ab3433e0e
2 changed files with 18 additions and 25 deletions

View File

@ -663,6 +663,8 @@ Trunk (unreleased changes)
HDFS-2237. Change UnderReplicatedBlocks from public to package private.
(szetszwo)
HDFS-2233. Add WebUI tests with URI reserved chars. (eli)
OPTIMIZATIONS
HDFS-1458. Improve checkpoint performance by avoiding unnecessary image

View File

@ -82,31 +82,22 @@ public class TestDatanodeJsp {
try {
cluster = new MiniDFSCluster.Builder(CONF).build();
cluster.waitActive();
testViewingFile(cluster, "/test-file", false);
testViewingFile(cluster, "/tmp/test-file", false);
testViewingFile(cluster, "/tmp/test-file%with goofy&characters", false);
testViewingFile(cluster, "/test-file", true);
testViewingFile(cluster, "/tmp/test-file", true);
testViewingFile(cluster, "/tmp/test-file%with goofy&characters", true);
testViewingFile(cluster, "/foo bar", true);
testViewingFile(cluster, "/foo+bar", true);
testViewingFile(cluster, "/foo;bar", true);
testViewingFile(cluster, "/foo=bar", true);
testViewingFile(cluster, "/foo,bar", true);
testViewingFile(cluster, "/foo?bar", true);
testViewingFile(cluster, "/foo\">bar", true);
testViewingFile(cluster, "/foo bar", false);
// See HDFS-2233
//testViewingFile(cluster, "/foo+bar", false);
//testViewingFile(cluster, "/foo;bar", false);
testViewingFile(cluster, "/foo=bar", false);
testViewingFile(cluster, "/foo,bar", false);
testViewingFile(cluster, "/foo?bar", false);
testViewingFile(cluster, "/foo\">bar", false);
String paths[] = {
"/test-file",
"/tmp/test-file",
"/tmp/test-file%with goofy&characters",
"/foo bar/foo bar",
"/foo+bar/foo+bar",
"/foo;bar/foo;bar",
"/foo=bar/foo=bar",
"/foo,bar/foo,bar",
"/foo?bar/foo?bar",
"/foo\">bar/foo\">bar"
};
for (String p : paths) {
testViewingFile(cluster, p, false);
testViewingFile(cluster, p, true);
}
} finally {
if (cluster != null) {
cluster.shutdown();