MAPREDUCE-5360. TestMRJobClient fails on Windows due to path format. Contributed by Chuan Liu.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1500194 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris Nauroth 2013-07-06 03:34:23 +00:00
parent 81620ca1c9
commit e01cbdac25
2 changed files with 16 additions and 4 deletions

View File

@ -612,6 +612,9 @@ Release 2.1.0-beta - 2013-07-02
MAPREDUCE-5357. Job staging directory owner checking could fail on Windows. MAPREDUCE-5357. Job staging directory owner checking could fail on Windows.
(Chuan Liu via cnauroth) (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 MAPREDUCE-5291. Change MR App to use updated property names in
container-log4j.properties. (Zhijie Shen via sseth) container-log4j.properties. (Zhijie Shen via sseth)

View File

@ -211,6 +211,10 @@ private void testSubmit(Configuration conf) throws Exception {
job.setPriority(JobPriority.NORMAL); job.setPriority(JobPriority.NORMAL);
File fcon = File.createTempFile("config", ".xml"); 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)); job.getConfiguration().writeXml(new FileOutputStream(fcon));
ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream();
@ -220,7 +224,7 @@ private void testSubmit(Configuration conf) throws Exception {
exitCode = runTool(conf, jc, exitCode = runTool(conf, jc,
new String[] { "-submit", "file://" + fcon.getAbsolutePath() }, out); new String[] { "-submit", fconUri }, out);
assertEquals("Exit code", 0, exitCode); assertEquals("Exit code", 0, exitCode);
String answer = new String(out.toByteArray()); String answer = new String(out.toByteArray());
// in console was written // in console was written
@ -335,13 +339,18 @@ private void testJobHistory(Configuration conf) throws Exception {
CLI jc = createJobClient(); CLI jc = createJobClient();
ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream();
File f = new File("src/test/resources/job_1329348432655_0001-10.jhist"); 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 // bad command
int exitCode = runTool(conf, jc, new String[] { "-history", "pul", int exitCode = runTool(conf, jc, new String[] { "-history", "pul",
"file://" + f.getAbsolutePath() }, out); historyFileUri }, out);
assertEquals("Exit code", -1, exitCode); assertEquals("Exit code", -1, exitCode);
exitCode = runTool(conf, jc, new String[] { "-history", "all", exitCode = runTool(conf, jc, new String[] { "-history", "all",
"file://" + f.getAbsolutePath() }, out); historyFileUri }, out);
assertEquals("Exit code", 0, exitCode); assertEquals("Exit code", 0, exitCode);
String line; String line;
BufferedReader br = new BufferedReader(new InputStreamReader( BufferedReader br = new BufferedReader(new InputStreamReader(