hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sra...@apache.org
Subject svn commit: r1357351 - in /hadoop/common/branches/branch-1-win: ./ src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/ src/contrib/test/ src/test/org/apache/hadoop/fs/ src/test/org/apache/hadoop/hdfs/server/namenode/ src/test/org/apache/h...
Date Wed, 04 Jul 2012 17:56:52 GMT
Author: sradia
Date: Wed Jul  4 17:56:51 2012
New Revision: 1357351

URL: http://svn.apache.org/viewvc?rev=1357351&view=rev
Log:
HADOOP-8487 Many HDFS tests use a test path intended for local file system tests (Ivan Mitic
via Sanjay Radia)

Modified:
    hadoop/common/branches/branch-1-win/CHANGES.txt
    hadoop/common/branches/branch-1-win/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/ClusterWithCapacityScheduler.java
    hadoop/common/branches/branch-1-win/src/contrib/test/mapred-site.xml
    hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/fs/FileSystemTestHelper.java
    hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/fs/TestFSMainOperationsLocalFileSystem.java
    hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/server/namenode/TestBBWBlockReport.java
    hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java
    hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/web/TestFSMainOperationsWebHdfs.java
    hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestJobInProgress.java
    hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestJobQueueInformation.java
    hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestSubmitJob.java

Modified: hadoop/common/branches/branch-1-win/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/CHANGES.txt?rev=1357351&r1=1357350&r2=1357351&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1-win/CHANGES.txt Wed Jul  4 17:56:51 2012
@@ -48,6 +48,8 @@ branch-hadoop-1-win - unreleased
 
     HADOOP-8534 Some tests leave a config file open causing failure on windows   (Ivan Mitic
via Sanjay Radia)
 
+    HADOOP-8487 Many HDFS tests use a test path intended for local file system tests (Ivan
Mitic via Sanjay Radia)
+
 Release 1.1.0 - unreleased
 
   NEW FEATURES

