Author: suresh
Date: Tue Jan 12 22:54:52 2010
New Revision: 898564
URL: http://svn.apache.org/viewvc?rev=898564&view=rev
Log:
HDFS-587. Add support for specifying queue name in mapreduce tests. Contributed
by Erik Steffl.
Modified:
hadoop/hdfs/trunk/CHANGES.txt
hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/fs/loadGenerator/TestLoadGenerator.java
Modified: hadoop/hdfs/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=898564&r1=898563&r2=898564&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Tue Jan 12 22:54:52 2010
@@ -36,6 +36,9 @@
HDFS-786. Implement getContentSummary in HftpFileSystem.
(Tsz Wo (Nicholas), SZE via cdouglas)
+ HDFS-587. Add support for specifying queue name in mapreduce tests.
+ (Erik Steffl via suresh)
+
OPTIMIZATIONS
BUG FIXES
Modified:
hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/fs/loadGenerator/TestLoadGenerator.java
URL:
http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/fs/loadGenerator/TestLoadGenerator.java?rev=898564&r1=898563&r2=898564&view=diff
==============================================================================
---
hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/fs/loadGenerator/TestLoadGenerator.java
(original)
+++
hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/fs/loadGenerator/TestLoadGenerator.java
Tue Jan 12 22:54:52 2010
@@ -23,15 +23,20 @@
import java.io.FileWriter;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.hdfs.DFSConfigKeys;
import org.apache.hadoop.hdfs.HdfsConfiguration;
import org.apache.hadoop.hdfs.MiniDFSCluster;
-import junit.framework.TestCase;
+import static org.junit.Assert.*;
+
+import org.apache.hadoop.util.Tool;
+import org.apache.hadoop.util.ToolRunner;
+import org.junit.Test;
/**
* This class tests if a balancer schedules tasks correctly.
*/
-public class TestLoadGenerator extends TestCase {
+public class TestLoadGenerator extends Configured implements Tool {
private static final Configuration CONF = new HdfsConfiguration();
private static final int DEFAULT_BLOCK_SIZE = 10;
private static final String OUT_DIR =
@@ -55,6 +60,7 @@
}
/** Test if the structure generator works fine */
+ @Test
public void testStructureGenerator() throws Exception {
StructureGenerator sg = new StructureGenerator();
String[] args = new String[]{"-maxDepth", "2", "-minWidth", "1",
@@ -123,6 +129,7 @@
}
/** Test if the load generator works fine */
+ @Test
public void testLoadGenerator() throws Exception {
final String TEST_SPACE_ROOT = "/test";
@@ -247,8 +254,15 @@
* @param args
*/
public static void main(String[] args) throws Exception {
+ int res = ToolRunner.run(new TestLoadGenerator(), args);
+ System.exit(res);
+ }
+
+ @Override
+ public int run(String[] args) throws Exception {
TestLoadGenerator loadGeneratorTest = new TestLoadGenerator();
loadGeneratorTest.testStructureGenerator();
loadGeneratorTest.testLoadGenerator();
+ return 0;
}
}