From aaa17aa6abcf630602cb781f6750c2e8b6b27291 Mon Sep 17 00:00:00 2001 From: Mahadev Konar Date: Sat, 4 Feb 2012 20:21:42 +0000 Subject: [PATCH] MAPREDUCE-3775. Change MiniYarnCluster to escape special chars in testname. (Hitesh Shah via mahadev) - Merging r1240603 from trunk. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1240604 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../org/apache/hadoop/mapred/TestMiniMRClientCluster.java | 5 ++++- .../java/org/apache/hadoop/yarn/server/MiniYARNCluster.java | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 628b2574e41..81100b0c934 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -654,6 +654,9 @@ Release 0.23.1 - Unreleased MAPREDUCE-3759. ClassCastException thrown in -list-active-trackers when there are a few unhealthy nodes (vinodkv via mahadev) + MAPREDUCE-3775. Change MiniYarnCluster to escape special chars in testname. + (Hitesh Shah via mahadev) + Release 0.23.0 - 2011-11-01 INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRClientCluster.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRClientCluster.java index ddadac99001..27e6666cc5b 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRClientCluster.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRClientCluster.java @@ -49,6 +49,9 @@ public class TestMiniMRClientCluster { private static Path[] inFiles = new Path[5]; private static MiniMRClientCluster mrCluster; + private class InternalClass { + } + @BeforeClass public static void setup() throws IOException { final Configuration conf = new Configuration(); @@ -73,7 +76,7 @@ public class TestMiniMRClientCluster { // create the mini cluster to be used for the tests mrCluster = MiniMRClientClusterFactory.create( - TestMiniMRClientCluster.class, 1, new Configuration()); + InternalClass.class, 1, new Configuration()); } @AfterClass diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java index ae35de0ac13..37cbcd6369f 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java @@ -81,11 +81,11 @@ public class MiniYARNCluster extends CompositeService { */ public MiniYARNCluster(String testName, int noOfNodeManagers, int numLocalDirs, int numLogDirs) { - - super(testName); + super(testName.replace("$", "")); this.numLocalDirs = numLocalDirs; this.numLogDirs = numLogDirs; - this.testWorkDir = new File("target", testName); + this.testWorkDir = new File("target", + testName.replace("$", "")); try { FileContext.getLocalFSFileContext().delete( new Path(testWorkDir.getAbsolutePath()), true);