Modified: hadoop/common/branches/branch-1-win/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/ClusterWithCapacityScheduler.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/ClusterWithCapacityScheduler.java?rev=1357351&r1=1357350&r2=1357351&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/ClusterWithCapacityScheduler.java
(original)
+++ hadoop/common/branches/branch-1-win/src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/ClusterWithCapacityScheduler.java
Wed Jul  4 17:56:51 2012
@@ -222,7 +222,7 @@ public class ClusterWithCapacitySchedule
         // Check the resourcePath directory
         File file = new File(resourcePath, name);
         if (file.exists()) {
-          return new URL("file://" + file.getAbsolutePath());
+          return new URL("file", null, file.getAbsolutePath());
         }
       } catch (MalformedURLException mue) {
         LOG.warn("exception : " + mue);

Modified: hadoop/common/branches/branch-1-win/src/contrib/test/mapred-site.xml
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/contrib/test/mapred-site.xml?rev=1357351&r1=1357350&r2=1357351&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/contrib/test/mapred-site.xml (original)
+++ hadoop/common/branches/branch-1-win/src/contrib/test/mapred-site.xml Wed Jul  4 17:56:51
2012
@@ -10,4 +10,9 @@
   <value>build/contrib/${contrib.name}/test/system</value>
 </property>
 
+<property>
+  <name>mapreduce.jobtracker.staging.root.dir</name>
+  <value>build/contrib/${contrib.name}/test/staging</value>
+</property>
+
 </configuration>

Modified: hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/fs/FileSystemTestHelper.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/fs/FileSystemTestHelper.java?rev=1357351&r1=1357350&r2=1357351&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/fs/FileSystemTestHelper.java
(original)
+++ hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/fs/FileSystemTestHelper.java
Wed Jul  4 17:56:51 2012
@@ -31,7 +31,7 @@ import org.junit.Assert;
  */
 public final class FileSystemTestHelper {
   // The test root is relative to the <wd>/build/test/data by default
-  public static final String TEST_ROOT_DIR = 
+  public static String TEST_ROOT_DIR = 
     System.getProperty("test.build.data", "build/test/data") + "/test";
   private static final int DEFAULT_BLOCK_SIZE = 1024;
   private static final int DEFAULT_NUM_BLOCKS = 2;
@@ -67,7 +67,7 @@ public final class FileSystemTestHelper 
   public static String getAbsoluteTestRootDir(FileSystem fSys)
       throws IOException {
     if (absTestRootDir == null) {
-      if (TEST_ROOT_DIR.startsWith("/")) {
+      if (new Path(TEST_ROOT_DIR).isAbsolute()) {
         absTestRootDir = TEST_ROOT_DIR;
       } else {
         absTestRootDir = fSys.getWorkingDirectory().toString() + "/"

Modified: hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/fs/TestFSMainOperationsLocalFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/fs/TestFSMainOperationsLocalFileSystem.java?rev=1357351&r1=1357350&r2=1357351&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/fs/TestFSMainOperationsLocalFileSystem.java
(original)
+++ hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/fs/TestFSMainOperationsLocalFileSystem.java
Wed Jul  4 17:56:51 2012
@@ -21,6 +21,7 @@ package org.apache.hadoop.fs;
 import java.io.IOException;
 
 import org.apache.hadoop.conf.Configuration;
+import org.junit.After;
 import org.junit.Before;
 
 public class TestFSMainOperationsLocalFileSystem extends
@@ -32,6 +33,11 @@ public class TestFSMainOperationsLocalFi
     super.setUp();
   }
   
+  @After
+  public void tearDown() throws Exception {
+    super.tearDown();
+  }
+
   static Path wd = null;
   protected Path getDefaultWorkingDirectory() throws IOException {
     if (wd == null)

Modified: hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/server/namenode/TestBBWBlockReport.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/server/namenode/TestBBWBlockReport.java?rev=1357351&r1=1357350&r2=1357351&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/server/namenode/TestBBWBlockReport.java
(original)
+++ hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/server/namenode/TestBBWBlockReport.java
Wed Jul  4 17:56:51 2012
@@ -33,9 +33,8 @@ import org.junit.Before;
 import org.junit.Test;
 
 public class TestBBWBlockReport {
-
-  private final Path src = new Path(System.getProperty("test.build.data",
-      "/tmp"), "testfile");
+  private final Path src =
+    new Path("/tmp/TestBBWBlockReport", "testfile");
 
   private Configuration conf = null;
 

Modified: hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java?rev=1357351&r1=1357350&r2=1357351&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java
(original)
+++ hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java
Wed Jul  4 17:56:51 2012
@@ -44,8 +44,8 @@ import static org.apache.hadoop.test.Met
 public class TestNameNodeMetrics extends TestCase {
   private static final Configuration CONF = new Configuration();
   private static final int DFS_REPLICATION_INTERVAL = 1;
-  private static final Path TEST_ROOT_DIR_PATH = 
-    new Path(System.getProperty("test.build.data", "build/test/data"));
+  private static final Path TEST_ROOT_DIR_PATH =
+    new Path("/tmp/TestNameNodeMetrics");
   
   // Number of datanodes in the cluster
   private static final int DATANODE_COUNT = 3; 

Modified: hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/web/TestFSMainOperationsWebHdfs.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/web/TestFSMainOperationsWebHdfs.java?rev=1357351&r1=1357350&r2=1357351&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/web/TestFSMainOperationsWebHdfs.java
(original)
+++ hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/hdfs/web/TestFSMainOperationsWebHdfs.java
Wed Jul  4 17:56:51 2012
@@ -29,6 +29,7 @@ import org.apache.commons.logging.impl.L
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FSMainOperationsBaseTest;
 import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.FileSystemTestHelper;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.hdfs.DFSConfigKeys;
@@ -54,6 +55,10 @@ public class TestFSMainOperationsWebHdfs
 
   @BeforeClass
   public static void setupCluster() {
+    // Initialize the test root directory to a DFS like path
+    // since we are testing based on the MiniDFSCluster.
+    FileSystemTestHelper.TEST_ROOT_DIR = "/tmp/TestFSMainOperationsWebHdfs";
+
     final Configuration conf = new Configuration();
     conf.setBoolean(DFSConfigKeys.DFS_WEBHDFS_ENABLED_KEY, true);
     try {

Modified: hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestJobInProgress.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestJobInProgress.java?rev=1357351&r1=1357350&r2=1357351&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestJobInProgress.java
(original)
+++ hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestJobInProgress.java
Wed Jul  4 17:56:51 2012
@@ -31,8 +31,8 @@ public class TestJobInProgress extends T
 
   private MiniDFSCluster dfsCluster;
   JobTracker jt;
-  private static Path TEST_DIR = 
-    new Path(System.getProperty("test.build.data","/tmp"), "jip-testing");
+  private static Path TEST_DIR =
+    new Path("/tmp/TestJobInProgress", "jip-testing");
   private static int numSlaves = 4;
 
   public static class FailMapTaskJob extends MapReduceBase implements

Modified: hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestJobQueueInformation.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestJobQueueInformation.java?rev=1357351&r1=1357350&r2=1357351&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestJobQueueInformation.java
(original)
+++ hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestJobQueueInformation.java
Wed Jul  4 17:56:51 2012
@@ -46,8 +46,7 @@ public class TestJobQueueInformation ext
   private JobConf jc;
   private static final String JOB_SCHEDULING_INFO = "TESTSCHEDULINGINFO";
   private static final Path TEST_DIR = 
-    new Path(System.getProperty("test.build.data","/tmp"), 
-             "job-queue-info-testing");
+    new Path("/tmp/TestJobQueueInformation", "job-queue-info-testing");
   private static final Path IN_DIR = new Path(TEST_DIR, "input");
   private static final Path SHARE_DIR = new Path(TEST_DIR, "share");
   private static final Path OUTPUT_DIR = new Path(TEST_DIR, "output");

Modified: hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestSubmitJob.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestSubmitJob.java?rev=1357351&r1=1357350&r2=1357351&view=diff
==============================================================================
--- hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestSubmitJob.java
(original)
+++ hadoop/common/branches/branch-1-win/src/test/org/apache/hadoop/mapred/TestSubmitJob.java
Wed Jul  4 17:56:51 2012
@@ -47,8 +47,7 @@ public class TestSubmitJob extends TestC
   private JobTracker jt;
   private FileSystem fs;
   private static Path TEST_DIR =
-    new Path(System.getProperty("test.build.data","/tmp"),
-             "job-submission-testing");
+    new Path("/tmp/TestSubmitJob", "job-submission-testing");
   private static int numSlaves = 1;
 
   private void startCluster() throws Exception {



Mime
View raw message