hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1362753 [2/7] - in /hadoop/common/trunk/hadoop-hdfs-project: hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/ hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/server/ hadoop-hdfs-httpfs/src/test/java/org/apache/...
Date Wed, 18 Jul 2012 03:46:36 GMT
Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/instrumentation/TestInstrumentationService.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/instrumentation/TestInstrumentationService.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/instrumentation/TestInstrumentationService.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/instrumentation/TestInstrumentationService.java Wed Jul 18 03:46:28 2012
@@ -18,7 +18,16 @@
 
 package org.apache.hadoop.lib.service.instrumentation;
 
-import junit.framework.Assert;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.StringWriter;
+import java.util.Arrays;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.lib.server.Server;
 import org.apache.hadoop.lib.service.Instrumentation;
@@ -32,11 +41,6 @@ import org.json.simple.JSONObject;
 import org.json.simple.parser.JSONParser;
 import org.junit.Test;
 
-import java.io.StringWriter;
-import java.util.Arrays;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicInteger;
-
 public class TestInstrumentationService extends HTestCase {
 
   @Override
@@ -47,51 +51,51 @@ public class TestInstrumentationService 
   @Test
   public void cron() {
     InstrumentationService.Cron cron = new InstrumentationService.Cron();
-    Assert.assertEquals(cron.start, 0);
-    Assert.assertEquals(cron.lapStart, 0);
-    Assert.assertEquals(cron.own, 0);
-    Assert.assertEquals(cron.total, 0);
+    assertEquals(cron.start, 0);
+    assertEquals(cron.lapStart, 0);
+    assertEquals(cron.own, 0);
+    assertEquals(cron.total, 0);
     long begin = Time.now();
-    Assert.assertEquals(cron.start(), cron);
-    Assert.assertEquals(cron.start(), cron);
-    Assert.assertEquals(cron.start, begin, 20);
-    Assert.assertEquals(cron.start, cron.lapStart);
+    assertEquals(cron.start(), cron);
+    assertEquals(cron.start(), cron);
+    assertEquals(cron.start, begin, 20);
+    assertEquals(cron.start, cron.lapStart);
     sleep(100);
-    Assert.assertEquals(cron.stop(), cron);
+    assertEquals(cron.stop(), cron);
     long end = Time.now();
     long delta = end - begin;
-    Assert.assertEquals(cron.own, delta, 20);
-    Assert.assertEquals(cron.total, 0);
-    Assert.assertEquals(cron.lapStart, 0);
+    assertEquals(cron.own, delta, 20);
+    assertEquals(cron.total, 0);
+    assertEquals(cron.lapStart, 0);
     sleep(100);
     long reStart = Time.now();
     cron.start();
-    Assert.assertEquals(cron.start, begin, 20);
-    Assert.assertEquals(cron.lapStart, reStart, 20);
+    assertEquals(cron.start, begin, 20);
+    assertEquals(cron.lapStart, reStart, 20);
     sleep(100);
     cron.stop();
     long reEnd = Time.now();
     delta += reEnd - reStart;
-    Assert.assertEquals(cron.own, delta, 20);
-    Assert.assertEquals(cron.total, 0);
-    Assert.assertEquals(cron.lapStart, 0);
+    assertEquals(cron.own, delta, 20);
+    assertEquals(cron.total, 0);
+    assertEquals(cron.lapStart, 0);
     cron.end();
-    Assert.assertEquals(cron.total, reEnd - begin, 20);
+    assertEquals(cron.total, reEnd - begin, 20);
 
     try {
       cron.start();
-      Assert.fail();
+      fail();
     } catch (IllegalStateException ex) {
     } catch (Exception ex) {
-      Assert.fail();
+      fail();
     }
 
     try {
       cron.stop();
-      Assert.fail();
+      fail();
     } catch (IllegalStateException ex) {
     } catch (Exception ex) {
-      Assert.fail();
+      fail();
     }
   }
 
@@ -135,10 +139,10 @@ public class TestInstrumentationService 
 
     timer.addCron(cron);
     long[] values = timer.getValues();
-    Assert.assertEquals(values[InstrumentationService.Timer.LAST_TOTAL], totalDelta, 20);
-    Assert.assertEquals(values[InstrumentationService.Timer.LAST_OWN], ownDelta, 20);
-    Assert.assertEquals(values[InstrumentationService.Timer.AVG_TOTAL], avgTotal, 20);
-    Assert.assertEquals(values[InstrumentationService.Timer.AVG_OWN], avgOwn, 20);
+    assertEquals(values[InstrumentationService.Timer.LAST_TOTAL], totalDelta, 20);
+    assertEquals(values[InstrumentationService.Timer.LAST_OWN], ownDelta, 20);
+    assertEquals(values[InstrumentationService.Timer.AVG_TOTAL], avgTotal, 20);
+    assertEquals(values[InstrumentationService.Timer.AVG_OWN], avgOwn, 20);
 
     cron = new InstrumentationService.Cron();
 
@@ -168,10 +172,10 @@ public class TestInstrumentationService 
 
     timer.addCron(cron);
     values = timer.getValues();
-    Assert.assertEquals(values[InstrumentationService.Timer.LAST_TOTAL], totalDelta, 20);
-    Assert.assertEquals(values[InstrumentationService.Timer.LAST_OWN], ownDelta, 20);
-    Assert.assertEquals(values[InstrumentationService.Timer.AVG_TOTAL], avgTotal, 20);
-    Assert.assertEquals(values[InstrumentationService.Timer.AVG_OWN], avgOwn, 20);
+    assertEquals(values[InstrumentationService.Timer.LAST_TOTAL], totalDelta, 20);
+    assertEquals(values[InstrumentationService.Timer.LAST_OWN], ownDelta, 20);
+    assertEquals(values[InstrumentationService.Timer.AVG_TOTAL], avgTotal, 20);
+    assertEquals(values[InstrumentationService.Timer.AVG_OWN], avgOwn, 20);
 
     avgTotal = totalDelta;
     avgOwn = ownDelta;
@@ -205,27 +209,27 @@ public class TestInstrumentationService 
     cron.stop();
     timer.addCron(cron);
     values = timer.getValues();
-    Assert.assertEquals(values[InstrumentationService.Timer.LAST_TOTAL], totalDelta, 20);
-    Assert.assertEquals(values[InstrumentationService.Timer.LAST_OWN], ownDelta, 20);
-    Assert.assertEquals(values[InstrumentationService.Timer.AVG_TOTAL], avgTotal, 20);
-    Assert.assertEquals(values[InstrumentationService.Timer.AVG_OWN], avgOwn, 20);
+    assertEquals(values[InstrumentationService.Timer.LAST_TOTAL], totalDelta, 20);
+    assertEquals(values[InstrumentationService.Timer.LAST_OWN], ownDelta, 20);
+    assertEquals(values[InstrumentationService.Timer.AVG_TOTAL], avgTotal, 20);
+    assertEquals(values[InstrumentationService.Timer.AVG_OWN], avgOwn, 20);
 
     JSONObject json = (JSONObject) new JSONParser().parse(timer.toJSONString());
-    Assert.assertEquals(json.size(), 4);
-    Assert.assertEquals(json.get("lastTotal"), values[InstrumentationService.Timer.LAST_TOTAL]);
-    Assert.assertEquals(json.get("lastOwn"), values[InstrumentationService.Timer.LAST_OWN]);
-    Assert.assertEquals(json.get("avgTotal"), values[InstrumentationService.Timer.AVG_TOTAL]);
-    Assert.assertEquals(json.get("avgOwn"), values[InstrumentationService.Timer.AVG_OWN]);
+    assertEquals(json.size(), 4);
+    assertEquals(json.get("lastTotal"), values[InstrumentationService.Timer.LAST_TOTAL]);
+    assertEquals(json.get("lastOwn"), values[InstrumentationService.Timer.LAST_OWN]);
+    assertEquals(json.get("avgTotal"), values[InstrumentationService.Timer.AVG_TOTAL]);
+    assertEquals(json.get("avgOwn"), values[InstrumentationService.Timer.AVG_OWN]);
 
     StringWriter writer = new StringWriter();
     timer.writeJSONString(writer);
     writer.close();
     json = (JSONObject) new JSONParser().parse(writer.toString());
-    Assert.assertEquals(json.size(), 4);
-    Assert.assertEquals(json.get("lastTotal"), values[InstrumentationService.Timer.LAST_TOTAL]);
-    Assert.assertEquals(json.get("lastOwn"), values[InstrumentationService.Timer.LAST_OWN]);
-    Assert.assertEquals(json.get("avgTotal"), values[InstrumentationService.Timer.AVG_TOTAL]);
-    Assert.assertEquals(json.get("avgOwn"), values[InstrumentationService.Timer.AVG_OWN]);
+    assertEquals(json.size(), 4);
+    assertEquals(json.get("lastTotal"), values[InstrumentationService.Timer.LAST_TOTAL]);
+    assertEquals(json.get("lastOwn"), values[InstrumentationService.Timer.LAST_OWN]);
+    assertEquals(json.get("avgTotal"), values[InstrumentationService.Timer.AVG_TOTAL]);
+    assertEquals(json.get("avgOwn"), values[InstrumentationService.Timer.AVG_OWN]);
   }
 
   @Test
