瀏覽代碼

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 年之前
父節點
當前提交
5cf0edf4d8
共有 2 個文件被更改,包括 7 次插入1 次删除
  1. 3 0
      CHANGES.txt
  2. 4 1
      src/test/org/apache/hadoop/mapred/pipes/TestPipes.java

+ 3 - 0
CHANGES.txt

@@ -253,6 +253,9 @@ Release 0.20.1 - 2009-08-27
     MAPREDUCE-687. Fix an assertion in TestMiniMRMapRedDebugScript.
     (Amareshwari Sriramadasu via sharad)
 
+    MAPREDUCE-924. Fixes the TestPipes testcase to use Tool.
+    (Amareshwari Sriramadasu via sharad)
+
 Release 0.20.0 - 2009-04-15
 
   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.Counters.Counter;
 import org.apache.hadoop.util.StringUtils;
+import org.apache.hadoop.util.ToolRunner;
 
 import junit.framework.TestCase;
 
@@ -238,12 +239,14 @@ public class TestPipes extends TestCase {
                        " -program " + 
                        dfs.getFileSystem().makeQualified(wordExec));
     try {
-      Submitter.main(new String[]{"-conf", jobXml.toString(),
+      int ret = ToolRunner.run(new Submitter(),
+                               new String[]{"-conf", jobXml.toString(),
                                   "-input", inDir.toString(),
                                   "-output", outDir.toString(),
                                   "-program", 
                         dfs.getFileSystem().makeQualified(wordExec).toString(),
                                   "-reduces", "2"});
+      assertEquals(0, ret);
     } catch (Exception e) {
       assertTrue("got exception: " + StringUtils.stringifyException(e), false);
     }