From da1b01c9e3032cb0599080ff3b3a3a4dde687602 Mon Sep 17 00:00:00 2001 From: Alejandro Abdelnur Date: Wed, 4 Apr 2012 14:56:13 +0000 Subject: [PATCH] MAPREDUCE-4098. TestMRApps testSetClasspath fails (tucu) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1309432 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 4 +++- .../hadoop/mapreduce/v2/util/TestMRApps.java | 16 +++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 38f935f47d1..4759953c869 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -197,7 +197,9 @@ Release 2.0.0 - UNRELEASED MAPREDUCE-4095. TestJobInProgress#testLocality uses a bogus topology. (Colin Patrick McCabe via eli) - + + MAPREDUCE-4098. TestMRApps testSetClasspath fails (tucu) + Release 0.23.3 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapreduce/v2/util/TestMRApps.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapreduce/v2/util/TestMRApps.java index 94ce417396e..b50b8f89bfc 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapreduce/v2/util/TestMRApps.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/test/java/org/apache/hadoop/mapreduce/v2/util/TestMRApps.java @@ -33,6 +33,7 @@ import org.apache.hadoop.mapreduce.v2.api.records.TaskType; import org.apache.hadoop.mapreduce.v2.util.MRApps; import org.apache.hadoop.yarn.YarnException; import org.apache.hadoop.yarn.api.records.ApplicationId; +import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider; import org.junit.Test; @@ -130,15 +131,12 @@ public class TestMRApps { Job job = Job.getInstance(); Map environment = new HashMap(); MRApps.setClasspath(environment, job.getConfiguration()); - assertEquals("$PWD:$HADOOP_CONF_DIR:" + - "$HADOOP_COMMON_HOME/share/hadoop/common/*:" + - "$HADOOP_COMMON_HOME/share/hadoop/common/lib/*:" + - "$HADOOP_HDFS_HOME/share/hadoop/hdfs/*:" + - "$HADOOP_HDFS_HOME/share/hadoop/hdfs/lib/*:" + - "$YARN_HOME/share/hadoop/mapreduce/*:" + - "$YARN_HOME/share/hadoop/mapreduce/lib/*:" + - "job.jar:$PWD/*", - environment.get("CLASSPATH")); + assertTrue(environment.get("CLASSPATH").startsWith("$PWD:")); + String confClasspath = job.getConfiguration().get(YarnConfiguration.YARN_APPLICATION_CLASSPATH); + if (confClasspath != null) { + confClasspath = confClasspath.replaceAll(",\\s*", ":").trim(); + } + assertTrue(environment.get("CLASSPATH").contains(confClasspath)); } @Test public void testSetClasspathWithUserPrecendence() {