From b090bc1c21160dded89dce79c4817e43213bd991 Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Wed, 12 Jun 2013 18:54:56 +0000 Subject: [PATCH] MAPREDUCE-5259. TestTaskLog fails on Windows because of path separators missmatch. Contributed by Ivan Mitic. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1492364 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../java/org/apache/hadoop/mapred/TestTaskLog.java | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 22ad230ead..3804cee4f0 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -508,6 +508,9 @@ Release 2.1.0-beta - UNRELEASED MAPREDUCE-5315. DistCp reports success even on failure. (mithun and jlowe via daryn) + MAPREDUCE-5259. TestTaskLog fails on Windows because of path separators + missmatch. (Ivan Mitic via cnauroth) + BREAKDOWN OF HADOOP-8562 SUBTASKS MAPREDUCE-4739. Some MapReduce tests fail to find winutils. diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapred/TestTaskLog.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapred/TestTaskLog.java index 0e16ab3d6f..39b849dd5c 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapred/TestTaskLog.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapred/TestTaskLog.java @@ -55,7 +55,8 @@ public void testTaskLog() throws IOException { when(taid.toString()).thenReturn("JobId"); File f = TaskLog.getTaskLogFile(taid, true, LogName.STDOUT); - assertTrue(f.getAbsolutePath().endsWith("testString/stdout")); + assertTrue(f.getAbsolutePath().endsWith("testString" + + File.separatorChar + "stdout")); // test getRealTaskLogFileLocation @@ -69,11 +70,14 @@ public void testTaskLog() throws IOException { TaskLog.syncLogs("location", taid, true); assertTrue(indexFile.getAbsolutePath().endsWith( - "userlogs/job_job_0001/JobId.cleanup/log.index")); + "userlogs" + File.separatorChar + "job_job_0001" + + File.separatorChar + "JobId.cleanup" + + File.separatorChar + "log.index")); f = TaskLog.getRealTaskLogFileLocation(taid, true, LogName.DEBUGOUT); if (f != null) { - assertTrue(f.getAbsolutePath().endsWith("location/debugout")); + assertTrue(f.getAbsolutePath().endsWith("location" + + File.separatorChar + "debugout")); FileUtils.copyFile(indexFile, f); } // test obtainLogDirOwner