hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wan...@apache.org
Subject [31/50] [abbrv] hadoop git commit: MAPREDUCE-6645. TestWordStats outputs logs under directories other than target/test-dir. Contributed by Gabor Liptak.
Date Mon, 21 Mar 2016 20:14:44 GMT
MAPREDUCE-6645. TestWordStats outputs logs under directories other than target/test-dir. Contributed
by Gabor Liptak.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/80fa70c4
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/80fa70c4
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/80fa70c4

Branch: refs/heads/YARN-3368
Commit: 80fa70c4e15f16b411cb3691df546499c6a19d4c
Parents: 02a250d
Author: Akira Ajisaka <aajisaka@apache.org>
Authored: Thu Mar 17 18:08:31 2016 +0900
Committer: Akira Ajisaka <aajisaka@apache.org>
Committed: Thu Mar 17 18:08:31 2016 +0900

----------------------------------------------------------------------
 .../org/apache/hadoop/examples/TestWordStats.java    | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/80fa70c4/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/test/java/org/apache/hadoop/examples/TestWordStats.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/test/java/org/apache/hadoop/examples/TestWordStats.java
b/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/test/java/org/apache/hadoop/examples/TestWordStats.java
index 56b358e..3f0ffd6 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/test/java/org/apache/hadoop/examples/TestWordStats.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/test/java/org/apache/hadoop/examples/TestWordStats.java
@@ -31,15 +31,18 @@ import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.util.ToolRunner;
+import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.Test;
 
 public class TestWordStats {
 
   private final static String INPUT = "src/test/java/org/apache/hadoop/examples/pi/math";
-  private final static String MEAN_OUTPUT = "build/data/mean_output";
-  private final static String MEDIAN_OUTPUT = "build/data/median_output";
-  private final static String STDDEV_OUTPUT = "build/data/stddev_output";
+  private final static String BASEDIR = System.getProperty("test.build.data",
+                                                           "target/test-dir");
+  private final static String MEAN_OUTPUT = BASEDIR + "/mean_output";
+  private final static String MEDIAN_OUTPUT = BASEDIR + "/median_output";
+  private final static String STDDEV_OUTPUT = BASEDIR + "/stddev_output";
 
   /**
    * Modified internal test class that is designed to read all the files in the
@@ -286,4 +289,10 @@ public class TestWordStats {
     assertEquals(stddev, wr.read(INPUT), 0.0);
   }
 
+  @AfterClass public static void cleanup() throws Exception {
+    deleteDir(new File(MEAN_OUTPUT));
+    deleteDir(new File(MEDIAN_OUTPUT));
+    deleteDir(new File(STDDEV_OUTPUT));
+  }
+
 }


Mime
View raw message