@@ -240,34 +244,34 @@ public class TestInstrumentationService 
 
     InstrumentationService.Sampler sampler = new InstrumentationService.Sampler();
     sampler.init(4, var);
-    Assert.assertEquals(sampler.getRate(), 0f, 0.0001);
+    assertEquals(sampler.getRate(), 0f, 0.0001);
     sampler.sample();
-    Assert.assertEquals(sampler.getRate(), 0f, 0.0001);
+    assertEquals(sampler.getRate(), 0f, 0.0001);
     value[0] = 1;
     sampler.sample();
-    Assert.assertEquals(sampler.getRate(), (0d + 1) / 2, 0.0001);
+    assertEquals(sampler.getRate(), (0d + 1) / 2, 0.0001);
     value[0] = 2;
     sampler.sample();
-    Assert.assertEquals(sampler.getRate(), (0d + 1 + 2) / 3, 0.0001);
+    assertEquals(sampler.getRate(), (0d + 1 + 2) / 3, 0.0001);
     value[0] = 3;
     sampler.sample();
-    Assert.assertEquals(sampler.getRate(), (0d + 1 + 2 + 3) / 4, 0.0001);
+    assertEquals(sampler.getRate(), (0d + 1 + 2 + 3) / 4, 0.0001);
     value[0] = 4;
     sampler.sample();
-    Assert.assertEquals(sampler.getRate(), (4d + 1 + 2 + 3) / 4, 0.0001);
+    assertEquals(sampler.getRate(), (4d + 1 + 2 + 3) / 4, 0.0001);
 
     JSONObject json = (JSONObject) new JSONParser().parse(sampler.toJSONString());
-    Assert.assertEquals(json.size(), 2);
-    Assert.assertEquals(json.get("sampler"), sampler.getRate());
-    Assert.assertEquals(json.get("size"), 4L);
+    assertEquals(json.size(), 2);
+    assertEquals(json.get("sampler"), sampler.getRate());
+    assertEquals(json.get("size"), 4L);
 
     StringWriter writer = new StringWriter();
     sampler.writeJSONString(writer);
     writer.close();
     json = (JSONObject) new JSONParser().parse(writer.toString());
-    Assert.assertEquals(json.size(), 2);
-    Assert.assertEquals(json.get("sampler"), sampler.getRate());
-    Assert.assertEquals(json.get("size"), 4L);
+    assertEquals(json.size(), 2);
+    assertEquals(json.get("sampler"), sampler.getRate());
+    assertEquals(json.get("size"), 4L);
   }
 
   @Test
@@ -283,15 +287,15 @@ public class TestInstrumentationService 
     };
 
     JSONObject json = (JSONObject) new JSONParser().parse(variableHolder.toJSONString());
-    Assert.assertEquals(json.size(), 1);
-    Assert.assertEquals(json.get("value"), "foo");
+    assertEquals(json.size(), 1);
+    assertEquals(json.get("value"), "foo");
 
     StringWriter writer = new StringWriter();
     variableHolder.writeJSONString(writer);
     writer.close();
     json = (JSONObject) new JSONParser().parse(writer.toString());
-    Assert.assertEquals(json.size(), 1);
-    Assert.assertEquals(json.get("value"), "foo");
+    assertEquals(json.size(), 1);
+    assertEquals(json.get("value"), "foo");
   }
 
   @Test
@@ -306,7 +310,7 @@ public class TestInstrumentationService 
     server.init();
 
     Instrumentation instrumentation = server.get(Instrumentation.class);
-    Assert.assertNotNull(instrumentation);
+    assertNotNull(instrumentation);
     instrumentation.incr("g", "c", 1);
     instrumentation.incr("g", "c", 2);
     instrumentation.incr("g", "c1", 2);
@@ -339,27 +343,27 @@ public class TestInstrumentationService 
     instrumentation.addSampler("g", "s", 10, varToSample);
 
     Map<String, ?> snapshot = instrumentation.getSnapshot();
-    Assert.assertNotNull(snapshot.get("os-env"));
-    Assert.assertNotNull(snapshot.get("sys-props"));
-    Assert.assertNotNull(snapshot.get("jvm"));
-    Assert.assertNotNull(snapshot.get("counters"));
-    Assert.assertNotNull(snapshot.get("timers"));
-    Assert.assertNotNull(snapshot.get("variables"));
-    Assert.assertNotNull(snapshot.get("samplers"));
-    Assert.assertNotNull(((Map<String, String>) snapshot.get("os-env")).get("PATH"));
-    Assert.assertNotNull(((Map<String, String>) snapshot.get("sys-props")).get("java.version"));
-    Assert.assertNotNull(((Map<String, ?>) snapshot.get("jvm")).get("free.memory"));
-    Assert.assertNotNull(((Map<String, ?>) snapshot.get("jvm")).get("max.memory"));
-    Assert.assertNotNull(((Map<String, ?>) snapshot.get("jvm")).get("total.memory"));
-    Assert.assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("counters")).get("g"));
-    Assert.assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("timers")).get("g"));
-    Assert.assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("variables")).get("g"));
-    Assert.assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("samplers")).get("g"));
-    Assert.assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("counters")).get("g").get("c"));
-    Assert.assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("counters")).get("g").get("c1"));
-    Assert.assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("timers")).get("g").get("t"));
-    Assert.assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("variables")).get("g").get("v"));
-    Assert.assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("samplers")).get("g").get("s"));
+    assertNotNull(snapshot.get("os-env"));
+    assertNotNull(snapshot.get("sys-props"));
+    assertNotNull(snapshot.get("jvm"));
+    assertNotNull(snapshot.get("counters"));
+    assertNotNull(snapshot.get("timers"));
+    assertNotNull(snapshot.get("variables"));
+    assertNotNull(snapshot.get("samplers"));
+    assertNotNull(((Map<String, String>) snapshot.get("os-env")).get("PATH"));
+    assertNotNull(((Map<String, String>) snapshot.get("sys-props")).get("java.version"));
+    assertNotNull(((Map<String, ?>) snapshot.get("jvm")).get("free.memory"));
+    assertNotNull(((Map<String, ?>) snapshot.get("jvm")).get("max.memory"));
+    assertNotNull(((Map<String, ?>) snapshot.get("jvm")).get("total.memory"));
+    assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("counters")).get("g"));
+    assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("timers")).get("g"));
+    assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("variables")).get("g"));
+    assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("samplers")).get("g"));
+    assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("counters")).get("g").get("c"));
+    assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("counters")).get("g").get("c1"));
+    assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("timers")).get("g").get("t"));
+    assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("variables")).get("g").get("v"));
+    assertNotNull(((Map<String, Map<String, Object>>) snapshot.get("samplers")).get("g").get("s"));
 
     StringWriter writer = new StringWriter();
     JSONObject.writeJSONString(snapshot, writer);
@@ -392,12 +396,12 @@ public class TestInstrumentationService 
 
     sleep(2000);
     int i = count.get();
-    Assert.assertTrue(i > 0);
+    assertTrue(i > 0);
 
     Map<String, Map<String, ?>> snapshot = instrumentation.getSnapshot();
     Map<String, Map<String, Object>> samplers = (Map<String, Map<String, Object>>) snapshot.get("samplers");
     InstrumentationService.Sampler sampler = (InstrumentationService.Sampler) samplers.get("g").get("s");
-    Assert.assertTrue(sampler.getRate() > 0);
+    assertTrue(sampler.getRate() > 0);
 
     server.destroy();
   }

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/scheduler/TestSchedulerService.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/scheduler/TestSchedulerService.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/scheduler/TestSchedulerService.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/scheduler/TestSchedulerService.java Wed Jul 18 03:46:28 2012
@@ -18,7 +18,10 @@
 
 package org.apache.hadoop.lib.service.scheduler;
 
-import junit.framework.Assert;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.Arrays;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.lib.server.Server;
 import org.apache.hadoop.lib.service.Scheduler;
@@ -29,8 +32,6 @@ import org.apache.hadoop.test.TestDirHel
 import org.apache.hadoop.util.StringUtils;
 import org.junit.Test;
 
-import java.util.Arrays;
-
 public class TestSchedulerService extends HTestCase {
 
   @Test
@@ -42,7 +43,7 @@ public class TestSchedulerService extend
                                                                     SchedulerService.class.getName())));
     Server server = new Server("server", dir, dir, dir, dir, conf);
     server.init();
-    Assert.assertNotNull(server.get(Scheduler.class));
+    assertNotNull(server.get(Scheduler.class));
     server.destroy();
   }
 

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/security/DummyGroupMapping.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/security/DummyGroupMapping.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/security/DummyGroupMapping.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/security/DummyGroupMapping.java Wed Jul 18 03:46:28 2012
@@ -17,14 +17,14 @@
  */
 package org.apache.hadoop.lib.service.security;
 
