hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vino...@apache.org
Subject svn commit: r1389528 - in /hadoop/common/branches/branch-1: CHANGES.txt src/test/org/apache/hadoop/mapred/TestJobHistoryServer.java src/test/org/apache/hadoop/mapred/TestRawHistoryFile.java
Date Mon, 24 Sep 2012 19:37:05 GMT
Author: vinodkv
Date: Mon Sep 24 19:37:05 2012
New Revision: 1389528

URL: http://svn.apache.org/viewvc?rev=1389528&view=rev
Log:
MAPREDUCE-4673. Fix TestRawHistoryFile and TestJobHistoryServer to not write to /tmp. Contributed
by Arpit Gupta.

Modified:
    hadoop/common/branches/branch-1/CHANGES.txt
    hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestJobHistoryServer.java
    hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestRawHistoryFile.java

Modified: hadoop/common/branches/branch-1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/CHANGES.txt?rev=1389528&r1=1389527&r2=1389528&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1/CHANGES.txt Mon Sep 24 19:37:05 2012
@@ -579,6 +579,9 @@ Release 1.1.0 - unreleased
     HDFS-3966. TestFileCreation should use JUnit4 to make assumeTrue work.
     (Jing Zhao via suresh)
 
+    MAPREDUCE-4673. Fix TestRawHistoryFile and TestJobHistoryServer to not write
+    to /tmp. (Arpit Gupta via vinodkv)
+
 Release 1.0.4 - Unreleased
 
   NEW FEATURES

Modified: hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestJobHistoryServer.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestJobHistoryServer.java?rev=1389528&r1=1389527&r2=1389528&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestJobHistoryServer.java
(original)
+++ hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestJobHistoryServer.java
Mon Sep 24 19:37:05 2012
@@ -23,7 +23,6 @@ import org.apache.commons.logging.LogFac
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.fs.Path;
@@ -34,14 +33,13 @@ import org.junit.Assert;
 import junit.framework.TestCase;
 
 import java.io.IOException;
-import java.io.InputStream;
 import java.net.HttpURLConnection;
-import java.net.URL;
-import java.net.MalformedURLException;
 
 public class TestJobHistoryServer extends TestCase {
   private static final Log LOG = LogFactory.getLog(TestJobHistoryServer.class);
-
+  private String inputPath = System.getProperty("test.build.data",
+      "build/test/data") + "/TestJobHistoryServer";
+  
   public void testHistoryServerEmbedded() {
 
     MiniMRCluster mrCluster = null;
@@ -61,7 +59,7 @@ public class TestJobHistoryServer extend
       LOG.info("******** History Address: " + historyAddress);
 
       conf = mrCluster.createJobConf();
-      createInputFile(conf, "/tmp/input");
+      createInputFile(conf, inputPath);
 
       RunningJob job = runJob(conf);
       LOG.info("Job details: " + job);
@@ -100,7 +98,7 @@ public class TestJobHistoryServer extend
       LOG.info("******** History Address: " + historyAddress);
 
       conf = mrCluster.createJobConf();
-      createInputFile(conf, "/tmp/input");
+      createInputFile(conf, inputPath);
 
       RunningJob job = runJob(conf);
       LOG.info("Job details: " + job);
@@ -145,7 +143,7 @@ public class TestJobHistoryServer extend
     conf.setMapperClass(org.apache.hadoop.mapred.lib.IdentityMapper.class);
     conf.setReducerClass(org.apache.hadoop.mapred.lib.IdentityReducer.class);
 
-    FileInputFormat.setInputPaths(conf, "/tmp/input");
+    FileInputFormat.setInputPaths(conf, inputPath);
 
     return JobClient.runJob(conf);
   }

Modified: hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestRawHistoryFile.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestRawHistoryFile.java?rev=1389528&r1=1389527&r2=1389528&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestRawHistoryFile.java
(original)
+++ hadoop/common/branches/branch-1/src/test/org/apache/hadoop/mapred/TestRawHistoryFile.java
Mon Sep 24 19:37:05 2012
@@ -35,14 +35,15 @@ import org.junit.Assert;
 import java.io.IOException;
 import java.io.File;
 import java.io.FileOutputStream;
-import java.io.InputStream;
 import java.net.HttpURLConnection;
 
 import junit.framework.TestCase;
 
 public class TestRawHistoryFile extends TestCase {
   private static final Log LOG = LogFactory.getLog(TestRawHistoryFile.class);
-
+  private String inputPath = System.getProperty("test.build.data",
+      "build/test/data") + "/TestRawHistoryFile";
+  
   public void testRetrieveHistoryFile() {
 
     MiniMRCluster mrCluster = null;
@@ -58,7 +59,7 @@ public class TestRawHistoryFile extends 
           null, null, conf);
 
       conf = mrCluster.createJobConf();
-      createInputFile(conf, "/tmp/input");
+      createInputFile(conf, inputPath);
 
       RunningJob job = runJob(conf);
       LOG.info("Job details: " + job);
@@ -98,7 +99,7 @@ public class TestRawHistoryFile extends 
           null, null, conf);
 
       conf = mrCluster.createJobConf();
-      createInputFile(conf, "/tmp/input");
+      createInputFile(conf, inputPath);
 
       RunningJob job = submitJob(conf);
       LOG.info("Job details: " + job);
@@ -190,7 +191,7 @@ public class TestRawHistoryFile extends 
     conf.setMapperClass(org.apache.hadoop.mapred.lib.IdentityMapper.class);
     conf.setReducerClass(org.apache.hadoop.mapred.lib.IdentityReducer.class);
 
-    FileInputFormat.setInputPaths(conf, "/tmp/input");
+    FileInputFormat.setInputPaths(conf, inputPath);
   }
 
   private String saveHistoryFile(String url) throws IOException {



Mime
View raw message