diff options
author | Inigo Goiri <inigoiri@apache.org> | 2018-06-04 12:55:54 -0700 |
---|---|---|
committer | Inigo Goiri <inigoiri@apache.org> | 2018-06-04 12:57:11 -0700 |
commit | 9fe265f44ebd745ebbbd29908f7f3d364a78ca62 (patch) | |
tree | 4ca92fe85db66b7142e6a07f14edf88a14e78dea | |
parent | a3afd690511034762bb96c8c986dc47489ee327c (diff) |
MAPREDUCE-7105. Fix TestNativeCollectorOnlyHandler.testOnCall on Windows because of the path format. Contributed by Giovanni Matteo Fumarola.
(cherry picked from commit dad1bb868f7a28a486fd500f102c8c174e6dd272)
-rw-r--r-- | hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/handlers/TestNativeCollectorOnlyHandler.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/handlers/TestNativeCollectorOnlyHandler.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/handlers/TestNativeCollectorOnlyHandler.java index 1c8bf7a366..314963b1fd 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/handlers/TestNativeCollectorOnlyHandler.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/handlers/TestNativeCollectorOnlyHandler.java @@ -17,6 +17,7 @@ */ package org.apache.hadoop.mapred.nativetask.handlers; +import java.io.File; import java.io.IOException; import org.apache.hadoop.conf.Configuration; @@ -33,6 +34,7 @@ import org.apache.hadoop.mapred.nativetask.buffer.InputBuffer; import org.apache.hadoop.mapred.nativetask.testutil.TestConstants; import org.apache.hadoop.mapred.nativetask.util.OutputUtil; import org.apache.hadoop.mapred.nativetask.util.ReadWriteBuffer; +import org.apache.hadoop.util.StringUtils; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -110,9 +112,12 @@ public class TestNativeCollectorOnlyHandler { } Assert.assertTrue("exception thrown", thrown); - final String expectedOutputPath = LOCAL_DIR + "/output/file.out"; - final String expectedOutputIndexPath = LOCAL_DIR + "/output/file.out.index"; - final String expectedSpillPath = LOCAL_DIR + "/output/spill0.out"; + final String expectedOutputPath = StringUtils.join(File.separator, + new String[] {LOCAL_DIR, "output", "file.out"}); + final String expectedOutputIndexPath = StringUtils.join(File.separator, + new String[] {LOCAL_DIR, "output", "file.out.index"}); + final String expectedSpillPath = StringUtils.join(File.separator, + new String[] {LOCAL_DIR, "output", "spill0.out"}); final String outputPath = handler.onCall( NativeCollectorOnlyHandler.GET_OUTPUT_PATH, null).readString(); |