Author: cdouglas
Date: Thu Jul 10 12:49:54 2008
New Revision: 675702

URL: http://svn.apache.org/viewvc?rev=675702&view=rev
Log:
HADOOP-3725. Prevent TestMiniMRMapDebugScript from swallowing exceptions.
Contributed by Steve Loughran.

Modified:
    hadoop/core/trunk/CHANGES.txt
    
hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRMapRedDebugScript.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=675702&r1=675701&r2=675702&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Thu Jul 10 12:49:54 2008
@@ -90,6 +90,9 @@
     HADOOP-3711. Fixes the Streaming input parsing to properly find the 
     separator. (Amareshwari Sriramadasu via ddas)
 
+    HADOOP-3725. Prevent TestMiniMRMapDebugScript from swallowing exceptions.
+    (Steve Loughran via cdouglas)
+
 Release 0.18.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: 
hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRMapRedDebugScript.java
URL: 
http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRMapRedDebugScript.java?rev=675702&r1=675701&r2=675702&view=diff
==============================================================================
--- 
hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRMapRedDebugScript.java
 (original)
+++ 
hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMiniMRMapRedDebugScript.java
 Thu Jul 10 12:49:54 2008
@@ -21,7 +21,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
-import java.net.URISyntaxException;
 
 import junit.framework.TestCase;
 
@@ -159,8 +158,7 @@
     try {
       job = new JobClient(conf).submitJob(conf);
     } catch (IOException e) {
-       LOG.info("Running Job failed");
-       e.printStackTrace();
+       LOG.info("Running Job failed", e);
     }
 
     JobID jobId = job.getID();
@@ -182,7 +180,7 @@
    * the output of debug out log. 
    *
    */
-  public void testMapDebugScript(){
+  public void testMapDebugScript() throws Exception {
     try {
       
       // create configuration, dfs, file system and mapred cluster 
@@ -207,10 +205,7 @@
       
       // Assert the output of debug script.
       assertEquals("Test Script\nBailing out", result);
-      
-    } catch(Exception e) {
-      e.printStackTrace();
-      fail("Exception in testing mapred debug script");
+
     } finally {  
       // close file system and shut down dfs and mapred cluster
       try {
@@ -224,15 +219,18 @@
           mr.shutdown();
         }
       } catch (IOException ioe) {
-        LOG.info("IO exception in closing file system)" );
-        ioe.printStackTrace();                         
+        LOG.info("IO exception in closing file system:"+ioe.getMessage(), ioe);
       }
     }
   }
 
   public static void main(String args[]){
     TestMiniMRMapRedDebugScript tmds = new TestMiniMRMapRedDebugScript();
-    tmds.testMapDebugScript();
+    try {
+      tmds.testMapDebugScript();
+    } catch (Exception e) {
+      LOG.error("Exception in test: "+e.getMessage(), e);
+    }
   }
   
 }


Reply via email to