You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by in...@apache.org on 2018/03/20 00:23:38 UTC
[2/5] hadoop git commit: HDFS-13296. GenericTestUtils generates paths
with drive letter in Windows and fail webhdfs related test cases. Contributed
by Xiao Liang.
HDFS-13296. GenericTestUtils generates paths with drive letter in Windows and fail webhdfs related test cases. Contributed by Xiao Liang.
(cherry picked from commit e65ff1c8be48ef4f04ed96f96ac4caef4974944d)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/7eb0bdbd
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/7eb0bdbd
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/7eb0bdbd
Branch: refs/heads/branch-3.1
Commit: 7eb0bdbd32f1c36eebe6f82ec5472b30136cfd5b
Parents: a4f0dbc
Author: Inigo Goiri <in...@apache.org>
Authored: Mon Mar 19 17:19:30 2018 -0700
Committer: Inigo Goiri <in...@apache.org>
Committed: Mon Mar 19 17:20:36 2018 -0700
----------------------------------------------------------------------
.../test/java/org/apache/hadoop/test/GenericTestUtils.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/7eb0bdbd/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java
index 61b0271..53eb2be 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java
@@ -44,6 +44,7 @@ import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.impl.Log4JLogger;
import org.apache.hadoop.fs.FileUtil;
+import org.apache.hadoop.fs.Path;
import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.util.Time;
import org.apache.log4j.Appender;
@@ -248,7 +249,7 @@ public abstract class GenericTestUtils {
* @return the absolute directory for tests. Caller is expected to create it.
*/
public static File getRandomizedTestDir() {
- return new File(getRandomizedTempPath()).getAbsoluteFile();
+ return new File(getRandomizedTempPath());
}
/**
@@ -259,7 +260,9 @@ public abstract class GenericTestUtils {
* @return a string to use in paths
*/
public static String getTempPath(String subpath) {
- String prop = System.getProperty(SYSPROP_TEST_DATA_DIR, DEFAULT_TEST_DATA_PATH);
+ String prop = (Path.WINDOWS) ? DEFAULT_TEST_DATA_PATH
+ : System.getProperty(SYSPROP_TEST_DATA_DIR, DEFAULT_TEST_DATA_PATH);
+
if (prop.isEmpty()) {
// corner case: property is there but empty
prop = DEFAULT_TEST_DATA_PATH;
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org