hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1165449 - in /hadoop/common/trunk/hadoop-mapreduce-project: ./ src/test/mapred/org/apache/hadoop/mapred/ src/test/mapred/org/apache/hadoop/mapreduce/lib/input/
Date Mon, 05 Sep 2011 23:23:35 GMT
Author: todd
Date: Mon Sep  5 23:23:35 2011
New Revision: 1165449

URL: http://svn.apache.org/viewvc?rev=1165449&view=rev
Log:
MAPREDUCE-2882. TestLineRecordReader depends on ant jars. Contributed by Todd Lipcon.

Modified:
    hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
    hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapred/TestLineRecordReader.java
    hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapred/UtilsForTests.java
    hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestLineRecordReader.java

Modified: hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt?rev=1165449&r1=1165448&r2=1165449&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt Mon Sep  5 23:23:35 2011
@@ -1202,6 +1202,8 @@ Release 0.23.0 - Unreleased
    MAPREDUCE-2716. MRReliabilityTest job fails because of missing
    job-file. (Jeffrey Naisbitt via vinodkv)
 
+   MAPREDUCE-2882. TestLineRecordReader depends on ant jars. (todd)
+
 Release 0.22.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapred/TestLineRecordReader.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapred/TestLineRecordReader.java?rev=1165449&r1=1165448&r2=1165449&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapred/TestLineRecordReader.java
(original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapred/TestLineRecordReader.java
Mon Sep  5 23:23:35 2011
@@ -18,9 +18,7 @@
 package org.apache.hadoop.mapred;
 
 import java.io.IOException;
-import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
-import java.io.Reader;
 import java.io.Writer;
 
 import junit.framework.TestCase;
@@ -32,7 +30,6 @@ import org.apache.hadoop.mapred.Mapper;
 import org.apache.hadoop.mapred.Reducer;
 import org.apache.hadoop.mapred.lib.IdentityMapper;
 import org.apache.hadoop.mapred.lib.IdentityReducer;
-import org.apache.tools.ant.util.FileUtils;
 import org.junit.Test;
 
 public class TestLineRecordReader extends TestCase {
@@ -66,10 +63,7 @@ public class TestLineRecordReader extend
   public String readOutputFile(Configuration conf) throws IOException {
     FileSystem localFs = FileSystem.getLocal(conf);
     Path file = new Path(outputDir, "part-00000");
-    Reader reader = new InputStreamReader(localFs.open(file));
-    String r = FileUtils.readFully(reader);
-    reader.close();
-    return r;
+    return UtilsForTests.slurpHadoop(file, localFs);
   }
 
   /**

Modified: hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapred/UtilsForTests.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapred/UtilsForTests.java?rev=1165449&r1=1165448&r2=1165449&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapred/UtilsForTests.java
(original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapred/UtilsForTests.java
Mon Sep  5 23:23:35 2011
@@ -172,7 +172,7 @@ public class UtilsForTests {
     return contents;
   }
 
-  static String slurpHadoop(Path p, FileSystem fs) throws IOException {
+  public static String slurpHadoop(Path p, FileSystem fs) throws IOException {
     int len = (int) fs.getFileStatus(p).getLen();
     byte[] buf = new byte[len];
     InputStream in = fs.open(p);

Modified: hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestLineRecordReader.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestLineRecordReader.java?rev=1165449&r1=1165448&r2=1165449&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestLineRecordReader.java
(original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapreduce/lib/input/TestLineRecordReader.java
Mon Sep  5 23:23:35 2011
@@ -19,9 +19,7 @@
 package org.apache.hadoop.mapreduce.lib.input;
 
 import java.io.IOException;
-import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
-import java.io.Reader;
 import java.io.Writer;
 
 import junit.framework.TestCase;
@@ -29,11 +27,11 @@ import junit.framework.TestCase;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.UtilsForTests;
 import org.apache.hadoop.mapreduce.Job;
 import org.apache.hadoop.mapreduce.Mapper;
 import org.apache.hadoop.mapreduce.Reducer;
 import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
-import org.apache.tools.ant.util.FileUtils;
 import org.junit.Test;
 
 public class TestLineRecordReader extends TestCase {
@@ -67,10 +65,7 @@ public class TestLineRecordReader extend
   public String readOutputFile(Configuration conf) throws IOException {
     FileSystem localFs = FileSystem.getLocal(conf);
     Path file = new Path(outputDir, "part-r-00000");
-    Reader reader = new InputStreamReader(localFs.open(file));
-    String r = FileUtils.readFully(reader);
-    reader.close();
-    return r;
+    return UtilsForTests.slurpHadoop(file, localFs);
   }
 
   /**



Mime
View raw message