From 81bfd0316e17cc21be8cf7469f0af623f92d5285 Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Sat, 6 Jul 2013 03:42:43 +0000 Subject: [PATCH] MAPREDUCE-5360. Merging change r1500194 from trunk to branch-2. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1500195 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../hadoop/mapreduce/TestMRJobClient.java | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 9ab23e012d5..ea8d2a95399 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -481,6 +481,9 @@ Release 2.1.0-beta - 2013-07-02 MAPREDUCE-5357. Job staging directory owner checking could fail on Windows. (Chuan Liu via cnauroth) + MAPREDUCE-5360. TestMRJobClient fails on Windows due to path format. + (Chuan Liu via cnauroth) + MAPREDUCE-5291. Change MR App to use updated property names in container-log4j.properties. (Zhijie Shen via sseth) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMRJobClient.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMRJobClient.java index 43ca1561c43..ed83a88be35 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMRJobClient.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestMRJobClient.java @@ -210,6 +210,10 @@ public class TestMRJobClient extends ClusterMapReduceTestCase { job.setPriority(JobPriority.NORMAL); File fcon = File.createTempFile("config", ".xml"); + FileSystem localFs = FileSystem.getLocal(conf); + String fconUri = new Path(fcon.getAbsolutePath()) + .makeQualified(localFs.getUri(), localFs.getWorkingDirectory()).toUri() + .toString(); job.getConfiguration().writeXml(new FileOutputStream(fcon)); ByteArrayOutputStream out = new ByteArrayOutputStream(); @@ -219,7 +223,7 @@ public class TestMRJobClient extends ClusterMapReduceTestCase { exitCode = runTool(conf, jc, - new String[] { "-submit", "file://" + fcon.getAbsolutePath() }, out); + new String[] { "-submit", fconUri }, out); assertEquals("Exit code", 0, exitCode); String answer = new String(out.toByteArray()); // in console was written @@ -334,13 +338,18 @@ public class TestMRJobClient extends ClusterMapReduceTestCase { CLI jc = createJobClient(); ByteArrayOutputStream out = new ByteArrayOutputStream(); File f = new File("src/test/resources/job_1329348432655_0001-10.jhist"); + FileSystem localFs = FileSystem.getLocal(conf); + String historyFileUri = new Path(f.getAbsolutePath()) + .makeQualified(localFs.getUri(), localFs.getWorkingDirectory()).toUri() + .toString(); + // bad command - int exitCode = runTool(conf, jc, new String[] { "-history", "pul", - "file://" + f.getAbsolutePath() }, out); + int exitCode = runTool(conf, jc, new String[] { "-history", "pul", + historyFileUri }, out); assertEquals("Exit code", -1, exitCode); exitCode = runTool(conf, jc, new String[] { "-history", "all", - "file://" + f.getAbsolutePath() }, out); + historyFileUri }, out); assertEquals("Exit code", 0, exitCode); String line; BufferedReader br = new BufferedReader(new InputStreamReader(