Browse Source

MAPREDUCE-924. Fixes the TestPipes testcase to use Tool. Contributed by Amareshwari Sriramadasu.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20@810136 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 16 năm trước cách đây
mục cha
commit
5cf0edf4d8

+ 3 - 0
CHANGES.txt

@@ -253,6 +253,9 @@ Release 0.20.1 - 2009-08-27
     MAPREDUCE-687. Fix an assertion in TestMiniMRMapRedDebugScript.
     MAPREDUCE-687. Fix an assertion in TestMiniMRMapRedDebugScript.
     (Amareshwari Sriramadasu via sharad)
     (Amareshwari Sriramadasu via sharad)
 
 
+    MAPREDUCE-924. Fixes the TestPipes testcase to use Tool.
+    (Amareshwari Sriramadasu via sharad)
+
 Release 0.20.0 - 2009-04-15
 Release 0.20.0 - 2009-04-15
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 4 - 1
src/test/org/apache/hadoop/mapred/pipes/TestPipes.java

@@ -40,6 +40,7 @@ import org.apache.hadoop.mapred.RunningJob;
 import org.apache.hadoop.mapred.TestMiniMRWithDFS;
 import org.apache.hadoop.mapred.TestMiniMRWithDFS;
 import org.apache.hadoop.mapred.Counters.Counter;
 import org.apache.hadoop.mapred.Counters.Counter;
 import org.apache.hadoop.util.StringUtils;
 import org.apache.hadoop.util.StringUtils;
+import org.apache.hadoop.util.ToolRunner;
 
 
 import junit.framework.TestCase;
 import junit.framework.TestCase;
 
 
@@ -238,12 +239,14 @@ public class TestPipes extends TestCase {
                        " -program " + 
                        " -program " + 
                        dfs.getFileSystem().makeQualified(wordExec));
                        dfs.getFileSystem().makeQualified(wordExec));
     try {
     try {
-      Submitter.main(new String[]{"-conf", jobXml.toString(),
+      int ret = ToolRunner.run(new Submitter(),
+                               new String[]{"-conf", jobXml.toString(),
                                   "-input", inDir.toString(),
                                   "-input", inDir.toString(),
                                   "-output", outDir.toString(),
                                   "-output", outDir.toString(),
                                   "-program", 
                                   "-program", 
                         dfs.getFileSystem().makeQualified(wordExec).toString(),
                         dfs.getFileSystem().makeQualified(wordExec).toString(),
                                   "-reduces", "2"});
                                   "-reduces", "2"});
+      assertEquals(0, ret);
     } catch (Exception e) {
     } catch (Exception e) {
       assertTrue("got exception: " + StringUtils.stringifyException(e), false);
       assertTrue("got exception: " + StringUtils.stringifyException(e), false);
     }
     }