diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index f848bfd724d..64868c9fc15 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -429,6 +429,9 @@ Release 2.1.0-beta - UNRELEASED HADOOP-8982. TestSocketIOWithTimeout fails on Windows. (Chris Nauroth via suresh) + HADOOP-8958. ViewFs:Non absolute mount name failures when running + multiple tests on Windows. (Chris Nauroth via suresh) + Release 2.0.5-alpha - UNRELEASED INCOMPATIBLE CHANGES @@ -768,6 +771,9 @@ Release 2.0.3-alpha - 2013-02-06 HADOOP-9289. FsShell rm -f fails for non-matching globs. (Daryn Sharp via suresh) + HADOOP-8958. ViewFs:Non absolute mount name failures when running + multiple tests on Windows. (Chris Nauroth via suresh) + Release 2.0.2-alpha - 2012-09-07 INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFileSystemTestSetup.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFileSystemTestSetup.java index 07bd0ce6e09..81ca2106b80 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFileSystemTestSetup.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFileSystemTestSetup.java @@ -26,6 +26,7 @@ import org.apache.hadoop.fs.FileSystemTestHelper; import org.apache.hadoop.fs.FsConstants; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.viewfs.ConfigUtil; +import org.apache.hadoop.util.Shell; import org.mortbay.log.Log; @@ -130,8 +131,11 @@ public class ViewFileSystemTestSetup { * in the target file system. */ static void linkUpFirstComponents(Configuration conf, String path, FileSystem fsTarget, String info) { - int indexOf2ndSlash = path.indexOf('/', 1); - String firstComponent = path.substring(0, indexOf2ndSlash); + int indexOfEnd = path.indexOf('/', 1); + if (Shell.WINDOWS) { + indexOfEnd = path.indexOf('/', indexOfEnd + 1); + } + String firstComponent = path.substring(0, indexOfEnd); URI linkTarget = fsTarget.makeQualified(new Path(firstComponent)).toUri(); ConfigUtil.addLink(conf, firstComponent, linkTarget); Log.info("Added link for " + info + " " diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFsTestSetup.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFsTestSetup.java index 0dd83408173..92bcbc34642 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFsTestSetup.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFsTestSetup.java @@ -25,6 +25,7 @@ import org.apache.hadoop.fs.FileContextTestHelper; import org.apache.hadoop.fs.FsConstants; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.viewfs.ConfigUtil; +import org.apache.hadoop.util.Shell; import org.mortbay.log.Log; @@ -120,8 +121,11 @@ public class ViewFsTestSetup { */ static void linkUpFirstComponents(Configuration conf, String path, FileContext fsTarget, String info) { - int indexOf2ndSlash = path.indexOf('/', 1); - String firstComponent = path.substring(0, indexOf2ndSlash); + int indexOfEnd = path.indexOf('/', 1); + if (Shell.WINDOWS) { + indexOfEnd = path.indexOf('/', indexOfEnd + 1); + } + String firstComponent = path.substring(0, indexOfEnd); URI linkTarget = fsTarget.makeQualified(new Path(firstComponent)).toUri(); ConfigUtil.addLink(conf, firstComponent, linkTarget); Log.info("Added link for " + info + " "