-import org.apache.hadoop.security.GroupMappingServiceProvider;
-import org.apache.hadoop.test.HadoopUsersConfTestHelper;
-
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
+import org.apache.hadoop.security.GroupMappingServiceProvider;
+import org.apache.hadoop.test.HadoopUsersConfTestHelper;
+
 public class DummyGroupMapping implements GroupMappingServiceProvider {
 
   @Override

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/security/TestGroupsService.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/security/TestGroupsService.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/security/TestGroupsService.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/security/TestGroupsService.java Wed Jul 18 03:46:28 2012
@@ -18,7 +18,12 @@
 
 package org.apache.hadoop.lib.service.security;
 
-import junit.framework.Assert;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+
+import java.util.Arrays;
+import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.lib.server.Server;
 import org.apache.hadoop.lib.service.Groups;
@@ -28,9 +33,6 @@ import org.apache.hadoop.test.TestDirHel
 import org.apache.hadoop.util.StringUtils;
 import org.junit.Test;
 
-import java.util.Arrays;
-import java.util.List;
-
 public class TestGroupsService extends HTestCase {
 
   @Test
@@ -42,9 +44,9 @@ public class TestGroupsService extends H
     Server server = new Server("server", dir, dir, dir, dir, conf);
     server.init();
     Groups groups = server.get(Groups.class);
-    Assert.assertNotNull(groups);
+    assertNotNull(groups);
     List<String> g = groups.getGroups(System.getProperty("user.name"));
-    Assert.assertNotSame(g.size(), 0);
+    assertNotSame(g.size(), 0);
     server.destroy();
   }
 

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/security/TestProxyUserService.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/security/TestProxyUserService.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/security/TestProxyUserService.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/security/TestProxyUserService.java Wed Jul 18 03:46:28 2012
@@ -18,7 +18,12 @@
 
 package org.apache.hadoop.lib.service.security;
 
-import junit.framework.Assert;
+import static org.junit.Assert.assertNotNull;
+
+import java.security.AccessControlException;
+import java.util.Arrays;
+import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.lib.server.Server;
 import org.apache.hadoop.lib.server.ServiceException;
@@ -31,10 +36,6 @@ import org.apache.hadoop.test.TestExcept
 import org.apache.hadoop.util.StringUtils;
 import org.junit.Test;
 
-import java.security.AccessControlException;
-import java.util.Arrays;
-import java.util.List;
-
 public class TestProxyUserService extends HTestCase {
 
   @Test
@@ -47,7 +48,7 @@ public class TestProxyUserService extend
     Server server = new Server("server", dir, dir, dir, dir, conf);
     server.init();
     ProxyUser proxyUser = server.get(ProxyUser.class);
-    Assert.assertNotNull(proxyUser);
+    assertNotNull(proxyUser);
     server.destroy();
   }
 
@@ -103,7 +104,7 @@ public class TestProxyUserService extend
     Server server = new Server("server", dir, dir, dir, dir, conf);
     server.init();
     ProxyUser proxyUser = server.get(ProxyUser.class);
-    Assert.assertNotNull(proxyUser);
+    assertNotNull(proxyUser);
     proxyUser.validate("foo", "localhost", "bar");
     server.destroy();
   }
@@ -120,7 +121,7 @@ public class TestProxyUserService extend
     Server server = new Server("server", dir, dir, dir, dir, conf);
     server.init();
     ProxyUser proxyUser = server.get(ProxyUser.class);
-    Assert.assertNotNull(proxyUser);
+    assertNotNull(proxyUser);
     proxyUser.validate("bar", "localhost", "foo");
     server.destroy();
   }
@@ -137,7 +138,7 @@ public class TestProxyUserService extend
     Server server = new Server("server", dir, dir, dir, dir, conf);
     server.init();
     ProxyUser proxyUser = server.get(ProxyUser.class);
-    Assert.assertNotNull(proxyUser);
+    assertNotNull(proxyUser);
     proxyUser.validate("foo", "localhost", "bar");
     server.destroy();
   }
@@ -166,7 +167,7 @@ public class TestProxyUserService extend
     Server server = new Server("server", dir, dir, dir, dir, conf);
     server.init();
     ProxyUser proxyUser = server.get(ProxyUser.class);
-    Assert.assertNotNull(proxyUser);
+    assertNotNull(proxyUser);
     proxyUser.validate("foo", "localhost", System.getProperty("user.name"));
     server.destroy();
   }
@@ -184,7 +185,7 @@ public class TestProxyUserService extend
     Server server = new Server("server", dir, dir, dir, dir, conf);
     server.init();
     ProxyUser proxyUser = server.get(ProxyUser.class);
-    Assert.assertNotNull(proxyUser);
+    assertNotNull(proxyUser);
     proxyUser.validate("foo", "unknownhost.bar.foo", "bar");
     server.destroy();
   }
@@ -201,7 +202,7 @@ public class TestProxyUserService extend
     Server server = new Server("server", dir, dir, dir, dir, conf);
     server.init();
     ProxyUser proxyUser = server.get(ProxyUser.class);
-    Assert.assertNotNull(proxyUser);
+    assertNotNull(proxyUser);
     proxyUser.validate("foo", "www.yahoo.com", "bar");
     server.destroy();
   }
@@ -218,7 +219,7 @@ public class TestProxyUserService extend
     Server server = new Server("server", dir, dir, dir, dir, conf);
     server.init();
     ProxyUser proxyUser = server.get(ProxyUser.class);
-    Assert.assertNotNull(proxyUser);
+    assertNotNull(proxyUser);
     proxyUser.validate("foo", "localhost", System.getProperty("user.name"));
     server.destroy();
   }

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/servlet/TestHostnameFilter.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/servlet/TestHostnameFilter.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/servlet/TestHostnameFilter.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/servlet/TestHostnameFilter.java Wed Jul 18 03:46:28 2012
@@ -18,18 +18,21 @@
 
 package org.apache.hadoop.lib.servlet;
 
-import junit.framework.Assert;
-import org.apache.hadoop.test.HTestCase;
-import org.junit.Test;
-import org.mockito.Mockito;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.servlet.Filter;
 import javax.servlet.FilterChain;
 import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
-import java.io.IOException;
-import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.hadoop.test.HTestCase;
+import org.junit.Test;
+import org.mockito.Mockito;
 
 
 public class TestHostnameFilter extends HTestCase {
@@ -47,17 +50,17 @@ public class TestHostnameFilter extends 
       @Override
       public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse)
         throws IOException, ServletException {
-        Assert.assertTrue(HostnameFilter.get().contains("localhost"));
+        assertTrue(HostnameFilter.get().contains("localhost"));
         invoked.set(true);
       }
     };
 
     Filter filter = new HostnameFilter();
     filter.init(null);
-    Assert.assertNull(HostnameFilter.get());
+    assertNull(HostnameFilter.get());
     filter.doFilter(request, response, chain);
-    Assert.assertTrue(invoked.get());
-    Assert.assertNull(HostnameFilter.get());
+    assertTrue(invoked.get());
+    assertNull(HostnameFilter.get());
     filter.destroy();
   }
 

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/servlet/TestMDCFilter.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/servlet/TestMDCFilter.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/servlet/TestMDCFilter.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/servlet/TestMDCFilter.java Wed Jul 18 03:46:28 2012
@@ -18,11 +18,13 @@
 
 package org.apache.hadoop.lib.servlet;
 
-import junit.framework.Assert;
-import org.apache.hadoop.test.HTestCase;
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.slf4j.MDC;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.security.Principal;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.servlet.Filter;
 import javax.servlet.FilterChain;
@@ -30,9 +32,11 @@ import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
-import java.io.IOException;
-import java.security.Principal;
-import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.hadoop.test.HTestCase;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.slf4j.MDC;
 
 
 public class TestMDCFilter extends HTestCase {
@@ -52,10 +56,10 @@ public class TestMDCFilter extends HTest
       @Override
       public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse)
         throws IOException, ServletException {
-        Assert.assertEquals(MDC.get("hostname"), null);
-        Assert.assertEquals(MDC.get("user"), null);
-        Assert.assertEquals(MDC.get("method"), "METHOD");
-        Assert.assertEquals(MDC.get("path"), "/pathinfo");
+        assertEquals(MDC.get("hostname"), null);
+        assertEquals(MDC.get("user"), null);
+        assertEquals(MDC.get("method"), "METHOD");
+        assertEquals(MDC.get("path"), "/pathinfo");
         invoked.set(true);
       }
     };
@@ -65,11 +69,11 @@ public class TestMDCFilter extends HTest
     filter.init(null);
 
     filter.doFilter(request, response, chain);
