MAPREDUCE-4098. TestMRApps testSetClasspath fails (tucu)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1309432 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Alejandro Abdelnur 2012-04-04 14:56:13 +00:00
parent d99c2958dd
commit da1b01c9e3
2 changed files with 10 additions and 10 deletions

View File

@ -197,7 +197,9 @@ Release 2.0.0 - UNRELEASED
MAPREDUCE-4095. TestJobInProgress#testLocality uses a bogus topology. MAPREDUCE-4095. TestJobInProgress#testLocality uses a bogus topology.
(Colin Patrick McCabe via eli) (Colin Patrick McCabe via eli)
MAPREDUCE-4098. TestMRApps testSetClasspath fails (tucu)
Release 0.23.3 - UNRELEASED Release 0.23.3 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -33,6 +33,7 @@
import org.apache.hadoop.mapreduce.v2.util.MRApps; import org.apache.hadoop.mapreduce.v2.util.MRApps;
import org.apache.hadoop.yarn.YarnException; import org.apache.hadoop.yarn.YarnException;
import org.apache.hadoop.yarn.api.records.ApplicationId; 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.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
import org.junit.Test; import org.junit.Test;
@ -130,15 +131,12 @@ public class TestMRApps {
Job job = Job.getInstance(); Job job = Job.getInstance();
Map<String, String> environment = new HashMap<String, String>(); Map<String, String> environment = new HashMap<String, String>();
MRApps.setClasspath(environment, job.getConfiguration()); MRApps.setClasspath(environment, job.getConfiguration());
assertEquals("$PWD:$HADOOP_CONF_DIR:" + assertTrue(environment.get("CLASSPATH").startsWith("$PWD:"));
"$HADOOP_COMMON_HOME/share/hadoop/common/*:" + String confClasspath = job.getConfiguration().get(YarnConfiguration.YARN_APPLICATION_CLASSPATH);
"$HADOOP_COMMON_HOME/share/hadoop/common/lib/*:" + if (confClasspath != null) {
"$HADOOP_HDFS_HOME/share/hadoop/hdfs/*:" + confClasspath = confClasspath.replaceAll(",\\s*", ":").trim();
"$HADOOP_HDFS_HOME/share/hadoop/hdfs/lib/*:" + }
"$YARN_HOME/share/hadoop/mapreduce/*:" + assertTrue(environment.get("CLASSPATH").contains(confClasspath));
"$YARN_HOME/share/hadoop/mapreduce/lib/*:" +
"job.jar:$PWD/*",
environment.get("CLASSPATH"));
} }
@Test public void testSetClasspathWithUserPrecendence() { @Test public void testSetClasspathWithUserPrecendence() {