hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aajis...@apache.org
Subject [3/3] hadoop git commit: MAPREDUCE-6543. Migrate MR client test cases part 2. Contributed by Dustin Cote.
Date Tue, 29 Mar 2016 09:24:50 GMT
MAPREDUCE-6543. Migrate MR client test cases part 2. Contributed by Dustin Cote.


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

Branch: refs/heads/trunk
Commit: 0050fa5f1c20087009bd76a0bb2183a479f787f0
Parents: 8018280
Author: Akira Ajisaka <aajisaka@apache.org>
Authored: Tue Mar 29 18:17:52 2016 +0900
Committer: Akira Ajisaka <aajisaka@apache.org>
Committed: Tue Mar 29 18:17:52 2016 +0900

----------------------------------------------------------------------
 .../java/org/apache/hadoop/fs/DFSCIOTest.java   |  8 +--
 .../org/apache/hadoop/fs/TestFileSystem.java    | 20 ++++++--
 .../java/org/apache/hadoop/fs/TestJHLA.java     |  6 +--
 .../io/TestSequenceFileMergeProgress.java       | 12 +++--
 .../hadoop/mapred/ClusterMapReduceTestCase.java | 14 +++---
 .../apache/hadoop/mapred/TestAuditLogger.java   |  9 ++--
 .../apache/hadoop/mapred/TestBadRecords.java    |  8 ++-
 .../mapred/TestClusterMapReduceTestCase.java    | 10 ++++
 .../org/apache/hadoop/mapred/TestCollect.java   | 10 ++--
 .../mapred/TestCommandLineJobSubmission.java    |  9 ++--
 .../hadoop/mapred/TestFieldSelection.java       |  6 ++-
 .../mapred/TestFileInputFormatPathFilter.java   | 19 ++++---
 .../apache/hadoop/mapred/TestGetSplitHosts.java |  7 +--
 .../apache/hadoop/mapred/TestIFileStreams.java  | 13 ++---
 .../org/apache/hadoop/mapred/TestInputPath.java |  7 +--
 .../hadoop/mapred/TestJavaSerialization.java    | 10 ++--
 .../org/apache/hadoop/mapred/TestJobName.java   |  6 +++
 .../hadoop/mapred/TestJobSysDirWithDFS.java     | 10 ++--
 .../mapred/TestKeyValueTextInputFormat.java     | 15 +++---
 .../apache/hadoop/mapred/TestLazyOutput.java    |  7 +--
 .../hadoop/mapred/TestMRCJCFileInputFormat.java | 32 +++++++-----
 .../mapred/TestMRCJCFileOutputCommitter.java    | 28 +++++++----
 .../apache/hadoop/mapred/TestMapProgress.java   |  9 ++--
 .../org/apache/hadoop/mapred/TestMerge.java     |  7 +--
 .../apache/hadoop/mapred/TestMiniMRBringup.java |  6 ++-
 .../hadoop/mapred/TestMiniMRDFSCaching.java     | 14 +++---
 .../hadoop/mapred/TestMultiFileInputFormat.java | 19 +++----
 .../hadoop/mapred/TestMultiFileSplit.java       | 10 ++--
 .../hadoop/mapred/TestMultipleLevelCaching.java | 12 +++--
 .../mapred/TestMultipleTextOutputFormat.java    | 23 ++++-----
 .../apache/hadoop/mapred/TestReduceFetch.java   | 10 ++--
 .../mapred/TestReduceFetchFromPartialMem.java   | 46 +++++++----------
 .../apache/hadoop/mapred/TestReduceTask.java    | 18 ++++---
 .../TestSequenceFileAsBinaryInputFormat.java    | 19 ++++---
 .../TestSequenceFileAsBinaryOutputFormat.java   | 31 ++++++++----
 .../TestSequenceFileAsTextInputFormat.java      | 33 +++++++------
 .../mapred/TestSequenceFileInputFilter.java     | 32 ++++++------
 .../mapred/TestSequenceFileInputFormat.java     | 29 ++++++-----
 .../apache/hadoop/mapred/TestSortedRanges.java  | 19 ++++---
 .../TestSpecialCharactersInOutputPath.java      | 21 ++++----
 .../hadoop/mapred/TestStatisticsCollector.java  | 10 ++--
 .../hadoop/mapred/TestUserDefinedCounters.java  | 24 ++++-----
 .../hadoop/mapred/TestWritableJobConf.java      | 20 +++++---
 .../apache/hadoop/mapred/TestYARNRunner.java    |  8 +--
 .../hadoop/mapred/join/TestDatamerge.java       | 42 +++++++++-------
 .../hadoop/mapred/join/TestTupleWritable.java   | 24 ++++++---
 .../TestWrappedRecordReaderClassloader.java     |  7 +--
 .../mapred/lib/TestDelegatingInputFormat.java   |  9 ++--
 .../hadoop/mapred/lib/TestLineInputFormat.java  |  7 +--
 .../hadoop/mapred/lib/TestMultipleInputs.java   |  2 -
 .../mapred/lib/aggregate/TestAggregates.java    |  7 +--
 .../mapred/lib/db/TestConstructQuery.java       | 16 +++---
 .../apache/hadoop/mapred/pipes/TestPipes.java   |  9 ++--
 .../hadoop/mapreduce/TestLocalRunner.java       | 34 +++++++------
 .../hadoop/mapreduce/TestMRJobClient.java       | 49 +++++++++---------
 .../mapreduce/TestMapReduceLazyOutput.java      |  9 ++--
 .../hadoop/mapreduce/TestValueIterReset.java    |  8 +--
 .../TestYarnClientProtocolProvider.java         |  5 +-
 .../lib/aggregate/TestMapReduceAggregates.java  | 23 ++++-----
 .../mapreduce/lib/db/TestDBOutputFormat.java    | 17 ++++---
 .../mapreduce/lib/db/TestIntegerSplitter.java   | 15 ++++--
 .../mapreduce/lib/db/TestTextSplitter.java      | 18 +++++--
 .../lib/fieldsel/TestMRFieldSelection.java      | 20 ++++----
 .../TestMRSequenceFileAsBinaryInputFormat.java  | 21 +++++---
 .../TestMRSequenceFileAsTextInputFormat.java    | 27 +++++-----
 .../input/TestMRSequenceFileInputFilter.java    | 39 ++++++++-------
 .../lib/input/TestNLineInputFormat.java         | 34 ++++++++-----
 .../mapreduce/lib/join/TestJoinDatamerge.java   | 52 +++++++++++---------
 .../mapreduce/lib/join/TestJoinProperties.java  | 44 +++++++++--------
 .../lib/join/TestJoinTupleWritable.java         | 24 ++++++---
 .../lib/join/TestWrappedRRClassloader.java      | 17 +++++--
 .../TestMRSequenceFileAsBinaryOutputFormat.java | 35 ++++++++-----
 .../lib/partition/TestBinaryPartitioner.java    | 16 ++++--
 .../lib/partition/TestKeyFieldHelper.java       |  9 +++-
 .../TestMRKeyFieldBasedPartitioner.java         |  6 ++-
 .../partition/TestTotalOrderPartitioner.java    | 11 +++--
 .../mapreduce/util/TestMRAsyncDiskService.java  | 15 ++++--
 .../mapreduce/v2/TestMiniMRProxyUser.java       | 30 ++++++-----
 .../hadoop/mapreduce/v2/TestNonExistentJob.java | 18 ++++---
 .../streaming/TestStreamingBadRecords.java      |  9 +++-
 80 files changed, 841 insertions(+), 573 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/DFSCIOTest.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/DFSCIOTest.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/DFSCIOTest.java
