Author: cdouglas
Date: Thu Jul 10 13:00:59 2008
New Revision: 675708

URL: http://svn.apache.org/viewvc?rev=675708&view=rev
Log:
HADOOP-3726. Throw exceptions from TestCLI setup and teardown instead of
swallowing them. Contributed by Steve Loughran.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/test/org/apache/hadoop/cli/TestCLI.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=675708&r1=675707&r2=675708&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Thu Jul 10 13:00:59 2008
@@ -93,6 +93,9 @@
     HADOOP-3725. Prevent TestMiniMRMapDebugScript from swallowing exceptions.
     (Steve Loughran via cdouglas)
 
+    HADOOP-3726. Throw exceptions from TestCLI setup and teardown instead of
+    swallowing them. (Steve Loughran via cdouglas)
+
 Release 0.18.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/cli/TestCLI.java
URL: 
http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/cli/TestCLI.java?rev=675708&r1=675707&r2=675708&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/cli/TestCLI.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/cli/TestCLI.java Thu Jul 10 
13:00:59 2008
@@ -104,46 +104,38 @@
   /*
    * Setup
    */
-  public void setUp() {
+  public void setUp() throws Exception {
     // Read the testConfig.xml file
     readTestConfigFile();
     
     // Start up the mini dfs cluster
     boolean success = false;
-    try {
-      conf = new Configuration();
-      cluster = new MiniDFSCluster(conf, 1, true, null);
-      namenode = conf.get("fs.default.name", "file:///");
-      clitestDataDir = new File(System.getProperty("test.cache.data")).
-        toURI().toString().replace(' ', '+');
-      username = System.getProperty("user.name");
-      
-      FileSystem fs = cluster.getFileSystem();
-      assertTrue("Not a HDFS: "+fs.getUri(),
-                 fs instanceof DistributedFileSystem);
-      dfs = (DistributedFileSystem) fs;
-      success = true;
-    } catch (Exception e) {
-      LOG.info("Exception starting MiniDFS cluster: " + e);
-    }
-    
+    conf = new Configuration();
+    cluster = new MiniDFSCluster(conf, 1, true, null);
+    namenode = conf.get("fs.default.name", "file:///");
+    clitestDataDir = new File(System.getProperty("test.cache.data")).
+      toURI().toString().replace(' ', '+');
+    username = System.getProperty("user.name");
+
+    FileSystem fs = cluster.getFileSystem();
+    assertTrue("Not a HDFS: "+fs.getUri(),
+               fs instanceof DistributedFileSystem);
+    dfs = (DistributedFileSystem) fs;
+    success = true;
+
     assertTrue("Error setting up Mini DFS cluster", success);
   }
   
   /**
    * Tear down
    */
-  public void tearDown() {
+  public void tearDown() throws Exception {
     boolean success = false;
-    try {
-      dfs.close();
-      cluster.shutdown();
-      success = true;
-      Thread.sleep(2000);
-    } catch (Exception e) {
-      LOG.info("Exception shutting down MiniDFS cluster: " + e);
-    }
-    
+    dfs.close();
+    cluster.shutdown();
+    success = true;
+    Thread.sleep(2000);
+
     assertTrue("Error tearing down Mini DFS cluster", success);
     
     displayResults();


Reply via email to