From f799e61269d03651c0506a013510b1c0a6f9d061 Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Thu, 27 Oct 2011 08:31:44 +0000 Subject: [PATCH] MAPREDUCE-3279. Fixed TestJobHistoryParsing which assumed user name to be mapred all the time. Contributed by Siddharth Seth. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1189670 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index b529c35cd8e..c834739f3a0 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -1801,6 +1801,9 @@ Release 0.23.0 - Unreleased MAPREDUCE-3259. Added java.library.path of NodeManager to ContainerLocalizer in LinuxContainerExecutor. (Kihwal Lee via acmurthy) + MAPREDUCE-3279. Fixed TestJobHistoryParsing which assumed user name to be + mapred all the time. (Siddharth Seth via acmurthy) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java index b4036cbdfa7..7520efb12a0 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/TestJobHistoryParsing.java @@ -95,7 +95,8 @@ public class TestJobHistoryParsing { JobHistoryParser parser = new JobHistoryParser(in); JobInfo jobInfo = parser.parse(); - Assert.assertEquals("Incorrect username ", "mapred", jobInfo.getUsername()); + Assert.assertEquals("Incorrect username ", System.getProperty("user.name"), + jobInfo.getUsername()); Assert.assertEquals("Incorrect jobName ", "test", jobInfo.getJobname()); Assert.assertEquals("Incorrect queuename ", "default", jobInfo.getJobQueueName()); @@ -182,7 +183,7 @@ public class TestJobHistoryParsing { Integer.parseInt(jobSummaryElements.get("numMaps"))); Assert.assertEquals("Mismatch in num reduce slots", 1, Integer.parseInt(jobSummaryElements.get("numReduces"))); - Assert.assertEquals("User does not match", "mapred", + Assert.assertEquals("User does not match", System.getProperty("user.name"), jobSummaryElements.get("user")); Assert.assertEquals("Queue does not match", "default", jobSummaryElements.get("queue"));