hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhr...@apache.org
Subject svn commit: r628999 - in /hadoop/core/trunk: CHANGES.txt src/test/org/apache/hadoop/fs/TestDU.java
Date Tue, 19 Feb 2008 06:03:03 GMT
Author: dhruba
Date: Mon Feb 18 22:02:59 2008
New Revision: 628999

URL: http://svn.apache.org/viewvc?rev=628999&view=rev
Log:
HADOOP-2813. TestDU unit test uses its own directory to run its
sequence of tests.  (Mahadev Konar via dhruba)


Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/test/org/apache/hadoop/fs/TestDU.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=628999&r1=628998&r2=628999&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Mon Feb 18 22:02:59 2008
@@ -50,6 +50,9 @@
     HADOOP-2844. distcp closes file handles for sequence files.
     (Tsz Wo (Nicholas), SZE via dhruba)
 
+    HADOOP-2813. TestDU unit test uses its own directory to run its 
+    sequence of tests.  (Mahadev Konar via dhruba)
+
 Release 0.16.1 - Unrelease
 
   BUG FIXES

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/fs/TestDU.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/fs/TestDU.java?rev=628999&r1=628998&r2=628999&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/fs/TestDU.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/fs/TestDU.java Mon Feb 18 22:02:59 2008
@@ -25,7 +25,8 @@
 
 /** This test makes sure that "DU" does not get to run on each call to getUsed */ 
 public class TestDU extends TestCase {
-  final static private File DU_DIR = new File(".");
+  final static private File DU_DIR = new File(
+      System.getProperty("test.build.data","/tmp"), "dutmp");
   final static private File DU_FILE1 = new File(DU_DIR, "tmp1");
   final static private File DU_FILE2 = new File(DU_DIR, "tmp2");
   
@@ -50,6 +51,8 @@
   private void testDU(long interval) throws IOException {
     rmFile(DU_FILE1);
     rmFile(DU_FILE2);
+    DU_DIR.delete();
+    assertTrue(DU_DIR.mkdirs());
     try {
       createFile(DU_FILE1);
       DU du = new DU(DU_DIR, interval*60000);
@@ -64,6 +67,7 @@
     } finally {
       rmFile(DU_FILE1);
       rmFile(DU_FILE2);
+      DU_DIR.delete();
     }
   }
 



Mime
View raw message