-    Assert.assertTrue(invoked.get());
-    Assert.assertNull(MDC.get("hostname"));
-    Assert.assertNull(MDC.get("user"));
-    Assert.assertNull(MDC.get("method"));
-    Assert.assertNull(MDC.get("path"));
+    assertTrue(invoked.get());
+    assertNull(MDC.get("hostname"));
+    assertNull(MDC.get("user"));
+    assertNull(MDC.get("method"));
+    assertNull(MDC.get("path"));
 
     Mockito.when(request.getUserPrincipal()).thenReturn(new Principal() {
       @Override
@@ -83,15 +87,15 @@ public class TestMDCFilter extends HTest
       @Override
       public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse)
         throws IOException, ServletException {
-        Assert.assertEquals(MDC.get("hostname"), null);
-        Assert.assertEquals(MDC.get("user"), "name");
-        Assert.assertEquals(MDC.get("method"), "METHOD");
-        Assert.assertEquals(MDC.get("path"), "/pathinfo");
+        assertEquals(MDC.get("hostname"), null);
+        assertEquals(MDC.get("user"), "name");
+        assertEquals(MDC.get("method"), "METHOD");
+        assertEquals(MDC.get("path"), "/pathinfo");
         invoked.set(true);
       }
     };
     filter.doFilter(request, response, chain);
-    Assert.assertTrue(invoked.get());
+    assertTrue(invoked.get());
 
     HostnameFilter.HOSTNAME_TL.set("HOST");
 
@@ -100,15 +104,15 @@ public class TestMDCFilter extends HTest
       @Override
       public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse)
         throws IOException, ServletException {
-        Assert.assertEquals(MDC.get("hostname"), "HOST");
-        Assert.assertEquals(MDC.get("user"), "name");
-        Assert.assertEquals(MDC.get("method"), "METHOD");
-        Assert.assertEquals(MDC.get("path"), "/pathinfo");
+        assertEquals(MDC.get("hostname"), "HOST");
+        assertEquals(MDC.get("user"), "name");
+        assertEquals(MDC.get("method"), "METHOD");
+        assertEquals(MDC.get("path"), "/pathinfo");
         invoked.set(true);
       }
     };
     filter.doFilter(request, response, chain);
-    Assert.assertTrue(invoked.get());
+    assertTrue(invoked.get());
 
     HostnameFilter.HOSTNAME_TL.remove();
 

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/servlet/TestServerWebApp.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/servlet/TestServerWebApp.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/servlet/TestServerWebApp.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/servlet/TestServerWebApp.java Wed Jul 18 03:46:28 2012
@@ -18,7 +18,8 @@
 
 package org.apache.hadoop.lib.servlet;
 
-import junit.framework.Assert;
+import static org.junit.Assert.assertEquals;
+
 import org.apache.hadoop.lib.server.Server;
 import org.apache.hadoop.test.HTestCase;
 import org.apache.hadoop.test.TestDir;
@@ -35,10 +36,10 @@ public class TestServerWebApp extends HT
   @Test
   public void getHomeDir() {
     System.setProperty("TestServerWebApp0.home.dir", "/tmp");
-    Assert.assertEquals(ServerWebApp.getHomeDir("TestServerWebApp0"), "/tmp");
-    Assert.assertEquals(ServerWebApp.getDir("TestServerWebApp0", ".log.dir", "/tmp/log"), "/tmp/log");
+    assertEquals(ServerWebApp.getHomeDir("TestServerWebApp0"), "/tmp");
+    assertEquals(ServerWebApp.getDir("TestServerWebApp0", ".log.dir", "/tmp/log"), "/tmp/log");
     System.setProperty("TestServerWebApp0.log.dir", "/tmplog");
-    Assert.assertEquals(ServerWebApp.getDir("TestServerWebApp0", ".log.dir", "/tmp/log"), "/tmplog");
+    assertEquals(ServerWebApp.getDir("TestServerWebApp0", ".log.dir", "/tmp/log"), "/tmplog");
   }
 
   @Test
@@ -52,11 +53,11 @@ public class TestServerWebApp extends HT
     ServerWebApp server = new ServerWebApp("TestServerWebApp1") {
     };
 
-    Assert.assertEquals(server.getStatus(), Server.Status.UNDEF);
+    assertEquals(server.getStatus(), Server.Status.UNDEF);
     server.contextInitialized(null);
-    Assert.assertEquals(server.getStatus(), Server.Status.NORMAL);
+    assertEquals(server.getStatus(), Server.Status.NORMAL);
     server.contextDestroyed(null);
-    Assert.assertEquals(server.getStatus(), Server.Status.SHUTDOWN);
+    assertEquals(server.getStatus(), Server.Status.SHUTDOWN);
   }
 
   @Test(expected = RuntimeException.class)

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/util/TestCheck.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/util/TestCheck.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/util/TestCheck.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/util/TestCheck.java Wed Jul 18 03:46:28 2012
@@ -19,18 +19,19 @@
 package org.apache.hadoop.lib.util;
 
 
-import junit.framework.Assert;
-import org.apache.hadoop.test.HTestCase;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
 
 import java.util.ArrayList;
 import java.util.Arrays;
 