index 1caa2cd..12bec08 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/DFSCIOTest.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/DFSCIOTest.java
@@ -28,8 +28,6 @@ import java.io.PrintStream;
 import java.util.Date;
 import java.util.StringTokenizer;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
@@ -39,8 +37,9 @@ import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.SequenceFile.CompressionType;
 import org.apache.hadoop.mapred.*;
 import org.junit.Ignore;
+import org.junit.Test;
 
-/**
+ /**
  * Distributed i/o benchmark.
  * <p>
  * This test writes into or reads from a specified number of files.
@@ -68,7 +67,7 @@ import org.junit.Ignore;
  * </ul>
  */
 @Ignore
-public class DFSCIOTest extends TestCase {
+public class DFSCIOTest {
   // Constants
   private static final Log LOG = LogFactory.getLog(DFSCIOTest.class);
   private static final int TEST_TYPE_READ = 0;
@@ -98,6 +97,7 @@ public class DFSCIOTest extends TestCase {
    * 
    * @throws Exception
    */
+  @Test
   public void testIOs() throws Exception {
     testIOs(10, 10);
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestFileSystem.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestFileSystem.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestFileSystem.java
index 4146b13..f0300b3 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestFileSystem.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestFileSystem.java
@@ -34,8 +34,6 @@ import java.util.HashMap;
 import java.net.InetSocketAddress;
 import java.net.URI;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.logging.Log;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.conf.Configured;
@@ -50,8 +48,15 @@ import org.apache.hadoop.mapred.*;
 import org.apache.hadoop.mapred.lib.LongSumReducer;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.util.StringUtils;
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
+
 
-public class TestFileSystem extends TestCase {
+public class TestFileSystem {
   private static final Log LOG = FileSystem.LOG;
 
   private static Configuration conf = new Configuration();
@@ -66,6 +71,7 @@ public class TestFileSystem extends TestCase {
   private static Path READ_DIR = new Path(ROOT, "fs_read");
   private static Path DATA_DIR = new Path(ROOT, "fs_data");
 
+  @Test
   public void testFs() throws Exception {
     testFs(10 * MEGA, 100, 0);
   }
@@ -90,7 +96,8 @@ public class TestFileSystem extends TestCase {
     fs.delete(READ_DIR, true);
   }
 
-  public static void testCommandFormat() throws Exception {
+  @Test
+  public void testCommandFormat() throws Exception {
     // This should go to TestFsShell.java when it is added.
     CommandFormat cf;
     cf= new CommandFormat("copyToLocal", 2,2,"crc","ignoreCrc");
@@ -488,6 +495,7 @@ public class TestFileSystem extends TestCase {
     }
   }
 
+  @Test
   public void testFsCache() throws Exception {
     {
       long now = System.currentTimeMillis();
@@ -561,6 +569,7 @@ public class TestFileSystem extends TestCase {
         + StringUtils.toUpperCase(add.getHostName()) + ":" + add.getPort()));
   }
 
+  @Test
   public void testFsClose() throws Exception {
     {
       Configuration conf = new Configuration();
@@ -569,6 +578,7 @@ public class TestFileSystem extends TestCase {
     }
   }
 
+  @Test
   public void testFsShutdownHook() throws Exception {
     final Set<FileSystem> closed = Collections.synchronizedSet(new HashSet<FileSystem>());
     Configuration conf = new Configuration();
@@ -600,7 +610,7 @@ public class TestFileSystem extends TestCase {
     assertTrue(closed.contains(fsWithoutAuto));
   }
 
-
+  @Test
   public void testCacheKeysAreCaseInsensitive()
     throws Exception
   {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestJHLA.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestJHLA.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestJHLA.java
index f2bc4ed..31950fd 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestJHLA.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestJHLA.java
@@ -23,19 +23,18 @@ import java.io.FileOutputStream;
 import java.io.OutputStreamWriter;
 import java.io.File;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Test;
 
 /**
  * Test Job History Log Analyzer.
  *
  * @see JHLogAnalyzer
  */
-public class TestJHLA extends TestCase {
+public class TestJHLA {
   private static final Log LOG = LogFactory.getLog(JHLogAnalyzer.class);
   private String historyLog = System.getProperty("test.build.data", 
                                   "build/test/data") + "/history/test.log";
@@ -133,6 +132,7 @@ public class TestJHLA extends TestCase {
   /**
    * Run log analyzer in test mode for file test.log.
    */
+  @Test
   public void testJHLA() {
     String[] args = {"-test", historyLog, "-jobDelimiter", ".!!FILE=.*!!"};
     JHLogAnalyzer.main(args);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/io/TestSequenceFileMergeProgress.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/io/TestSequenceFileMergeProgress.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/io/TestSequenceFileMergeProgress.java
index 1d7b98a..97dfa26 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/io/TestSequenceFileMergeProgress.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/io/TestSequenceFileMergeProgress.java
@@ -32,21 +32,25 @@ import org.apache.hadoop.io.compress.CompressionCodec;
 import org.apache.hadoop.io.compress.DefaultCodec;
 import org.apache.hadoop.mapred.*;
 
-import junit.framework.TestCase;
 import org.apache.commons.logging.*;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
 
-public class TestSequenceFileMergeProgress extends TestCase {
+public class TestSequenceFileMergeProgress {
   private static final Log LOG = FileInputFormat.LOG;
   private static final int RECORDS = 10000;
-  
+
+  @Test
   public void testMergeProgressWithNoCompression() throws IOException {
     runTest(SequenceFile.CompressionType.NONE);
   }
 
+  @Test
   public void testMergeProgressWithRecordCompression() throws IOException {
     runTest(SequenceFile.CompressionType.RECORD);
   }
 
+  @Test
   public void testMergeProgressWithBlockCompression() throws IOException {
     runTest(SequenceFile.CompressionType.BLOCK);
   }
@@ -92,7 +96,7 @@ public class TestSequenceFileMergeProgress extends TestCase {
       count++;
     }
     assertEquals(RECORDS, count);
-    assertEquals(1.0f, rIter.getProgress().get());
+    assertEquals(1.0f, rIter.getProgress().get(), 0.0000);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/ClusterMapReduceTestCase.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/ClusterMapReduceTestCase.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/ClusterMapReduceTestCase.java
index 5bf4ff1..8d33b15 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/ClusterMapReduceTestCase.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/ClusterMapReduceTestCase.java
@@ -17,10 +17,11 @@
  */
 package org.apache.hadoop.mapred;
 
-import junit.framework.TestCase;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.junit.After;
+import org.junit.Before;
 
 import java.io.IOException;
 import java.util.Map;
@@ -41,7 +42,7 @@ import java.util.Properties;
  * <p/>
  * The DFS filesystem is formated before the testcase starts and after it ends.
  */
-public abstract class ClusterMapReduceTestCase extends TestCase {
+public abstract class ClusterMapReduceTestCase {
   private MiniDFSCluster dfsCluster = null;
   private MiniMRCluster mrCluster = null;
 
@@ -50,9 +51,8 @@ public abstract class ClusterMapReduceTestCase extends TestCase {
    *
    * @throws Exception
    */
-  protected void setUp() throws Exception {
-    super.setUp();
-
+  @Before
+  public void setUp() throws Exception {
     startCluster(true, null);
   }
 
@@ -139,9 +139,9 @@ public abstract class ClusterMapReduceTestCase extends TestCase {
    *
    * @throws Exception
    */
-  protected void tearDown() throws Exception {
+  @After
+  public void tearDown() throws Exception {
     stopCluster();
-    super.tearDown();
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestAuditLogger.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestAuditLogger.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestAuditLogger.java
index 353185b..bc85703 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestAuditLogger.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestAuditLogger.java
@@ -28,13 +28,13 @@ import org.apache.hadoop.ipc.TestRPC.TestImpl;
 import org.apache.hadoop.ipc.TestRPC.TestProtocol;
 import org.apache.hadoop.mapred.AuditLogger.Keys;
 import org.apache.hadoop.net.NetUtils;
-
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
 
 /**
  * Tests {@link AuditLogger}.
  */
-public class TestAuditLogger extends TestCase {
+public class TestAuditLogger {
   private static final String USER = "test";
   private static final String OPERATION = "oper";
   private static final String TARGET = "tgt";
@@ -44,6 +44,7 @@ public class TestAuditLogger extends TestCase {
   /**
    * Test the AuditLog format with key-val pair.
    */
+  @Test
   public void testKeyValLogFormat() {
     StringBuilder actLog = new StringBuilder();
     StringBuilder expLog = new StringBuilder();
@@ -114,6 +115,7 @@ public class TestAuditLogger extends TestCase {
   /**
    * Test {@link AuditLogger} without IP set.
    */
+  @Test
   public void testAuditLoggerWithoutIP() throws Exception {
     // test without ip
     testSuccessLogFormat(false);
@@ -137,6 +139,7 @@ public class TestAuditLogger extends TestCase {
   /**
    * Test {@link AuditLogger} with IP set.
    */
+  @Test
   public void testAuditLoggerWithIP() throws Exception {
     Configuration conf = new Configuration();
     // start the IPC server

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestBadRecords.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestBadRecords.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestBadRecords.java
index ea9f3d3..c2d6257 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestBadRecords.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestBadRecords.java
@@ -40,6 +40,11 @@ import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapreduce.TaskCounter;
 import org.apache.hadoop.util.ReflectionUtils;
 import org.junit.Ignore;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
 @Ignore
 public class TestBadRecords extends ClusterMapReduceTestCase {
   
@@ -206,7 +211,8 @@ public class TestBadRecords extends ClusterMapReduceTestCase {
     }
     return processed;
   }
-  
+
+  @Test
   public void testBadMapRed() throws Exception {
     JobConf conf = createJobConf();
     conf.setMapperClass(BadMapper.class);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java
index ada2d0c..f04fbd7 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java
@@ -29,6 +29,12 @@ import org.apache.hadoop.fs.FileUtil;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.Text;
+import org.junit.Test;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertFalse;
 public class TestClusterMapReduceTestCase extends ClusterMapReduceTestCase {
   public void _testMapReduce(boolean restart) throws Exception {
     OutputStream os = getFileSystem().create(new Path(getInputDir(), "text.txt"));
@@ -85,14 +91,17 @@ public class TestClusterMapReduceTestCase extends ClusterMapReduceTestCase {
 
   }
 
+  @Test
   public void testMapReduce() throws Exception {
     _testMapReduce(false);
   }
 
+  @Test
   public void testMapReduceRestarting() throws Exception {
     _testMapReduce(true);
   }
 
+  @Test
   public void testDFSRestart() throws Exception {
     Path file = new Path(getInputDir(), "text.txt");
     OutputStream os = getFileSystem().create(file);
@@ -109,6 +118,7 @@ public class TestClusterMapReduceTestCase extends ClusterMapReduceTestCase {
     
   }
 
+  @Test
   public void testMRConfig() throws Exception {
     JobConf conf = createJobConf();
     assertNull(conf.get("xyz"));

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCollect.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCollect.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCollect.java
index 4bd20d5..595d09c 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCollect.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCollect.java
@@ -21,15 +21,15 @@ import org.apache.hadoop.fs.*;
 import org.apache.hadoop.io.*;
 import org.apache.hadoop.mapred.UtilsForTests.RandomInputFormat;
 import org.apache.hadoop.mapreduce.MRConfig;
+import org.junit.Test;
 
-import junit.framework.TestCase;
 import java.io.*;
 import java.util.*;
 
 /** 
  * TestCollect checks if the collect can handle simultaneous invocations.
  */
-public class TestCollect extends TestCase 
+public class TestCollect
 {
   final static Path OUTPUT_DIR = new Path("build/test/test.collect.output");
   static final int NUM_FEEDERS = 10;
@@ -127,7 +127,7 @@ public class TestCollect extends TestCase
     conf.setNumMapTasks(1);
     conf.setNumReduceTasks(1);
   }
-  
+  @Test
   public void testCollect() throws IOException {
     JobConf conf = new JobConf();
     configure(conf);
@@ -144,9 +144,5 @@ public class TestCollect extends TestCase
       fs.delete(OUTPUT_DIR, true);
     }
   }
-  
-  public static void main(String[] args) throws IOException {
-    new TestCollect().testCollect();
-  }
 }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCommandLineJobSubmission.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCommandLineJobSubmission.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCommandLineJobSubmission.java
index 6935387..7cf5e71 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCommandLineJobSubmission.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestCommandLineJobSubmission.java
@@ -21,28 +21,29 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 
-import junit.framework.TestCase;
-
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.*;
 import org.apache.hadoop.util.StringUtils;
 import org.apache.hadoop.util.ToolRunner;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.junit.Ignore;
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
 
 /**
  * check for the job submission  options of 
  * -libjars -files -archives
  */
 @Ignore
-public class TestCommandLineJobSubmission extends TestCase {
-  // Input output paths for this.. 
+public class TestCommandLineJobSubmission {
+  // Input output paths for this..
   // these are all dummy and does not test
   // much in map reduce except for the command line
   // params 
   static final Path input = new Path("/test/input/");
   static final Path output = new Path("/test/output");
   File buildDir = new File(System.getProperty("test.build.data", "/tmp"));
+  @Test
   public void testJobShell() throws Exception {
     MiniDFSCluster dfs = null;
     MiniMRCluster mr = null;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFieldSelection.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFieldSelection.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFieldSelection.java
index 29333b7b..8688968 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFieldSelection.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFieldSelection.java
@@ -23,11 +23,12 @@ import org.apache.hadoop.mapred.lib.*;
 import org.apache.hadoop.mapreduce.MapReduceTestUtil;
 import org.apache.hadoop.mapreduce.lib.fieldsel.FieldSelectionHelper;
 import org.apache.hadoop.mapreduce.lib.fieldsel.TestMRFieldSelection;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
 
-import junit.framework.TestCase;
 import java.text.NumberFormat;
 
-public class TestFieldSelection extends TestCase {
+public class TestFieldSelection {
 
 private static NumberFormat idFormat = NumberFormat.getInstance();
   static {
@@ -35,6 +36,7 @@ private static NumberFormat idFormat = NumberFormat.getInstance();
     idFormat.setGroupingUsed(false);
   }
 
+  @Test
   public void testFieldSelection() throws Exception {
     launch();
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFileInputFormatPathFilter.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFileInputFormatPathFilter.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFileInputFormatPathFilter.java
index 1c8be66..d87f6fd 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFileInputFormatPathFilter.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestFileInputFormatPathFilter.java
@@ -17,12 +17,14 @@
  */
 package org.apache.hadoop.mapred;
 
-import junit.framework.TestCase;
-
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.PathFilter;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
 import java.io.Writer;
@@ -30,7 +32,7 @@ import java.io.OutputStreamWriter;
 import java.util.Set;
 import java.util.HashSet;
 
-public class TestFileInputFormatPathFilter extends TestCase {
+public class TestFileInputFormatPathFilter {
 
   public static class DummyFileInputFormat extends FileInputFormat {
 
@@ -55,12 +57,12 @@ public class TestFileInputFormatPathFilter extends TestCase {
       new Path(new Path(System.getProperty("test.build.data", "."), "data"),
           "TestFileInputFormatPathFilter");
 
-
+  @Before
   public void setUp() throws Exception {
     tearDown();
     localFs.mkdirs(workDir);
   }
-
+  @After
   public void tearDown() throws Exception {
     if (localFs.exists(workDir)) {
       localFs.delete(workDir, true);
@@ -129,18 +131,19 @@ public class TestFileInputFormatPathFilter extends TestCase {
     assertEquals(createdFiles, computedFiles);
   }
 
+  @Test
   public void testWithoutPathFilterWithoutGlob() throws Exception {
     _testInputFiles(false, false);
   }
-
+  @Test
   public void testWithoutPathFilterWithGlob() throws Exception {
     _testInputFiles(false, true);
   }
-
+  @Test
   public void testWithPathFilterWithoutGlob() throws Exception {
     _testInputFiles(true, false);
   }
-
+  @Test
   public void testWithPathFilterWithGlob() throws Exception {
     _testInputFiles(true, true);
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestGetSplitHosts.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestGetSplitHosts.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestGetSplitHosts.java
index 7891bca..3d1c2e7 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestGetSplitHosts.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestGetSplitHosts.java
@@ -20,10 +20,11 @@ package org.apache.hadoop.mapred;
 import org.apache.hadoop.fs.BlockLocation;
 import org.apache.hadoop.net.NetworkTopology;
 
-import junit.framework.TestCase;
-
-public class TestGetSplitHosts extends TestCase {
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
 
+public class TestGetSplitHosts {
+  @Test
   public void testGetSplitHosts() throws Exception {
 
     int numBlocks = 3;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestIFileStreams.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestIFileStreams.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestIFileStreams.java
index 86431e5..2b97d3b 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestIFileStreams.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestIFileStreams.java
@@ -21,11 +21,12 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.ChecksumException;
 import org.apache.hadoop.io.DataInputBuffer;
 import org.apache.hadoop.io.DataOutputBuffer;
+import org.junit.Test;
+import static org.junit.Assert.fail;
+import static org.junit.Assert.assertEquals;
 
-import junit.framework.TestCase;
-
-public class TestIFileStreams extends TestCase {
-
+public class TestIFileStreams {
+  @Test
   public void testIFileStream() throws Exception {
     final int DLEN = 100;
     DataOutputBuffer dob = new DataOutputBuffer(DLEN + 4);
@@ -42,7 +43,7 @@ public class TestIFileStreams extends TestCase {
     }
     ifis.close();
   }
-
+  @Test
   public void testBadIFileStream() throws Exception {
     final int DLEN = 100;
     DataOutputBuffer dob = new DataOutputBuffer(DLEN + 4);
@@ -73,7 +74,7 @@ public class TestIFileStreams extends TestCase {
     }
     fail("Did not detect bad data in checksum");
   }
-
+  @Test
   public void testBadLength() throws Exception {
     final int DLEN = 100;
     DataOutputBuffer dob = new DataOutputBuffer(DLEN + 4);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestInputPath.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestInputPath.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestInputPath.java
index 1398f9e..0c20c33 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestInputPath.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestInputPath.java
@@ -17,14 +17,15 @@
  */
 package org.apache.hadoop.mapred;
 
-import junit.framework.TestCase;
-
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.mapred.FileInputFormat;
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.hadoop.util.StringUtils;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
 
-public class TestInputPath extends TestCase {
+public class TestInputPath {
+  @Test
   public void testInputPath() throws Exception {
     JobConf jobConf = new JobConf();
     Path workingDir = jobConf.getWorkingDirectory();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJavaSerialization.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJavaSerialization.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJavaSerialization.java
index 265118a..a787e68 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJavaSerialization.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJavaSerialization.java
@@ -26,8 +26,6 @@ import java.io.Writer;
 import java.util.Iterator;
 import java.util.StringTokenizer;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.io.FileUtils;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.FileUtil;
@@ -36,8 +34,11 @@ import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.serializer.JavaSerializationComparator;
 import org.apache.hadoop.mapreduce.MRConfig;
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
 
-public class TestJavaSerialization extends TestCase {
+public class TestJavaSerialization {
 
   private static String TEST_ROOT_DIR =
     new File(System.getProperty("test.build.data", "/tmp")).toURI()
@@ -90,7 +91,7 @@ public class TestJavaSerialization extends TestCase {
     wr.write("b a\n");
     wr.close();
   }
-  
+  @Test
   public void testMapReduceJob() throws Exception {
 
     JobConf conf = new JobConf(TestJavaSerialization.class);
@@ -149,6 +150,7 @@ public class TestJavaSerialization extends TestCase {
    * coupled to Writable types, if so, the job will fail.
    *
    */
+  @Test
   public void testWriteToSequencefile() throws Exception {
     JobConf conf = new JobConf(TestJavaSerialization.class);
     conf.setJobName("JavaSerialization");

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobName.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobName.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobName.java
index 4b62b4a..2659a14 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobName.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobName.java
@@ -29,8 +29,13 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapred.lib.IdentityMapper;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
 public class TestJobName extends ClusterMapReduceTestCase {
 
+  @Test
   public void testComplexName() throws Exception {
     OutputStream os = getFileSystem().create(new Path(getInputDir(),
         "text.txt"));
@@ -65,6 +70,7 @@ public class TestJobName extends ClusterMapReduceTestCase {
     reader.close();
   }
 
+  @Test
   public void testComplexNameWithRegex() throws Exception {
     OutputStream os = getFileSystem().create(new Path(getInputDir(),
         "text.txt"));

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobSysDirWithDFS.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobSysDirWithDFS.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobSysDirWithDFS.java
index 109c781..3dbc577 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobSysDirWithDFS.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestJobSysDirWithDFS.java
@@ -21,8 +21,6 @@ package org.apache.hadoop.mapred;
 import java.io.DataOutputStream;
 import java.io.IOException;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
@@ -32,11 +30,15 @@ import org.apache.hadoop.io.IntWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapreduce.MapReduceTestUtil;
 import org.apache.hadoop.mapreduce.server.jobtracker.JTConfig;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
 
 /**
  * A JUnit test to test Job System Directory with Mini-DFS.
  */
-public class TestJobSysDirWithDFS extends TestCase {
+public class TestJobSysDirWithDFS {
   private static final Log LOG =
     LogFactory.getLog(TestJobSysDirWithDFS.class.getName());
   
@@ -115,7 +117,7 @@ public class TestJobSysDirWithDFS extends TestCase {
     //  between Job Client & Job Tracker
     assertTrue(result.job.isSuccessful());
   }
-
+  @Test
   public void testWithDFS() throws IOException {
     MiniDFSCluster dfs = null;
     MiniMRCluster mr = null;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestKeyValueTextInputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestKeyValueTextInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestKeyValueTextInputFormat.java
index 2707078..bacc196 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestKeyValueTextInputFormat.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestKeyValueTextInputFormat.java
@@ -20,7 +20,6 @@ package org.apache.hadoop.mapred;
 
 import java.io.*;
 import java.util.*;
-import junit.framework.TestCase;
 
 import org.apache.commons.logging.*;
 import org.apache.hadoop.fs.*;
@@ -28,8 +27,11 @@ import org.apache.hadoop.io.*;
 import org.apache.hadoop.io.compress.*;
 import org.apache.hadoop.util.LineReader;
 import org.apache.hadoop.util.ReflectionUtils;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 
-public class TestKeyValueTextInputFormat extends TestCase {
+public class TestKeyValueTextInputFormat {
   private static final Log LOG =
     LogFactory.getLog(TestKeyValueTextInputFormat.class.getName());
 
@@ -47,7 +49,7 @@ public class TestKeyValueTextInputFormat extends TestCase {
   private static Path workDir = 
     new Path(new Path(System.getProperty("test.build.data", "."), "data"),
              "TestKeyValueTextInputFormat");
-  
+  @Test
   public void testFormat() throws Exception {
     JobConf job = new JobConf();
     Path file = new Path(workDir, "test.txt");
@@ -134,7 +136,7 @@ public class TestKeyValueTextInputFormat extends TestCase {
                                            (str.getBytes("UTF-8")), 
                                            defaultConf);
   }
-  
+  @Test
   public void testUTF8() throws Exception {
     LineReader in = null;
 
@@ -153,7 +155,7 @@ public class TestKeyValueTextInputFormat extends TestCase {
       }
     }
   }
-
+  @Test
   public void testNewLines() throws Exception {
     LineReader in = null;
     try {
@@ -219,7 +221,8 @@ public class TestKeyValueTextInputFormat extends TestCase {
   /**
    * Test using the gzip codec for reading
    */
-  public static void testGzip() throws IOException {
+  @Test
+  public void testGzip() throws IOException {
     JobConf job = new JobConf();
     CompressionCodec gzip = new GzipCodec();
     ReflectionUtils.setConf(gzip, job);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestLazyOutput.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestLazyOutput.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestLazyOutput.java
index 7412832..dde9310 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestLazyOutput.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestLazyOutput.java
@@ -35,14 +35,15 @@ import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.mapred.lib.LazyOutputFormat;
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
 
 /**
  * A JUnit test to test the Map-Reduce framework's feature to create part
  * files only if there is an explicit output.collect. This helps in preventing
  * 0 byte files
  */
-public class TestLazyOutput extends TestCase {
+public class TestLazyOutput {
   private static final int NUM_HADOOP_SLAVES = 3;
   private static final int NUM_MAPS_PER_NODE = 2;
   private static final Path INPUT = new Path("/testlazy/input");
@@ -132,7 +133,7 @@ public class TestLazyOutput extends TestCase {
     }
   }
 
-
+  @Test
   public void testLazyOutput() throws Exception {
     MiniDFSCluster dfs = null;
     MiniMRCluster mr = null;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRCJCFileInputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRCJCFileInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRCJCFileInputFormat.java
index fb9e8fc..20d0173 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRCJCFileInputFormat.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRCJCFileInputFormat.java
@@ -17,16 +17,6 @@
  */
 package org.apache.hadoop.mapred;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.concurrent.TimeoutException;
-
-import junit.framework.TestCase;
-
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.BlockLocation;
 import org.apache.hadoop.fs.FSDataOutputStream;
@@ -36,9 +26,21 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hdfs.DFSTestUtil;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.hadoop.io.Text;
+import org.junit.After;
+import org.junit.Test;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.util.concurrent.TimeoutException;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
 
 @SuppressWarnings("deprecation")
-public class TestMRCJCFileInputFormat extends TestCase {
+public class TestMRCJCFileInputFormat {
 
   Configuration conf = new Configuration();
   MiniDFSCluster dfs = null;
@@ -50,6 +52,7 @@ public class TestMRCJCFileInputFormat extends TestCase {
         .build();
   }
 
+  @Test
   public void testLocality() throws Exception {
     JobConf job = new JobConf(conf);
     dfs = newDFSCluster(job);
@@ -109,6 +112,7 @@ public class TestMRCJCFileInputFormat extends TestCase {
     DFSTestUtil.waitReplication(fs, path, replication);
   }
 
+  @Test
   public void testNumInputs() throws Exception {
     JobConf job = new JobConf(conf);
     dfs = newDFSCluster(job);
@@ -157,6 +161,7 @@ public class TestMRCJCFileInputFormat extends TestCase {
     }
   }
 
+  @Test
   public void testMultiLevelInput() throws Exception {
     JobConf job = new JobConf(conf);
 
@@ -195,6 +200,7 @@ public class TestMRCJCFileInputFormat extends TestCase {
   }
 
   @SuppressWarnings("rawtypes")
+  @Test
   public void testLastInputSplitAtSplitBoundary() throws Exception {
     FileInputFormat fif = new FileInputFormatForTest(1024l * 1024 * 1024,
         128l * 1024 * 1024);
@@ -208,6 +214,7 @@ public class TestMRCJCFileInputFormat extends TestCase {
   }
 
   @SuppressWarnings("rawtypes")
+  @Test
   public void testLastInputSplitExceedingSplitBoundary() throws Exception {
     FileInputFormat fif = new FileInputFormatForTest(1027l * 1024 * 1024,
         128l * 1024 * 1024);
@@ -221,6 +228,7 @@ public class TestMRCJCFileInputFormat extends TestCase {
   }
 
   @SuppressWarnings("rawtypes")
+  @Test
   public void testLastInputSplitSingleSplit() throws Exception {
     FileInputFormat fif = new FileInputFormatForTest(100l * 1024 * 1024,
         128l * 1024 * 1024);
@@ -305,7 +313,7 @@ public class TestMRCJCFileInputFormat extends TestCase {
     DFSTestUtil.waitReplication(fileSys, name, replication);
   }
 
-  @Override
+  @After
   public void tearDown() throws Exception {
     if (dfs != null) {
       dfs.shutdown();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRCJCFileOutputCommitter.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRCJCFileOutputCommitter.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRCJCFileOutputCommitter.java
index 3b86f81..74b6d77 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRCJCFileOutputCommitter.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRCJCFileOutputCommitter.java
@@ -18,18 +18,25 @@
 
 package org.apache.hadoop.mapred;
 
-import java.io.*;
-import java.net.URI;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.FileUtil;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.RawLocalFileSystem;
+import org.apache.hadoop.io.NullWritable;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapreduce.JobStatus;
+import org.junit.Test;
 
-import junit.framework.TestCase;
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
 
-import org.apache.hadoop.fs.*;
-import org.apache.hadoop.io.*;
-import org.apache.hadoop.mapred.JobContextImpl;
-import org.apache.hadoop.mapred.TaskAttemptContextImpl;
-import org.apache.hadoop.mapreduce.JobStatus;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
-public class TestMRCJCFileOutputCommitter extends TestCase {
+public class TestMRCJCFileOutputCommitter {
   private static Path outDir = new Path(
      System.getProperty("test.build.data", "/tmp"), "output");
 
@@ -67,6 +74,7 @@ public class TestMRCJCFileOutputCommitter extends TestCase {
   }
 
   @SuppressWarnings("unchecked")
+  @Test
   public void testCommitter() throws Exception {
     JobConf job = new JobConf();
     setConfForFileOutputCommitter(job);
@@ -108,6 +116,7 @@ public class TestMRCJCFileOutputCommitter extends TestCase {
     FileUtil.fullyDelete(new File(outDir.toString()));
   }
 
+  @Test
   public void testAbort() throws IOException {
     JobConf job = new JobConf();
     setConfForFileOutputCommitter(job);
@@ -161,6 +170,7 @@ public class TestMRCJCFileOutputCommitter extends TestCase {
     }
   }
 
+  @Test
   public void testFailAbort() throws IOException {
     JobConf job = new JobConf();
     job.set(FileSystem.FS_DEFAULT_NAME_KEY, "faildel:///");

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMapProgress.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMapProgress.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMapProgress.java
index db6348b..b8ff016 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMapProgress.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMapProgress.java
@@ -22,8 +22,6 @@ import java.io.File;
 import java.io.IOException;
 import java.util.List;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.fs.FileSystem;
@@ -40,6 +38,8 @@ import org.apache.hadoop.mapreduce.split.JobSplit.TaskSplitMetaInfo;
 import org.apache.hadoop.mapreduce.split.JobSplitWriter;
 import org.apache.hadoop.mapreduce.split.SplitMetaInfoReader;
 import org.apache.hadoop.util.ReflectionUtils;
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
 
 /**
  *  Validates map phase progress.
@@ -55,7 +55,7 @@ import org.apache.hadoop.util.ReflectionUtils;
  *  once mapTask.run() is finished. Sort phase progress in map task is not
  *  validated here.
  */
-public class TestMapProgress extends TestCase {
+public class TestMapProgress {
   public static final Log LOG = LogFactory.getLog(TestMapProgress.class);
   private static String TEST_ROOT_DIR;
   static {
@@ -234,7 +234,8 @@ public class TestMapProgress extends TestCase {
   /**
    *  Validates map phase progress after each record is processed by map task
    *  using custom task reporter.
-   */ 
+   */
+  @Test
   public void testMapProgress() throws Exception {
     JobConf job = new JobConf();
     fs = FileSystem.getLocal(job);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMerge.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMerge.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMerge.java
index e19ff58..a9e7f64 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMerge.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMerge.java
@@ -44,8 +44,8 @@ import org.apache.hadoop.io.serializer.SerializationFactory;
 import org.apache.hadoop.io.serializer.Serializer;
 
 import org.apache.hadoop.mapred.Task.TaskReporter;
-
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
 
 @SuppressWarnings(value={"unchecked", "deprecation"})
 /**
@@ -56,7 +56,7 @@ import junit.framework.TestCase;
  * framework's merge on the reduce side will merge the partitions created to
  * generate the final output which is sorted on the key.
  */
-public class TestMerge extends TestCase {
+public class TestMerge {
   private static final int NUM_HADOOP_DATA_NODES = 2;
   // Number of input files is same as the number of mappers.
   private static final int NUM_MAPPERS = 10;
@@ -69,6 +69,7 @@ public class TestMerge extends TestCase {
   // Where output goes.
   private static final Path OUTPUT = new Path("/testplugin/output");
 
+  @Test
   public void testMerge() throws Exception {
     MiniDFSCluster dfsCluster = null;
     MiniMRClientCluster mrCluster = null;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRBringup.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRBringup.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRBringup.java
index 8b7b8f5..b608d75 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRBringup.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRBringup.java
@@ -18,14 +18,16 @@
 
 package org.apache.hadoop.mapred;
 
+import org.junit.Test;
+
 import java.io.IOException;
-import junit.framework.TestCase;
 
 /**
  * A Unit-test to test bringup and shutdown of Mini Map-Reduce Cluster.
  */
-public class TestMiniMRBringup extends TestCase {
+public class TestMiniMRBringup {
 
+  @Test
   public void testBringUp() throws IOException {
     MiniMRCluster mr = null;
     try {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRDFSCaching.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRDFSCaching.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRDFSCaching.java
index 45879af..3f64f7a 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRDFSCaching.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMiniMRDFSCaching.java
@@ -18,20 +18,23 @@
 
 package org.apache.hadoop.mapred;
 
-import java.io.*;
-import junit.framework.TestCase;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.mapred.MRCaching.TestResult;
 import org.junit.Ignore;
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
 
 /**
  * A JUnit test to test caching with DFS
  * 
  */
 @Ignore
-public class TestMiniMRDFSCaching extends TestCase {
+public class TestMiniMRDFSCaching {
 
+  @Test
   public void testWithDFS() throws IOException {
     MiniMRCluster mr = null;
     MiniDFSCluster dfs = null;
@@ -70,9 +73,4 @@ public class TestMiniMRDFSCaching extends TestCase {
       }
     }
   }
-
-  public static void main(String[] argv) throws Exception {
-    TestMiniMRDFSCaching td = new TestMiniMRDFSCaching();
-    td.testWithDFS();
-  }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultiFileInputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultiFileInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultiFileInputFormat.java
index 49825e9..1bd2954 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultiFileInputFormat.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultiFileInputFormat.java
@@ -21,17 +21,17 @@ import java.io.IOException;
 import java.util.BitSet;
 import java.util.HashMap;
 import java.util.Random;
-
-import junit.framework.TestCase;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 
-public class TestMultiFileInputFormat extends TestCase{
+public class TestMultiFileInputFormat {
 
   private static JobConf job = new JobConf();
 
@@ -79,7 +79,8 @@ public class TestMultiFileInputFormat extends TestCase{
     FileInputFormat.setInputPaths(job, multiFileDir);
     return multiFileDir;
   }
-  
+
+  @Test
   public void testFormat() throws IOException {
     LOG.info("Test started");
     LOG.info("Max split count           = " + MAX_SPLIT_COUNT);
@@ -122,7 +123,8 @@ public class TestMultiFileInputFormat extends TestCase{
     }
     LOG.info("Test Finished");
   }
-  
+
+  @Test
   public void testFormatWithLessPathsThanSplits() throws Exception {
     MultiFileInputFormat<Text,Text> format = new DummyMultiFileInputFormat();
     FileSystem fs = FileSystem.getLocal(job);     
@@ -135,9 +137,4 @@ public class TestMultiFileInputFormat extends TestCase{
     initFiles(fs, 2, 500);
     assertEquals(2, format.getSplits(job, 4).length);
   }
-  
-  public static void main(String[] args) throws Exception{
-    TestMultiFileInputFormat test = new TestMultiFileInputFormat();
-    test.testFormat();
-  }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultiFileSplit.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultiFileSplit.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultiFileSplit.java
index 16ff6af..5bb336e 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultiFileSplit.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultiFileSplit.java
@@ -27,16 +27,19 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.util.Arrays;
 
-import junit.framework.TestCase;
-
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.IOUtils;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 /**
  * 
  * test MultiFileSplit class
  */
-public class TestMultiFileSplit extends TestCase{
+public class TestMultiFileSplit {
 
+    @Test
     public void testReadWrite() throws Exception {
       MultiFileSplit split = new MultiFileSplit(new JobConf(), new Path[] {new Path("/test/path/1"), new Path("/test/path/2")}, new long[] {100,200});
         
@@ -70,6 +73,7 @@ public class TestMultiFileSplit extends TestCase{
      * test method getLocations
      * @throws IOException
      */
+    @Test
     public void testgetLocations() throws IOException{
         JobConf job= new JobConf();
       

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultipleLevelCaching.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultipleLevelCaching.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultipleLevelCaching.java
index 294723a..7e8dfef 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultipleLevelCaching.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultipleLevelCaching.java
@@ -17,10 +17,6 @@
  */
 package org.apache.hadoop.mapred;
 
-import java.io.IOException;
-
-import junit.framework.TestCase;
-
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -32,12 +28,17 @@ import org.apache.hadoop.mapred.lib.IdentityReducer;
 import org.apache.hadoop.mapreduce.JobCounter;
 import org.apache.hadoop.mapreduce.server.jobtracker.JTConfig;
 import org.junit.Ignore;
+import org.junit.Test;
+
+import java.io.IOException;
+
+import static org.junit.Assert.assertEquals;
 
 /**
  * This test checks whether the task caches are created and used properly.
  */
 @Ignore
-public class TestMultipleLevelCaching extends TestCase {
+public class TestMultipleLevelCaching {
   private static final int MAX_LEVEL = 5;
   final Path inDir = new Path("/cachetesting");
   final Path outputPath = new Path("/output");
@@ -71,6 +72,7 @@ public class TestMultipleLevelCaching extends TestCase {
     return rack.toString();
   }
 
+  @Test
   public void testMultiLevelCaching() throws Exception {
     for (int i = 1 ; i <= MAX_LEVEL; ++i) {
       testCachingAtLevel(i);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultipleTextOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultipleTextOutputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultipleTextOutputFormat.java
index 14c097d..b5047fc 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultipleTextOutputFormat.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMultipleTextOutputFormat.java
@@ -18,15 +18,19 @@
 
 package org.apache.hadoop.mapred;
 
-import java.io.*;
-import junit.framework.TestCase;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapred.lib.MultipleTextOutputFormat;
+import org.junit.Test;
 
-import org.apache.hadoop.fs.*;
-import org.apache.hadoop.io.*;
+import java.io.File;
+import java.io.IOException;
 
-import org.apache.hadoop.mapred.lib.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
-public class TestMultipleTextOutputFormat extends TestCase {
+public class TestMultipleTextOutputFormat {
   private static JobConf defaultConf = new JobConf();
 
   private static FileSystem localFs = null;
@@ -83,7 +87,8 @@ public class TestMultipleTextOutputFormat extends TestCase {
     writeData(rw);
     rw.close(null);
   }
-  
+
+  @Test
   public void testFormat() throws Exception {
     JobConf job = new JobConf();
     job.set(JobContext.TASK_ATTEMPT_ID, attempt);
@@ -145,8 +150,4 @@ public class TestMultipleTextOutputFormat extends TestCase {
     //System.out.printf("File_2 output: %s\n", output);
     assertEquals(output, expectedOutput.toString());
   }
-
-  public static void main(String[] args) throws Exception {
-    new TestMultipleTextOutputFormat().testFormat();
-  }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestReduceFetch.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestReduceFetch.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestReduceFetch.java
index 586df38..767459f 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestReduceFetch.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestReduceFetch.java
@@ -19,17 +19,18 @@
 package org.apache.hadoop.mapred;
 
 import org.apache.hadoop.mapreduce.TaskCounter;
+import org.junit.Test;
 
-public class TestReduceFetch extends TestReduceFetchFromPartialMem {
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
-  static {
-    setSuite(TestReduceFetch.class);
-  }
+public class TestReduceFetch extends TestReduceFetchFromPartialMem {
 
   /**
    * Verify that all segments are read from disk
    * @throws Exception might be thrown
    */
+  @Test
   public void testReduceFromDisk() throws Exception {
     final int MAP_TASKS = 8;
     JobConf job = mrCluster.createJobConf();
@@ -53,6 +54,7 @@ public class TestReduceFetch extends TestReduceFetchFromPartialMem {
    * Verify that no segment hits disk.
    * @throws Exception might be thrown
    */
+  @Test
   public void testReduceFromMem() throws Exception {
     final int MAP_TASKS = 3;
     JobConf job = mrCluster.createJobConf();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestReduceFetchFromPartialMem.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestReduceFetchFromPartialMem.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestReduceFetchFromPartialMem.java
index 3a1a275..9b04f64 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestReduceFetchFromPartialMem.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestReduceFetchFromPartialMem.java
@@ -18,10 +18,6 @@
 
 package org.apache.hadoop.mapred;
 
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -30,7 +26,9 @@ import org.apache.hadoop.io.NullWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.WritableComparator;
 import org.apache.hadoop.mapreduce.TaskCounter;
-import org.apache.hadoop.mapreduce.MRConfig;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
 
 import java.io.DataInput;
 import java.io.DataOutput;
@@ -39,34 +37,27 @@ import java.util.Arrays;
 import java.util.Formatter;
 import java.util.Iterator;
 
-public class TestReduceFetchFromPartialMem extends TestCase {
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+public class TestReduceFetchFromPartialMem {
 
   protected static MiniMRCluster mrCluster = null;
   protected static MiniDFSCluster dfsCluster = null;
-  protected static TestSuite mySuite;
 
-  protected static void setSuite(Class<? extends TestCase> klass) {
-    mySuite  = new TestSuite(klass);
+  @Before
+  public void setUp() throws Exception {
+    Configuration conf = new Configuration();
+    dfsCluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
+    mrCluster = new MiniMRCluster(2,
+      dfsCluster.getFileSystem().getUri().toString(), 1);
   }
 
-  static {
-    setSuite(TestReduceFetchFromPartialMem.class);
-  }
-  
-  public static Test suite() {
-    TestSetup setup = new TestSetup(mySuite) {
-      protected void setUp() throws Exception {
-        Configuration conf = new Configuration();
-        dfsCluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
-        mrCluster = new MiniMRCluster(2,
-            dfsCluster.getFileSystem().getUri().toString(), 1);
-      }
-      protected void tearDown() throws Exception {
-        if (dfsCluster != null) { dfsCluster.shutdown(); }
-        if (mrCluster != null) { mrCluster.shutdown(); }
-      }
-    };
-    return setup;
+  @After
+  public void tearDown() throws Exception {
+    if (dfsCluster != null) { dfsCluster.shutdown(); }
+    if (mrCluster != null) { mrCluster.shutdown(); }
   }
 
   private static final String tagfmt = "%04d";
@@ -78,6 +69,7 @@ public class TestReduceFetchFromPartialMem extends TestCase {
   }
 
   /** Verify that at least one segment does not hit disk */
+  @Test
   public void testReduceFromPartialMem() throws Exception {
     final int MAP_TASKS = 7;
     JobConf job = mrCluster.createJobConf();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestReduceTask.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestReduceTask.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestReduceTask.java
index 43fd948..69546a6 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestReduceTask.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestReduceTask.java
@@ -17,10 +17,6 @@
  */
 package org.apache.hadoop.mapred;
 
-import java.io.IOException;
-
-import junit.framework.TestCase;
-
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.LocalFileSystem;
@@ -30,11 +26,17 @@ import org.apache.hadoop.io.WritableComparator;
 import org.apache.hadoop.io.compress.CompressionCodec;
 import org.apache.hadoop.io.compress.DefaultCodec;
 import org.apache.hadoop.util.Progressable;
+import org.junit.Test;
+
+import java.io.IOException;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 /**
  * This test exercises the ValueIterator.
  */
-public class TestReduceTask extends TestCase {
+public class TestReduceTask {
 
   static class NullProgress implements Progressable {
     public void progress() { }
@@ -119,9 +121,10 @@ public class TestReduceTask extends TestCase {
     }
     assertEquals(vals.length, i);
     // make sure we have progress equal to 1.0
-    assertEquals(1.0f, rawItr.getProgress().get());
+    assertEquals(1.0f, rawItr.getProgress().get(),0.0000);
   }
 
+  @Test
   public void testValueIterator() throws Exception {
     Path tmpDir = new Path("build/test/test.reduce.task");
     Configuration conf = new Configuration();
@@ -129,7 +132,8 @@ public class TestReduceTask extends TestCase {
       runValueIterator(tmpDir, testCase, conf, null);
     }
   }
-  
+
+  @Test
   public void testValueIteratorWithCompression() throws Exception {
     Path tmpDir = new Path("build/test/test.reduce.task.compression");
     Configuration conf = new Configuration();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsBinaryInputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsBinaryInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsBinaryInputFormat.java
index b8be740..64b0983 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsBinaryInputFormat.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsBinaryInputFormat.java
@@ -18,19 +18,26 @@
 
 package org.apache.hadoop.mapred;
 
+import org.apache.commons.logging.Log;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.BytesWritable;
+import org.apache.hadoop.io.DataInputBuffer;
+import org.apache.hadoop.io.SequenceFile;
+import org.apache.hadoop.io.Text;
+import org.junit.Test;
+
 import java.io.IOException;
 import java.util.Random;
 
-import org.apache.hadoop.fs.*;
-import org.apache.hadoop.io.*;
-
-import junit.framework.TestCase;
-import org.apache.commons.logging.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
-public class TestSequenceFileAsBinaryInputFormat extends TestCase {
+public class TestSequenceFileAsBinaryInputFormat {
   private static final Log LOG = FileInputFormat.LOG;
   private static final int RECORDS = 10000;
 
+  @Test
   public void testBinary() throws IOException {
     JobConf job = new JobConf();
     FileSystem fs = FileSystem.getLocal(job);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsBinaryOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsBinaryOutputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsBinaryOutputFormat.java
index abe21f2..03dc6a6 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsBinaryOutputFormat.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsBinaryOutputFormat.java
@@ -18,24 +18,35 @@
 
 package org.apache.hadoop.mapred;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.BooleanWritable;
+import org.apache.hadoop.io.BytesWritable;
+import org.apache.hadoop.io.DataInputBuffer;
+import org.apache.hadoop.io.DataOutputBuffer;
+import org.apache.hadoop.io.DoubleWritable;
+import org.apache.hadoop.io.FloatWritable;
+import org.apache.hadoop.io.IntWritable;
+import org.apache.hadoop.io.SequenceFile.CompressionType;
+import org.junit.Test;
+
 import java.io.IOException;
 import java.util.Random;
 
-import org.apache.hadoop.fs.*;
-import org.apache.hadoop.io.*;
-import org.apache.hadoop.io.SequenceFile.CompressionType;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
-import junit.framework.TestCase;
-import org.apache.commons.logging.*;
-
-public class TestSequenceFileAsBinaryOutputFormat extends TestCase {
+public class TestSequenceFileAsBinaryOutputFormat {
   private static final Log LOG =
       LogFactory.getLog(TestSequenceFileAsBinaryOutputFormat.class.getName());
-
   private static final int RECORDS = 10000;
   // A random task attempt id for testing.
   private static final String attempt = "attempt_200707121733_0001_m_000000_0";
 
+  @Test
   public void testBinary() throws IOException {
     JobConf job = new JobConf();
     FileSystem fs = FileSystem.getLocal(job);
@@ -129,7 +140,8 @@ public class TestSequenceFileAsBinaryOutputFormat extends TestCase {
     assertEquals("Some records not found", RECORDS, count);
   }
 
-  public void testSequenceOutputClassDefaultsToMapRedOutputClass() 
+  @Test
+  public void testSequenceOutputClassDefaultsToMapRedOutputClass()
          throws IOException {
     JobConf job = new JobConf();
     FileSystem fs = FileSystem.getLocal(job);
@@ -163,6 +175,7 @@ public class TestSequenceFileAsBinaryOutputFormat extends TestCase {
                                                                          job));
   }
 
+  @Test
   public void testcheckOutputSpecsForbidRecordCompression() throws IOException {
     JobConf job = new JobConf();
     FileSystem fs = FileSystem.getLocal(job);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsTextInputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsTextInputFormat.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsTextInputFormat.java
index 4cfd59a..d4e5e17 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsTextInputFormat.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileAsTextInputFormat.java
@@ -18,22 +18,29 @@
 
 package org.apache.hadoop.mapred;
 
-import java.io.*;
-import java.util.*;
-import junit.framework.TestCase;
-
-import org.apache.commons.logging.*;
-
-import org.apache.hadoop.fs.*;
-import org.apache.hadoop.io.*;
-import org.apache.hadoop.conf.*;
-
-public class TestSequenceFileAsTextInputFormat extends TestCase {
+import org.apache.commons.logging.Log;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.IntWritable;
+import org.apache.hadoop.io.LongWritable;
+import org.apache.hadoop.io.SequenceFile;
+import org.apache.hadoop.io.Text;
+import org.junit.Test;
+
+import java.util.BitSet;
+import java.util.Random;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+public class TestSequenceFileAsTextInputFormat {
   private static final Log LOG = FileInputFormat.LOG;
 
   private static int MAX_LENGTH = 10000;
   private static Configuration conf = new Configuration();
 
+  @Test
   public void testFormat() throws Exception {
     JobConf job = new JobConf(conf);
     FileSystem fs = FileSystem.getLocal(conf);
@@ -112,8 +119,4 @@ public class TestSequenceFileAsTextInputFormat extends TestCase {
 
     }
   }
-
-  public static void main(String[] args) throws Exception {
-    new TestSequenceFileAsTextInputFormat().testFormat();
-  }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/0050fa5f/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileInputFilter.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileInputFilter.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileInputFilter.java
index e50c396..93f21ce 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileInputFilter.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestSequenceFileInputFilter.java
@@ -18,17 +18,21 @@
 
 package org.apache.hadoop.mapred;
 
-import java.io.*;
-import java.util.*;
-import junit.framework.TestCase;
+import org.apache.commons.logging.Log;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.BytesWritable;
+import org.apache.hadoop.io.SequenceFile;
+import org.apache.hadoop.io.Text;
+import org.junit.Test;
 
-import org.apache.commons.logging.*;
+import java.io.IOException;
+import java.util.Random;
 
-import org.apache.hadoop.fs.*;
-import org.apache.hadoop.io.*;
-import org.apache.hadoop.conf.*;
+import static org.junit.Assert.assertEquals;
 
-public class TestSequenceFileInputFilter extends TestCase {
+public class TestSequenceFileInputFilter {
   private static final Log LOG = FileInputFormat.LOG;
 
   private static final int MAX_LENGTH = 15000;
@@ -97,7 +101,8 @@ public class TestSequenceFileInputFilter extends TestCase {
     }
     return count;
   }
-  
+
+  @Test
   public void testRegexFilter() throws Exception {
     // set the filter class
     LOG.info("Testing Regex Filter with patter: \\A10*");
@@ -121,6 +126,7 @@ public class TestSequenceFileInputFilter extends TestCase {
     fs.delete(inDir, true);
   }
 
+  @Test
   public void testPercentFilter() throws Exception {
     LOG.info("Testing Percent Filter with frequency: 1000");
     // set the filter class
@@ -147,7 +153,8 @@ public class TestSequenceFileInputFilter extends TestCase {
     // clean up
     fs.delete(inDir, true);
   }
-  
+
+  @Test
   public void testMD5Filter() throws Exception {
     // set the filter class
     LOG.info("Testing MD5 Filter with frequency: 1000");
@@ -168,9 +175,4 @@ public class TestSequenceFileInputFilter extends TestCase {
     // clean up
     fs.delete(inDir, true);
   }
-
-  public static void main(String[] args) throws Exception {
-    TestSequenceFileInputFilter filter = new TestSequenceFileInputFilter();
-    filter.testRegexFilter();
-  }
 }


Mime
View raw message