hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r389620 - in /lucene/hadoop/trunk/src: java/org/apache/hadoop/dfs/DistributedFileSystem.java test/org/apache/hadoop/dfs/TestLocalDFS.java
Date Tue, 28 Mar 2006 22:57:47 GMT
Author: cutting
Date: Tue Mar 28 14:57:45 2006
New Revision: 389620

URL: http://svn.apache.org/viewcvs?rev=389620&view=rev
Log:
Fix unit tests on Windows.  Don't assume that, just because a pathname begins with a slash
that it also returns true for File.isAbsolute().  Instead use getAbsoluteFile() to force such
things to be absolute.

Modified:
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DistributedFileSystem.java
    lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestLocalDFS.java

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DistributedFileSystem.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DistributedFileSystem.java?rev=389620&r1=389619&r2=389620&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DistributedFileSystem.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DistributedFileSystem.java Tue Mar
28 14:57:45 2006
@@ -33,7 +33,7 @@
  *****************************************************************/
 public class DistributedFileSystem extends FileSystem {
     private File workingDir = 
-      new File("/user/", System.getProperty("user.name"));
+      new File("/user", System.getProperty("user.name")).getAbsoluteFile();
 
     private String name;
 
@@ -57,7 +57,7 @@
       if (f.isAbsolute()) {
         return f;
       } else {
-        return new File(workingDir, f.toString());
+        return new File(workingDir, f.getPath());
       }
     }
     

Modified: lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestLocalDFS.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestLocalDFS.java?rev=389620&r1=389619&r2=389620&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestLocalDFS.java (original)
+++ lucene/hadoop/trunk/src/test/org/apache/hadoop/dfs/TestLocalDFS.java Tue Mar 28 14:57:45
2006
@@ -46,7 +46,7 @@
       writeFile(fileSys, file1);
       assertTrue(fileSys.exists(new File(orig_path, file1.getPath())));
       fileSys.delete(file1);
-      File subdir1 = new File("/somewhere");
+      File subdir1 = new File("/somewhere").getAbsoluteFile();
       fileSys.setWorkingDirectory(subdir1);
       writeFile(fileSys, file1);
       cleanupFile(fileSys, new File(subdir1, file1.getPath()));



Mime
View raw message