+import org.apache.hadoop.test.HTestCase;
+import org.junit.Test;
+
 public class TestCheck extends HTestCase {
 
   @Test
   public void notNullNotNull() {
-    Assert.assertEquals(Check.notNull("value", "name"), "value");
+    assertEquals(Check.notNull("value", "name"), "value");
   }
 
   @Test(expected = IllegalArgumentException.class)
@@ -79,7 +80,7 @@ public class TestCheck extends HTestCase
 
   @Test
   public void notEmptyNotEmtpy() {
-    Assert.assertEquals(Check.notEmpty("value", "name"), "value");
+    assertEquals(Check.notEmpty("value", "name"), "value");
   }
 
   @Test(expected = IllegalArgumentException.class)
@@ -94,10 +95,10 @@ public class TestCheck extends HTestCase
 
   @Test
   public void validIdentifierValid() throws Exception {
-    Assert.assertEquals(Check.validIdentifier("a", 1, ""), "a");
-    Assert.assertEquals(Check.validIdentifier("a1", 2, ""), "a1");
-    Assert.assertEquals(Check.validIdentifier("a_", 3, ""), "a_");
-    Assert.assertEquals(Check.validIdentifier("_", 1, ""), "_");
+    assertEquals(Check.validIdentifier("a", 1, ""), "a");
+    assertEquals(Check.validIdentifier("a1", 2, ""), "a1");
+    assertEquals(Check.validIdentifier("a_", 3, ""), "a_");
+    assertEquals(Check.validIdentifier("_", 1, ""), "_");
   }
 
   @Test(expected = IllegalArgumentException.class)
@@ -117,7 +118,7 @@ public class TestCheck extends HTestCase
 
   @Test
   public void checkGTZeroGreater() {
-    Assert.assertEquals(Check.gt0(120, "test"), 120);
+    assertEquals(Check.gt0(120, "test"), 120);
   }
 
   @Test(expected = IllegalArgumentException.class)
@@ -132,8 +133,8 @@ public class TestCheck extends HTestCase
 
   @Test
   public void checkGEZero() {
-    Assert.assertEquals(Check.ge0(120, "test"), 120);
-    Assert.assertEquals(Check.ge0(0, "test"), 0);
+    assertEquals(Check.ge0(120, "test"), 120);
+    assertEquals(Check.ge0(0, "test"), 0);
   }
 
   @Test(expected = IllegalArgumentException.class)

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/util/TestConfigurationUtils.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/util/TestConfigurationUtils.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/util/TestConfigurationUtils.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/util/TestConfigurationUtils.java Wed Jul 18 03:46:28 2012
@@ -18,27 +18,29 @@
 
 package org.apache.hadoop.lib.util;
 
-import junit.framework.Assert;
-import org.apache.hadoop.conf.Configuration;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
+import org.apache.hadoop.conf.Configuration;
+import org.junit.Test;
+
 public class TestConfigurationUtils {
 
   @Test
   public void constructors() throws Exception {
     Configuration conf = new Configuration(false);
-    Assert.assertEquals(conf.size(), 0);
+    assertEquals(conf.size(), 0);
 
     byte[] bytes = "<configuration><property><name>a</name><value>A</value></property></configuration>".getBytes();
     InputStream is = new ByteArrayInputStream(bytes);
     conf = new Configuration(false);
     ConfigurationUtils.load(conf, is);
-    Assert.assertEquals(conf.size(), 1);
-    Assert.assertEquals(conf.get("a"), "A");
+    assertEquals(conf.size(), 1);
+    assertEquals(conf.get("a"), "A");
   }
 
 
@@ -62,9 +64,9 @@ public class TestConfigurationUtils {
 
     ConfigurationUtils.copy(srcConf, targetConf);
 
-    Assert.assertEquals("valueFromSource", targetConf.get("testParameter1"));
-    Assert.assertEquals("valueFromSource", targetConf.get("testParameter2"));
-    Assert.assertEquals("valueFromTarget", targetConf.get("testParameter3"));
+    assertEquals("valueFromSource", targetConf.get("testParameter1"));
+    assertEquals("valueFromSource", targetConf.get("testParameter2"));
+    assertEquals("valueFromTarget", targetConf.get("testParameter3"));
   }
 
   @Test
@@ -80,13 +82,13 @@ public class TestConfigurationUtils {
 
     ConfigurationUtils.injectDefaults(srcConf, targetConf);
 
-    Assert.assertEquals("valueFromSource", targetConf.get("testParameter1"));
-    Assert.assertEquals("originalValueFromTarget", targetConf.get("testParameter2"));
-    Assert.assertEquals("originalValueFromTarget", targetConf.get("testParameter3"));
-
-    Assert.assertEquals("valueFromSource", srcConf.get("testParameter1"));
-    Assert.assertEquals("valueFromSource", srcConf.get("testParameter2"));
-    Assert.assertNull(srcConf.get("testParameter3"));
+    assertEquals("valueFromSource", targetConf.get("testParameter1"));
+    assertEquals("originalValueFromTarget", targetConf.get("testParameter2"));
+    assertEquals("originalValueFromTarget", targetConf.get("testParameter3"));
+
+    assertEquals("valueFromSource", srcConf.get("testParameter1"));
+    assertEquals("valueFromSource", srcConf.get("testParameter2"));
+    assertNull(srcConf.get("testParameter3"));
   }
 
 
@@ -95,11 +97,11 @@ public class TestConfigurationUtils {
     Configuration conf = new Configuration(false);
     conf.set("a", "A");
     conf.set("b", "${a}");
-    Assert.assertEquals(conf.getRaw("a"), "A");
-    Assert.assertEquals(conf.getRaw("b"), "${a}");
+    assertEquals(conf.getRaw("a"), "A");
+    assertEquals(conf.getRaw("b"), "${a}");
     conf = ConfigurationUtils.resolve(conf);
-    Assert.assertEquals(conf.getRaw("a"), "A");
-    Assert.assertEquals(conf.getRaw("b"), "A");
+    assertEquals(conf.getRaw("a"), "A");
+    assertEquals(conf.getRaw("b"), "A");
   }
 
   @Test
@@ -110,16 +112,16 @@ public class TestConfigurationUtils {
     conf.set("b", "${a}");
     conf.set("c", "${user.name}");
     conf.set("d", "${aaa}");
-    Assert.assertEquals(conf.getRaw("a"), "A");
-    Assert.assertEquals(conf.getRaw("b"), "${a}");
-    Assert.assertEquals(conf.getRaw("c"), "${user.name}");
-    Assert.assertEquals(conf.get("a"), "A");
-    Assert.assertEquals(conf.get("b"), "A");
-    Assert.assertEquals(conf.get("c"), userName);
-    Assert.assertEquals(conf.get("d"), "${aaa}");
+    assertEquals(conf.getRaw("a"), "A");
+    assertEquals(conf.getRaw("b"), "${a}");
+    assertEquals(conf.getRaw("c"), "${user.name}");
+    assertEquals(conf.get("a"), "A");
+    assertEquals(conf.get("b"), "A");
+    assertEquals(conf.get("c"), userName);
+    assertEquals(conf.get("d"), "${aaa}");
 
     conf.set("user.name", "foo");
-    Assert.assertEquals(conf.get("user.name"), "foo");
+    assertEquals(conf.get("user.name"), "foo");
   }
 
 }

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestInputStreamEntity.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestInputStreamEntity.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestInputStreamEntity.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestInputStreamEntity.java Wed Jul 18 03:46:28 2012
@@ -18,13 +18,14 @@
 
 package org.apache.hadoop.lib.wsrs;
 
-import junit.framework.Assert;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 
+import org.junit.Test;
+
 public class TestInputStreamEntity {
 
   @Test
@@ -34,14 +35,14 @@ public class TestInputStreamEntity {
     InputStreamEntity i = new InputStreamEntity(is);
     i.write(baos);
     baos.close();
-    Assert.assertEquals(new String(baos.toByteArray()), "abc");
+    assertEquals(new String(baos.toByteArray()), "abc");
 
     is = new ByteArrayInputStream("abc".getBytes());
     baos = new ByteArrayOutputStream();
     i = new InputStreamEntity(is, 1, 1);
     i.write(baos);
     baos.close();
-    Assert.assertEquals(baos.toByteArray()[0], 'b');
+    assertEquals(baos.toByteArray()[0], 'b');
   }
 
 }

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestJSONMapProvider.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestJSONMapProvider.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestJSONMapProvider.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestJSONMapProvider.java Wed Jul 18 03:46:28 2012
@@ -18,28 +18,31 @@
 
 package org.apache.hadoop.lib.wsrs;
 
-import junit.framework.Assert;
-import org.json.simple.JSONObject;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.io.ByteArrayOutputStream;
 import java.util.Map;
 
+import org.json.simple.JSONObject;
+import org.junit.Test;
+
 public class TestJSONMapProvider {
 
   @Test
   @SuppressWarnings("unchecked")
   public void test() throws Exception {
     JSONMapProvider p = new JSONMapProvider();
-    Assert.assertTrue(p.isWriteable(Map.class, null, null, null));
-    Assert.assertFalse(p.isWriteable(this.getClass(), null, null, null));
-    Assert.assertEquals(p.getSize(null, null, null, null, null), -1);
+    assertTrue(p.isWriteable(Map.class, null, null, null));
+    assertFalse(p.isWriteable(this.getClass(), null, null, null));
+    assertEquals(p.getSize(null, null, null, null, null), -1);
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
     JSONObject json = new JSONObject();
     json.put("a", "A");
     p.writeTo(json, JSONObject.class, null, null, null, null, baos);
     baos.close();
-    Assert.assertEquals(new String(baos.toByteArray()).trim(), "{\"a\":\"A\"}");
+    assertEquals(new String(baos.toByteArray()).trim(), "{\"a\":\"A\"}");
   }
 
 }

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestJSONProvider.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestJSONProvider.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestJSONProvider.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestJSONProvider.java Wed Jul 18 03:46:28 2012
@@ -18,27 +18,30 @@
 
 package org.apache.hadoop.lib.wsrs;
 
-import junit.framework.Assert;
-import org.json.simple.JSONObject;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.io.ByteArrayOutputStream;
 
+import org.json.simple.JSONObject;
+import org.junit.Test;
+
 public class TestJSONProvider {
 
   @Test
   @SuppressWarnings("unchecked")
   public void test() throws Exception {
     JSONProvider p = new JSONProvider();
-    Assert.assertTrue(p.isWriteable(JSONObject.class, null, null, null));
-    Assert.assertFalse(p.isWriteable(this.getClass(), null, null, null));
-    Assert.assertEquals(p.getSize(null, null, null, null, null), -1);
+    assertTrue(p.isWriteable(JSONObject.class, null, null, null));
+    assertFalse(p.isWriteable(this.getClass(), null, null, null));
+    assertEquals(p.getSize(null, null, null, null, null), -1);
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
     JSONObject json = new JSONObject();
     json.put("a", "A");
     p.writeTo(json, JSONObject.class, null, null, null, null, baos);
     baos.close();
-    Assert.assertEquals(new String(baos.toByteArray()).trim(), "{\"a\":\"A\"}");
+    assertEquals(new String(baos.toByteArray()).trim(), "{\"a\":\"A\"}");
   }
 
 }

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestParam.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestParam.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestParam.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestParam.java Wed Jul 18 03:46:28 2012
@@ -18,41 +18,43 @@
 
 package org.apache.hadoop.lib.wsrs;
 
-import junit.framework.Assert;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 import java.util.regex.Pattern;
 
+import org.junit.Test;
+
 public class TestParam {
 
   private <T> void test(Param<T> param, String name,
                    String domain, T defaultValue, T validValue,
                    String invalidStrValue, String outOfRangeValue) throws Exception {
 
-    Assert.assertEquals(name, param.getName());
-    Assert.assertEquals(domain, param.getDomain());
-    Assert.assertEquals(defaultValue, param.value());
-    Assert.assertEquals(defaultValue, param.parseParam(""));
-    Assert.assertEquals(defaultValue, param.parseParam(null));
-    Assert.assertEquals(validValue, param.parseParam(validValue.toString()));
+    assertEquals(name, param.getName());
+    assertEquals(domain, param.getDomain());
+    assertEquals(defaultValue, param.value());
+    assertEquals(defaultValue, param.parseParam(""));
+    assertEquals(defaultValue, param.parseParam(null));
+    assertEquals(validValue, param.parseParam(validValue.toString()));
     if (invalidStrValue != null) {
       try {
         param.parseParam(invalidStrValue);
-        Assert.fail();
+        fail();
       } catch (IllegalArgumentException ex) {
         //NOP
       } catch (Exception ex) {
-        Assert.fail();
+        fail();
       }
     }
     if (outOfRangeValue != null) {
       try {
         param.parseParam(outOfRangeValue);
-        Assert.fail();
+        fail();
       } catch (IllegalArgumentException ex) {
         //NOP
       } catch (Exception ex) {
-        Assert.fail();
+        fail();
       }
     }
    }
@@ -81,7 +83,7 @@ public class TestParam {
     param = new ShortParam("S", (short) 1, 8) {
     };
 
-    Assert.assertEquals(new Short((short)01777), param.parse("01777"));
+    assertEquals(new Short((short)01777), param.parse("01777"));
   }
 
   @Test

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestUserProvider.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestUserProvider.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestUserProvider.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/wsrs/TestUserProvider.java Wed Jul 18 03:46:28 2012
@@ -18,16 +18,20 @@
 
 package org.apache.hadoop.lib.wsrs;
 
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.core.HttpRequestContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import junit.framework.Assert;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import java.security.Principal;
+
+import javax.ws.rs.core.MultivaluedMap;
+
 import org.junit.Test;
 import org.mockito.Mockito;
 import org.slf4j.MDC;
 
-import javax.ws.rs.core.MultivaluedMap;
-import java.security.Principal;
+import com.sun.jersey.api.core.HttpContext;
+import com.sun.jersey.api.core.HttpRequestContext;
+import com.sun.jersey.core.spi.component.ComponentScope;
 
 public class TestUserProvider {
 
@@ -43,8 +47,8 @@ public class TestUserProvider {
     HttpContext context = Mockito.mock(HttpContext.class);
     Mockito.when(context.getRequest()).thenReturn(request);
     UserProvider up = new UserProvider();
-    Assert.assertNull(up.getValue(context));
-    Assert.assertNull(MDC.get("user"));
+    assertNull(up.getValue(context));
+    assertNull(MDC.get("user"));
   }
 
   @Test
@@ -59,8 +63,8 @@ public class TestUserProvider {
     HttpContext context = Mockito.mock(HttpContext.class);
     Mockito.when(context.getRequest()).thenReturn(request);
     UserProvider up = new UserProvider();
-    Assert.assertEquals(up.getValue(context).getName(), "foo");
-    Assert.assertEquals(MDC.get("user"), "foo");
+    assertEquals(up.getValue(context).getName(), "foo");
+    assertEquals(MDC.get("user"), "foo");
   }
 
   @Test
@@ -77,15 +81,15 @@ public class TestUserProvider {
     HttpContext context = Mockito.mock(HttpContext.class);
     Mockito.when(context.getRequest()).thenReturn(request);
     UserProvider up = new UserProvider();
-    Assert.assertEquals(up.getValue(context).getName(), "bar");
-    Assert.assertEquals(MDC.get("user"), "bar");
+    assertEquals(up.getValue(context).getName(), "bar");
+    assertEquals(MDC.get("user"), "bar");
   }
 
   @Test
   public void getters() {
     UserProvider up = new UserProvider();
-    Assert.assertEquals(up.getScope(), ComponentScope.PerRequest);
-    Assert.assertEquals(up.getInjectable(null, null, Principal.class), up);
-    Assert.assertNull(up.getInjectable(null, null, String.class));
+    assertEquals(up.getScope(), ComponentScope.PerRequest);
+    assertEquals(up.getInjectable(null, null, Principal.class), up);
+    assertNull(up.getInjectable(null, null, String.class));
   }
 }

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/HTestCase.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/HTestCase.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/HTestCase.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/HTestCase.java Wed Jul 18 03:46:28 2012
@@ -17,14 +17,14 @@
  */
 package org.apache.hadoop.test;
 
-import junit.framework.Assert;
+import static org.junit.Assert.fail;
+
+import java.text.MessageFormat;
 
 import org.apache.hadoop.util.Time;
 import org.junit.Rule;
 import org.junit.rules.MethodRule;
 
-import java.text.MessageFormat;
-
 public abstract class HTestCase {
 
   public static final String TEST_WAITFOR_RATIO_PROP = "test.waitfor.ratio";
@@ -161,7 +161,7 @@ public abstract class HTestCase {
       }
       if (!eval) {
         if (failIfTimeout) {
-          Assert.fail(MessageFormat.format("Waiting timed out after [{0}] msec", timeout));
+          fail(MessageFormat.format("Waiting timed out after [{0}] msec", timeout));
         } else {
           System.out.println(MessageFormat.format("Waiting timed out after [{0}] msec", timeout));
         }

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/HadoopUsersConfTestHelper.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/HadoopUsersConfTestHelper.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/HadoopUsersConfTestHelper.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/HadoopUsersConfTestHelper.java Wed Jul 18 03:46:28 2012
@@ -17,12 +17,12 @@
  */
 package org.apache.hadoop.test;
 
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.security.UserGroupInformation;
-
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.security.UserGroupInformation;
+
 /**
  * Helper to configure FileSystemAccess user/group and proxyuser
  * configuration for testing using Java System properties.

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestDirHelper.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestDirHelper.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestDirHelper.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestDirHelper.java Wed Jul 18 03:46:28 2012
@@ -17,16 +17,16 @@
  */
 package org.apache.hadoop.test;
 
-import org.junit.Test;
-import org.junit.rules.MethodRule;
-import org.junit.runners.model.FrameworkMethod;
-import org.junit.runners.model.Statement;
-
 import java.io.File;
 import java.io.IOException;
 import java.text.MessageFormat;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import org.junit.Test;
+import org.junit.rules.MethodRule;
+import org.junit.runners.model.FrameworkMethod;
+import org.junit.runners.model.Statement;
+
 public class TestDirHelper implements MethodRule {
 
   @Test

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestExceptionHelper.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestExceptionHelper.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestExceptionHelper.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestExceptionHelper.java Wed Jul 18 03:46:28 2012
@@ -17,14 +17,15 @@
  */
 package org.apache.hadoop.test;
 
-import junit.framework.Assert;
+import static org.junit.Assert.fail;
+
+import java.util.regex.Pattern;
+
 import org.junit.Test;
 import org.junit.rules.MethodRule;
 import org.junit.runners.model.FrameworkMethod;
 import org.junit.runners.model.Statement;
 
-import java.util.regex.Pattern;
-
 public class TestExceptionHelper implements MethodRule {
 
   @Test
@@ -41,7 +42,7 @@ public class TestExceptionHelper impleme
           statement.evaluate();
           if (testExceptionAnnotation != null) {
             Class<? extends Throwable> klass = testExceptionAnnotation.exception();
-            Assert.fail("Expected Exception: " + klass.getSimpleName());
+            fail("Expected Exception: " + klass.getSimpleName());
           }
         } catch (Throwable ex) {
           if (testExceptionAnnotation != null) {
@@ -50,10 +51,10 @@ public class TestExceptionHelper impleme
               String regExp = testExceptionAnnotation.msgRegExp();
               Pattern pattern = Pattern.compile(regExp);
               if (!pattern.matcher(ex.getMessage()).find()) {
-                Assert.fail("Expected Exception Message pattern: " + regExp + " got message: " + ex.getMessage());
+                fail("Expected Exception Message pattern: " + regExp + " got message: " + ex.getMessage());
               }
             } else {
-              Assert.fail("Expected Exception: " + klass.getSimpleName() + " got: " + ex.getClass().getSimpleName());
+              fail("Expected Exception: " + klass.getSimpleName() + " got: " + ex.getClass().getSimpleName());
             }
           } else {
             throw ex;

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHFSTestCase.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHFSTestCase.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHFSTestCase.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHFSTestCase.java Wed Jul 18 03:46:28 2012
@@ -18,19 +18,9 @@
 
 package org.apache.hadoop.test;
 
-import junit.framework.Assert;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.util.Time;
-import org.junit.Test;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.servlet.Context;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
@@ -39,6 +29,19 @@ import java.io.OutputStream;
 import java.net.HttpURLConnection;
 import java.net.URL;
 
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.util.Time;
+import org.junit.Test;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.servlet.Context;
+
 public class TestHFSTestCase extends HFSTestCase {
 
   @Test(expected = IllegalStateException.class)
@@ -69,7 +72,7 @@ public class TestHFSTestCase extends HFS
   @Test
   @TestDir
   public void testDirAnnotation() throws Exception {
-    Assert.assertNotNull(TestDirHelper.getTestDir());
+    assertNotNull(TestDirHelper.getTestDir());
   }
 
   @Test
@@ -81,8 +84,8 @@ public class TestHFSTestCase extends HFS
       }
     });
     long end = Time.now();
-    Assert.assertEquals(waited, 0, 50);
-    Assert.assertEquals(end - start - waited, 0, 50);
+    assertEquals(waited, 0, 50);
+    assertEquals(end - start - waited, 0, 50);
   }
 
   @Test
@@ -95,8 +98,8 @@ public class TestHFSTestCase extends HFS
       }
     });
     long end = Time.now();
