浏览代码

Revering r1444416 because it committed unnecessary changes.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1444418 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas 12 年之前
父节点
当前提交
50eba7b82e

+ 0 - 3
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -9,7 +9,6 @@ Release 2.0.4-beta - UNRELEASED
     HADOOP-9283. Add support for running the Hadoop client on AIX. (atm)
 
   IMPROVEMENTS
-
     HADOOP-9253. Capture ulimit info in the logs at service start time.
     (Arpit Gupta via suresh)
 
@@ -17,8 +16,6 @@ Release 2.0.4-beta - UNRELEASED
 
   BUG FIXES
 
-    HADOOP-9294. GetGroupsTestBase fails on Windows. (Chris Nauroth via suresh)
-
 Release 2.0.3-alpha - 2013-02-06 
 
   INCOMPATIBLE CHANGES

+ 9 - 29
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestListFiles.java

@@ -45,39 +45,19 @@ public class TestListFiles {
 
   final protected static Configuration conf = new Configuration();
   protected static FileSystem fs;
-  protected static Path TEST_DIR;
+  final protected static Path TEST_DIR = getTestDir();
   final private static int FILE_LEN = 10;
-  private static Path FILE1;
-  private static Path DIR1;
-  private static Path FILE2;
-  private static Path FILE3;
-
-  static {
-    setTestPaths(new Path(
-      System.getProperty("test.build.data", "build/test/data/work-dir/localfs"),
-      "main_"));
-  }
+  final private static Path FILE1 = new Path(TEST_DIR, "file1");
+  final private static Path DIR1 = new Path(TEST_DIR, "dir1");
+  final private static Path FILE2 = new Path(DIR1, "file2");
+  final private static Path FILE3 = new Path(DIR1, "file3");
 
   protected static Path getTestDir() {
-    return TEST_DIR;
-  }
-
-  /**
-   * Sets the root testing directory and reinitializes any additional test paths
-   * that are under the root.  This method is intended to be called from a
-   * subclass's @BeforeClass method if there is a need to override the testing
-   * directory.
-   * 
-   * @param testDir Path root testing directory
-   */
-  protected static void setTestPaths(Path testDir) {
-    TEST_DIR = testDir;
-    FILE1 = new Path(TEST_DIR, "file1");
-    DIR1 = new Path(TEST_DIR, "dir1");
-    FILE2 = new Path(DIR1, "file2");
-    FILE3 = new Path(DIR1, "file3");
+    return new Path(
+      System.getProperty("test.build.data","build/test/data/work-dir/localfs"),
+      "main_");
   }
-
+  
   @BeforeClass
   public static void testSetUp() throws Exception {
     fs = FileSystem.getLocal(conf);

+ 1 - 1
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/tools/GetGroupsTestBase.java

@@ -108,7 +108,7 @@ public abstract class GetGroupsTestBase {
     for (String group : user.getGroupNames()) {
       expectedOutput += " " + group;
     }
-    return expectedOutput + System.getProperty("line.separator");
+    return expectedOutput + "\n";
   }
   
   private String runTool(Configuration conf, String[] args, boolean success)

+ 0 - 3
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -11,9 +11,6 @@ Release 2.0.4-beta - UNRELEASED
   OPTIMIZATIONS
 
   BUG FIXES
-    
-    HDFS-4470. Several HDFS tests attempt file operations on invalid HDFS
-    paths when running on Windows. (Chris Nauroth via suresh)
 
     HDFS-4471. Namenode WebUI file browsing does not work with wildcard
     addresses configured. (Andrew Wang via atm)

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileLengthOnClusterRestart.java

@@ -43,7 +43,7 @@ public class TestFileLengthOnClusterRestart {
         .numDataNodes(2).build();
     HdfsDataInputStream in = null;
     try {
-      Path path = new Path("/tmp/TestFileLengthOnClusterRestart", "test");
+      Path path = new Path(MiniDFSCluster.getBaseDirectory(), "test");
       DistributedFileSystem dfs = (DistributedFileSystem) cluster
           .getFileSystem();
       FSDataOutputStream out = dfs.create(path);

+ 2 - 1
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestLargeBlock.java

@@ -183,7 +183,8 @@ public class TestLargeBlock {
     try {
 
       // create a new file in test data directory
-      Path file1 = new Path("/tmp/TestLargeBlock", blockSize + ".dat");
+      Path file1 = new Path(System.getProperty("test.build.data") + "/" +
+          Long.toString(blockSize) + ".dat");
       FSDataOutputStream stm = createFile(fs, file1, 1, blockSize);
       LOG.info("File " + file1 + " created with file size " +
           fileSize +

+ 0 - 1
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestListFilesInDFS.java

@@ -38,7 +38,6 @@ public class TestListFilesInDFS extends TestListFiles {
 
   @BeforeClass
   public static void testSetUp() throws Exception {
-    setTestPaths(new Path("/tmp/TestListFilesInDFS"));
     cluster = new MiniDFSCluster.Builder(conf).build();
     fs = cluster.getFileSystem();
     fs.delete(TEST_DIR, true);

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestRBWBlockInvalidation.java

@@ -67,7 +67,7 @@ public class TestRBWBlockInvalidation {
     try {
       final FSNamesystem namesystem = cluster.getNamesystem();
       FileSystem fs = cluster.getFileSystem();
-      Path testPath = new Path("/tmp/TestRBWBlockInvalidation", "foo1");
+      Path testPath = new Path(MiniDFSCluster.getBaseDirectory(), "foo1");
       out = fs.create(testPath, (short) 2);
       out.writeBytes("HDFS-3157: " + testPath);
       out.hsync();