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.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 void testOnCall() throws IOException { } 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();