-    Assert.assertEquals(waited, -1);
-    Assert.assertEquals(end - start, 200, 50);
+    assertEquals(waited, -1);
+    assertEquals(end - start, 200, 50);
   }
 
   @Test
@@ -109,8 +112,8 @@ public class TestHFSTestCase extends HFS
       }
     });
     long end = Time.now();
-    Assert.assertEquals(waited, -1);
-    Assert.assertEquals(end - start, 200 * getWaitForRatio(), 50 * getWaitForRatio());
+    assertEquals(waited, -1);
+    assertEquals(end - start, 200 * getWaitForRatio(), 50 * getWaitForRatio());
   }
 
   @Test
@@ -119,7 +122,7 @@ public class TestHFSTestCase extends HFS
     long start = Time.now();
     sleep(100);
     long end = Time.now();
-    Assert.assertEquals(end - start, 100, 50);
+    assertEquals(end - start, 100, 50);
   }
 
   @Test
@@ -128,7 +131,7 @@ public class TestHFSTestCase extends HFS
     long start = Time.now();
     sleep(100);
     long end = Time.now();
-    Assert.assertEquals(end - start, 100 * getWaitForRatio(), 50 * getWaitForRatio());
+    assertEquals(end - start, 100 * getWaitForRatio(), 50 * getWaitForRatio());
   }
 
   @Test
