You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by cu...@apache.org on 2006/09/18 23:09:56 UTC

svn commit: r447560 - in /lucene/hadoop/trunk: CHANGES.txt src/test/org/apache/hadoop/dfs/TestDFSShellGenericOptions.java

Author: cutting
Date: Mon Sep 18 14:09:55 2006
New Revision: 447560

URL: http://svn.apache.org/viewvc?view=rev&rev=447560
Log:
HADOOP-533.  Fix unit test to not modify conf/ directory.  Contributed by Hairong.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestDFSShellGenericOptions.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=447560&r1=447559&r2=447560
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Mon Sep 18 14:09:55 2006
@@ -17,6 +17,9 @@
 4. HADOOP-288.  Add a file caching system and use it in MapReduce to
    cache job jar files on slave nodes.  (Mahadev Konar via cutting)
 
+5. HADOOP-533.  Fix unit test to not modify conf directory.
+  (Hairong Kuang via cutting)
+
 
 Release 0.6.2 (unreleased)
 

Modified: lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestDFSShellGenericOptions.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestDFSShellGenericOptions.java?view=diff&rev=447560&r1=447559&r2=447560
==============================================================================
--- lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestDFSShellGenericOptions.java (original)
+++ lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestDFSShellGenericOptions.java Mon Sep 18 14:09:55 2006
@@ -43,7 +43,7 @@
     
     private void testConfOption(String[] args, String namenode) {
         // prepare configuration hadoop-site.xml
-        File configDir = new File("conf", "minidfs");
+        File configDir = new File(new File("build", "test"), "minidfs");
         configDir.mkdirs();
         File siteFile = new File(configDir, "hadoop-site.xml");
         PrintWriter pw;
@@ -61,14 +61,14 @@
     
             // prepare arguments to create a directory /data
             args[0] = "-conf";
-            args[1] = "conf/minidfs/hadoop-site.xml";
+            args[1] = siteFile.getPath();
             execute(args, namenode); 
         } catch (FileNotFoundException e) {
-            // TODO Auto-generated catch block
             e.printStackTrace();
+        } finally {
+          siteFile.delete();
+          configDir.delete();
         }
-        
-        configDir.delete();
     }
     
     private void testPropertyOption(String[] args, String namenode) {