MAPREDUCE-6645. TestWordStats outputs logs under directories other than target/test-dir. Contributed by Gabor Liptak.
This commit is contained in:
parent
02a250db9f
commit
80fa70c4e1
@ -31,15 +31,18 @@
|
|||||||
import org.apache.hadoop.fs.FileSystem;
|
import org.apache.hadoop.fs.FileSystem;
|
||||||
import org.apache.hadoop.fs.Path;
|
import org.apache.hadoop.fs.Path;
|
||||||
import org.apache.hadoop.util.ToolRunner;
|
import org.apache.hadoop.util.ToolRunner;
|
||||||
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class TestWordStats {
|
public class TestWordStats {
|
||||||
|
|
||||||
private final static String INPUT = "src/test/java/org/apache/hadoop/examples/pi/math";
|
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 BASEDIR = System.getProperty("test.build.data",
|
||||||
private final static String MEDIAN_OUTPUT = "build/data/median_output";
|
"target/test-dir");
|
||||||
private final static String STDDEV_OUTPUT = "build/data/stddev_output";
|
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
|
* Modified internal test class that is designed to read all the files in the
|
||||||
@ -286,4 +289,10 @@ public static boolean deleteDir(File dir) {
|
|||||||
assertEquals(stddev, wr.read(INPUT), 0.0);
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user