@@ -141,8 +144,8 @@ public class TestHFSTestCase extends HFS
       os.write(new byte[]{1});
       os.close();
       InputStream is = fs.open(new Path(TestHdfsHelper.getHdfsTestDir(), "foo"));
-      Assert.assertEquals(is.read(), 1);
-      Assert.assertEquals(is.read(), -1);
+      assertEquals(is.read(), 1);
+      assertEquals(is.read(), -1);
       is.close();
     } finally {
       fs.close();
@@ -167,9 +170,9 @@ public class TestHFSTestCase extends HFS
     server.start();
     URL url = new URL(TestJettyHelper.getJettyURL(), "/bar");
     HttpURLConnection conn = (HttpURLConnection) url.openConnection();
-    Assert.assertEquals(conn.getResponseCode(), HttpURLConnection.HTTP_OK);
+    assertEquals(conn.getResponseCode(), HttpURLConnection.HTTP_OK);
     BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
-    Assert.assertEquals(reader.readLine(), "foo");
+    assertEquals(reader.readLine(), "foo");
     reader.close();
   }
 

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHTestCase.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHTestCase.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHTestCase.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHTestCase.java Wed Jul 18 03:46:28 2012
@@ -18,23 +18,25 @@
 
 package org.apache.hadoop.test;
 
-import junit.framework.Assert;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 
-import org.apache.hadoop.util.Time;
-import org.junit.Test;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.servlet.Context;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.net.HttpURLConnection;
 import java.net.URL;
 
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.hadoop.util.Time;
+import org.junit.Test;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.servlet.Context;
+
 public class TestHTestCase extends HTestCase {
 
   @Test(expected = IllegalStateException.class)
@@ -55,7 +57,7 @@ public class TestHTestCase extends HTest
   @Test
   @TestDir
   public void testDirAnnotation() throws Exception {
-    Assert.assertNotNull(TestDirHelper.getTestDir());
+    assertNotNull(TestDirHelper.getTestDir());
   }
 
   @Test
@@ -67,8 +69,8 @@ public class TestHTestCase extends HTest
       }
     });
     long end = Time.now();
-    Assert.assertEquals(waited, 0, 50);
-    Assert.assertEquals(end - start - waited, 0, 50);
+    assertEquals(waited, 0, 50);
+    assertEquals(end - start - waited, 0, 50);
   }
 
   @Test
@@ -81,8 +83,8 @@ public class TestHTestCase extends HTest
       }
     });
     long end = Time.now();
-    Assert.assertEquals(waited, -1);
-    Assert.assertEquals(end - start, 200, 50);
+    assertEquals(waited, -1);
+    assertEquals(end - start, 200, 50);
   }
 
   @Test
@@ -95,8 +97,8 @@ public class TestHTestCase extends HTest
       }
     });
     long end = Time.now();
-    Assert.assertEquals(waited, -1);
-    Assert.assertEquals(end - start, 200 * getWaitForRatio(), 50 * getWaitForRatio());
+    assertEquals(waited, -1);
+    assertEquals(end - start, 200 * getWaitForRatio(), 50 * getWaitForRatio());
   }
 
   @Test
@@ -105,7 +107,7 @@ public class TestHTestCase extends HTest
     long start = Time.now();
     sleep(100);
     long end = Time.now();
-    Assert.assertEquals(end - start, 100, 50);
+    assertEquals(end - start, 100, 50);
   }
 
   @Test
@@ -114,7 +116,7 @@ public class TestHTestCase extends HTest
     long start = Time.now();
     sleep(100);
     long end = Time.now();
-    Assert.assertEquals(end - start, 100 * getWaitForRatio(), 50 * getWaitForRatio());
+    assertEquals(end - start, 100 * getWaitForRatio(), 50 * getWaitForRatio());
   }
 
   public static class MyServlet extends HttpServlet {
@@ -135,9 +137,9 @@ public class TestHTestCase extends HTest
     server.start();
     URL url = new URL(TestJettyHelper.getJettyURL(), "/bar");
     HttpURLConnection conn = (HttpURLConnection) url.openConnection();
-    Assert.assertEquals(conn.getResponseCode(), HttpURLConnection.HTTP_OK);
+    assertEquals(conn.getResponseCode(), HttpURLConnection.HTTP_OK);
     BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
-    Assert.assertEquals(reader.readLine(), "foo");
+    assertEquals(reader.readLine(), "foo");
     reader.close();
   }
 

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHdfsHelper.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHdfsHelper.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHdfsHelper.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHdfsHelper.java Wed Jul 18 03:46:28 2012
@@ -17,6 +17,9 @@
  */
 package org.apache.hadoop.test;
 
+import java.io.File;
+import java.util.concurrent.atomic.AtomicInteger;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -26,9 +29,6 @@ import org.junit.Test;
 import org.junit.runners.model.FrameworkMethod;
 import org.junit.runners.model.Statement;
 
