HADOOP-7357. hadoop.io.compress.TestCodec#main() should exit with non-zero exit code if test failed. Contributed by Philip Zeyliger

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1156839 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eli Collins 2011-08-11 21:30:59 +00:00
parent ba0b61cf39
commit 7528853197
2 changed files with 15 additions and 17 deletions

View File

@ -481,6 +481,9 @@ Trunk (unreleased changes)
HADOOP-7512. Fix example mistake in WritableComparable javadocs.
(Harsh J via eli)
HADOOP-7357. hadoop.io.compress.TestCodec#main() should exit with
non-zero exit code if test failed. (Philip Zeyliger via eli)
Release 0.22.0 - Unreleased
INCOMPATIBLE CHANGES

View File

@ -501,7 +501,7 @@ private static void sequenceFileCodecTest(Configuration conf, int lines,
LOG.info("SUCCESS! Completed SequenceFileCodecTest with codec \"" + codecClass + "\"");
}
public static void main(String[] args) {
public static void main(String[] args) throws IOException {
int count = 10000;
String codecClass = "org.apache.hadoop.io.compress.DefaultCodec";
@ -511,25 +511,20 @@ public static void main(String[] args) {
System.exit(-1);
}
try {
for (int i=0; i < args.length; ++i) { // parse command line
if (args[i] == null) {
continue;
} else if (args[i].equals("-count")) {
count = Integer.parseInt(args[++i]);
} else if (args[i].equals("-codec")) {
codecClass = args[++i];
}
for (int i=0; i < args.length; ++i) { // parse command line
if (args[i] == null) {
continue;
} else if (args[i].equals("-count")) {
count = Integer.parseInt(args[++i]);
} else if (args[i].equals("-codec")) {
codecClass = args[++i];
}
Configuration conf = new Configuration();
int seed = 0;
codecTest(conf, seed, count, codecClass);
} catch (Exception e) {
System.err.println("Caught: " + e);
e.printStackTrace();
}
Configuration conf = new Configuration();
int seed = 0;
// Note that exceptions will propagate out.
codecTest(conf, seed, count, codecClass);
}
@Test