From a75679cdb33e07fb982bac02fbe295192a0eb78a Mon Sep 17 00:00:00 2001 From: Vinayakumar B Date: Tue, 14 Apr 2015 11:58:12 +0530 Subject: [PATCH] HADOOP-11819. HttpServerFunctionalTest#prepareTestWebapp should create web app directory if it does not exist. (Contributed by Rohith) (cherry picked from commit b5a0b24643688270e77f85aaf1af24fee2c556cc) --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../apache/hadoop/http/HttpServerFunctionalTest.java | 12 +++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 742a054d749..c77bbb73134 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -50,6 +50,9 @@ Release 2.8.0 - UNRELEASED HADOOP-7713. dfs -count -q should label output column (Jonathan Allen via aw) + HADOOP-11819. HttpServerFunctionalTest#prepareTestWebapp should create web + app directory if it does not exist. (Rohith via vinayakumarb) + OPTIMIZATIONS HADOOP-11785. Reduce the number of listStatus operation in distcp diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/HttpServerFunctionalTest.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/HttpServerFunctionalTest.java index 4a4de41100b..faa27a7f60c 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/HttpServerFunctionalTest.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/HttpServerFunctionalTest.java @@ -123,11 +123,13 @@ public class HttpServerFunctionalTest extends Assert { File testWebappDir = new File(webapps + File.separatorChar + TEST); try { - if (!testWebappDir.exists()) { - fail("Test webapp dir " + testWebappDir.getCanonicalPath() + " missing"); - } - } - catch (IOException e) { + if (!testWebappDir.exists()) { + if (!testWebappDir.mkdirs()) { + fail("Test webapp dir " + testWebappDir.getCanonicalPath() + + " can not be created"); + } + } + } catch (IOException e) { } }