-import java.io.File;
-import java.util.concurrent.atomic.AtomicInteger;
-
 public class TestHdfsHelper extends TestDirHelper {
 
   @Test

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestJettyHelper.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestJettyHelper.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestJettyHelper.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestJettyHelper.java Wed Jul 18 03:46:28 2012
@@ -17,17 +17,17 @@
  */
 package org.apache.hadoop.test;
 
+import java.net.InetAddress;
+import java.net.MalformedURLException;
+import java.net.ServerSocket;
+import java.net.URL;
+
 import org.junit.Test;
 import org.junit.rules.MethodRule;
 import org.junit.runners.model.FrameworkMethod;
 import org.junit.runners.model.Statement;
 import org.mortbay.jetty.Server;
 
-import java.net.InetAddress;
-import java.net.MalformedURLException;
-import java.net.ServerSocket;
-import java.net.URL;
-
 public class TestJettyHelper implements MethodRule {
 
   @Test

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/hdfs/TestRaidDfs.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/hdfs/TestRaidDfs.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/hdfs/TestRaidDfs.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/hdfs/TestRaidDfs.java Wed Jul 18 03:46:28 2012
@@ -17,6 +17,9 @@
  */
 package org.apache.hadoop.hdfs;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -28,8 +31,6 @@ import java.util.Random;
 import java.util.regex.Pattern;
 import java.util.zip.CRC32;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
@@ -44,8 +45,9 @@ import org.apache.hadoop.raid.RaidNode;
 import org.apache.hadoop.raid.RaidUtils;
 import org.apache.hadoop.raid.protocol.PolicyInfo.ErasureCodeType;
 import org.apache.hadoop.util.StringUtils;
+import org.junit.Test;
 
-public class TestRaidDfs extends TestCase {
+public class TestRaidDfs {
   final static String TEST_DIR = new File(System.getProperty("test.build.data",
       "target/test-data")).getAbsolutePath();
   final static String LOG_DIR = "target/raidlog";
@@ -195,6 +197,7 @@ public class TestRaidDfs extends TestCas
    * Create a file, corrupt several blocks in it and ensure that the file can be
    * read through DistributedRaidFileSystem by ReedSolomon coding.
    */
+  @Test
   public void testRaidDfsRs() throws Exception {
     LOG.info("Test testRaidDfs started.");
 
@@ -224,6 +227,7 @@ public class TestRaidDfs extends TestCas
   /**
    * Test DistributedRaidFileSystem.readFully()
    */
+  @Test
   public void testReadFully() throws Exception {
     code = ErasureCodeType.XOR;
     stripeLength = 3;
@@ -268,6 +272,7 @@ public class TestRaidDfs extends TestCas
    * Test that access time and mtime of a source file do not change after
    * raiding.
    */
+  @Test
   public void testAccessTime() throws Exception {
     LOG.info("Test testAccessTime started.");
 
@@ -300,6 +305,7 @@ public class TestRaidDfs extends TestCas
    * Create a file, corrupt a block in it and ensure that the file can be
    * read through DistributedRaidFileSystem by XOR code.
    */
+  @Test
   public void testRaidDfsXor() throws Exception {
     LOG.info("Test testRaidDfs started.");
 

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixer.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixer.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixer.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixer.java Wed Jul 18 03:46:28 2012
@@ -17,6 +17,11 @@
  */
 package org.apache.hadoop.raid;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -26,32 +31,27 @@ import java.util.List;
 import java.util.Random;
 import java.util.zip.CRC32;
 
-import org.apache.hadoop.mapreduce.server.jobtracker.JTConfig;
-import org.junit.Test;
-import static org.junit.Assert.*;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
-import org.apache.hadoop.util.JarFinder;
-import org.apache.hadoop.util.StringUtils;
-import org.apache.hadoop.util.Time;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.fs.FSDataInputStream;
-import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hdfs.DistributedFileSystem;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
+import org.apache.hadoop.hdfs.RaidDFSUtil;
+import org.apache.hadoop.hdfs.TestRaidDfs;
+import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
+import org.apache.hadoop.hdfs.protocol.LocatedBlocks;
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.hadoop.mapred.JobContext;
 import org.apache.hadoop.mapred.MiniMRCluster;
-import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
-import org.apache.hadoop.hdfs.protocol.LocatedBlocks;
-import org.apache.hadoop.hdfs.DistributedFileSystem;
-import org.apache.hadoop.hdfs.RaidDFSUtil;
-import org.apache.hadoop.hdfs.TestRaidDfs;
-import org.apache.hadoop.raid.RaidNode;
-import org.apache.hadoop.raid.RaidUtils;
+import org.apache.hadoop.mapreduce.server.jobtracker.JTConfig;
+import org.apache.hadoop.util.JarFinder;
+import org.apache.hadoop.util.StringUtils;
+import org.apache.hadoop.util.Time;
+import org.junit.Test;
 
 
 public class TestBlockFixer {

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerBlockFixDist.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerBlockFixDist.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerBlockFixDist.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerBlockFixDist.java Wed Jul 18 03:46:28 2012
@@ -17,7 +17,6 @@
  */
 package org.apache.hadoop.raid;
 import org.junit.Test;
-import static org.junit.Assert.*;
 
 public class TestBlockFixerBlockFixDist extends TestBlockFixer {
   @Test

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerDistConcurrency.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerDistConcurrency.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerDistConcurrency.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerDistConcurrency.java Wed Jul 18 03:46:28 2012
@@ -17,19 +17,19 @@
  */
 package org.apache.hadoop.raid;
 
-import org.junit.Test;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
-import org.apache.hadoop.util.StringUtils;
-import org.apache.hadoop.util.Time;
+import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hdfs.protocol.LocatedBlocks;
 import org.apache.hadoop.hdfs.DistributedFileSystem;
 import org.apache.hadoop.hdfs.RaidDFSUtil;
 import org.apache.hadoop.hdfs.TestRaidDfs;
-import org.apache.hadoop.raid.RaidNode;
+import org.apache.hadoop.hdfs.protocol.LocatedBlocks;
+import org.apache.hadoop.util.StringUtils;
+import org.apache.hadoop.util.Time;
+import org.junit.Test;
 
 public class TestBlockFixerDistConcurrency extends TestBlockFixer {
   /**

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerGeneratedBlockDist.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerGeneratedBlockDist.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerGeneratedBlockDist.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerGeneratedBlockDist.java Wed Jul 18 03:46:28 2012
@@ -18,7 +18,6 @@
 package org.apache.hadoop.raid;
 
 import org.junit.Test;
-import static org.junit.Assert.*;
 
 public class TestBlockFixerGeneratedBlockDist extends TestBlockFixer {
   /**

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerParityBlockFixDist.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerParityBlockFixDist.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerParityBlockFixDist.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestBlockFixerParityBlockFixDist.java Wed Jul 18 03:46:28 2012
@@ -18,7 +18,6 @@
 package org.apache.hadoop.raid;
 
 import org.junit.Test;
-import static org.junit.Assert.*;
 
 public class TestBlockFixerParityBlockFixDist extends TestBlockFixer {
   @Test

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestDirectoryTraversal.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestDirectoryTraversal.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestDirectoryTraversal.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestDirectoryTraversal.java Wed Jul 18 03:46:28 2012
@@ -17,27 +17,29 @@
  */
 package org.apache.hadoop.raid;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.io.File;
 import java.io.IOException;
 import java.util.LinkedList;
 import java.util.List;
 
-import junit.framework.TestCase;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.hadoop.mapred.Reporter;
-import org.apache.hadoop.util.Time;
-
 import org.apache.hadoop.raid.protocol.PolicyInfo;
+import org.apache.hadoop.util.Time;
+import org.junit.Test;
 
-public class TestDirectoryTraversal extends TestCase {
+public class TestDirectoryTraversal {
   final static Log LOG = LogFactory.getLog(
                             "org.apache.hadoop.raid.TestDirectoryTraversal");
   final static String TEST_DIR = new File(System.getProperty("test.build.data",
@@ -50,6 +52,7 @@ public class TestDirectoryTraversal exte
   /**
    * Test basic enumeration.
    */
+  @Test
   public void testEnumeration() throws IOException {
     mySetup();
 
@@ -91,6 +94,7 @@ public class TestDirectoryTraversal exte
     }
   }
 
+  @Test
   public void testSuspension() throws IOException {
     LOG.info("Starting testSuspension");
     mySetup();
@@ -128,6 +132,7 @@ public class TestDirectoryTraversal exte
     }
   }
 
+  @Test
   public void testFileFilter() throws IOException {
     mySetup();
 

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestErasureCodes.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestErasureCodes.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestErasureCodes.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestErasureCodes.java Wed Jul 18 03:46:28 2012
@@ -17,19 +17,22 @@
  */
 package org.apache.hadoop.raid;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.util.HashSet;
 import java.util.Random;
 import java.util.Set;
 
 import org.apache.hadoop.util.Time;
+import org.junit.Test;
 
-import junit.framework.TestCase;
-
-public class TestErasureCodes extends TestCase {
+public class TestErasureCodes {
   final int TEST_CODES = 100;
   final int TEST_TIMES = 1000;
   final Random RAND = new Random();
 
+  @Test
   public void testEncodeDecode() {
     for (int n = 0; n < TEST_CODES; n++) {
       int stripeSize = RAND.nextInt(99) + 1; // 1, 2, 3, ... 100
@@ -67,6 +70,7 @@ public class TestErasureCodes extends Te
     }
   }
 
+  @Test
   public void testRSPerformance() {
     int stripeSize = 10;
     int paritySize = 4;
@@ -131,6 +135,7 @@ public class TestErasureCodes extends Te
     assertTrue("Decode failed", java.util.Arrays.equals(copy, message[0]));
   }
 
+  @Test
   public void testXorPerformance() {
     java.util.Random RAND = new java.util.Random();
     int stripeSize = 10;
@@ -171,6 +176,7 @@ public class TestErasureCodes extends Te
     assertTrue("Decode failed", java.util.Arrays.equals(copy, message[0]));
   }
 
+  @Test
   public void testComputeErrorLocations() {
     for (int i = 0; i < TEST_TIMES; ++i) {
       verifyErrorLocations(10, 4, 1);

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestGaloisField.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestGaloisField.java?rev=1362753&r1=1362752&r2=1362753&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestGaloisField.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs-raid/src/test/java/org/apache/hadoop/raid/TestGaloisField.java Wed Jul 18 03:46:28 2012
@@ -17,13 +17,15 @@
  */
 package org.apache.hadoop.raid;
 
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashSet;
 import java.util.Random;
 import java.util.Set;
-import java.util.HashSet;
 
-import junit.framework.TestCase;
+import org.junit.Test;
 
-public class TestGaloisField extends TestCase {
+public class TestGaloisField {
 
   final int TEST_TIMES = 10000;
   final Random RAND = new Random();
@@ -40,6 +42,7 @@ public class TestGaloisField extends Tes
     return result;
   }
 
+  @Test
   public void testGetInstance() {
     GaloisField gf1 = GaloisField.getInstance(256, 285);
     GaloisField gf2 = GaloisField.getInstance();
@@ -52,6 +55,7 @@ public class TestGaloisField extends Tes
     assertTrue(gf5 == gf6);
   }
 
+  @Test
   public void testDistributivity() {
     for (int i = 0; i < TEST_TIMES; i++) {
       int a = RAND.nextInt(GF.getFieldSize());
@@ -64,6 +68,7 @@ public class TestGaloisField extends Tes
     }
   }
 
+  @Test
   public void testDevision() {
     for (int i = 0; i < TEST_TIMES; i++) {
       int a = RAND.nextInt(GF.getFieldSize());
@@ -77,6 +82,7 @@ public class TestGaloisField extends Tes
     }
   }
 
+  @Test
   public void testPower() {
     for (int i = 0; i < TEST_TIMES; i++) {
       int a = randGF();
@@ -90,6 +96,7 @@ public class TestGaloisField extends Tes
     }
   }
 
+  @Test
   public void testPolynomialDistributivity() {
     final int TEST_LEN = 15;
     for (int i = 0; i < TEST_TIMES; i++) {
@@ -103,6 +110,7 @@ public class TestGaloisField extends Tes
     }
   }
 
+  @Test
   public void testSubstitute() {
     final int TEST_LEN = 15;
     for (int i = 0; i < TEST_TIMES; i++) {
@@ -121,6 +129,7 @@ public class TestGaloisField extends Tes
     }
   }
 
+  @Test
   public void testSolveVandermondeSystem() {
     final int TEST_LEN = 15;
     for (int i = 0; i < TEST_TIMES; i++) {
@@ -151,6 +160,7 @@ public class TestGaloisField extends Tes
     }
   }
 
+  @Test
   public void testRemainder() {
     final int TEST_LEN = 15;
     for (int i = 0; i < TEST_TIMES; i++) {



Mime
View raw message