Author: jghoman
Date: Wed Apr 18 19:30:55 2012
New Revision: 1327637

URL: http://svn.apache.org/viewvc?rev=1327637&view=rev
Log:
GIRAPH-184. Upgrade to junit4.  Contributed by Devaraj K.

Modified:
    incubator/giraph/trunk/CHANGELOG
    incubator/giraph/trunk/pom.xml
    incubator/giraph/trunk/src/test/java/org/apache/giraph/BspCase.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestAutoCheckpoint.java
    incubator/giraph/trunk/src/test/java/org/apache/giraph/TestBspBasic.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestGraphPartitioner.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestJsonBase64Format.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestManualCheckpoint.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestMutateGraphVertex.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestNotEnoughMapTasks.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestPredicateLock.java
    incubator/giraph/trunk/src/test/java/org/apache/giraph/TestVertexTypes.java
    incubator/giraph/trunk/src/test/java/org/apache/giraph/TestZooKeeperExt.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/comm/RPCCommunicationsTest.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/ConnectedComponentsVertexTest.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/MinimumIntCombinerTest.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/SimpleShortestPathVertexTest.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/TryMultiRpcBindingPortsTest.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/graph/TestEdgeListVertex.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestAdjacencyListTextVertexOutputFormat.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestIdWithValueTextOutputFormat.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestLongDoubleDoubleAdjacencyListVertexInputFormat.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestTextDoubleDoubleAdjacencyListVertexInputFormat.java
    
incubator/giraph/trunk/src/test/java/org/apache/giraph/utils/ComparisonUtilsTest.java
    incubator/giraph/trunk/src/test/java/zk/TestZooKeeperManager.java

Modified: incubator/giraph/trunk/CHANGELOG
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/CHANGELOG?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- incubator/giraph/trunk/CHANGELOG (original)
+++ incubator/giraph/trunk/CHANGELOG Wed Apr 18 19:30:55 2012
@@ -2,6 +2,8 @@ Giraph Change Log
 
 Release 0.2.0 - unreleased
 
+  GIRAPH-184. Upgrade to junit4. (Devaraj K via jghoman)
+
   GIRAPH-176. BasicRPCCommunications has unnecessary cast of Vertex.
   (Devaraj K via jghoman)
 

Modified: incubator/giraph/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/pom.xml?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- incubator/giraph/trunk/pom.xml (original)
+++ incubator/giraph/trunk/pom.xml Wed Apr 18 19:30:55 2012
@@ -752,7 +752,7 @@ under the License.
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <version>3.8.1</version>
+      <version>4.0</version>
       <scope>test</scope>
     </dependency>
     <dependency>

Modified: incubator/giraph/trunk/src/test/java/org/apache/giraph/BspCase.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/BspCase.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- incubator/giraph/trunk/src/test/java/org/apache/giraph/BspCase.java 
(original)
+++ incubator/giraph/trunk/src/test/java/org/apache/giraph/BspCase.java Wed Apr 
18 19:30:55 2012
@@ -22,6 +22,9 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.List;
 
+import org.apache.giraph.examples.GeneratedVertexReader;
+import org.apache.giraph.graph.GiraphJob;
+import org.apache.giraph.zk.ZooKeeperExt;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
@@ -29,17 +32,12 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
-
-import org.apache.giraph.examples.GeneratedVertexReader;
-import org.apache.giraph.graph.GiraphJob;
-import org.apache.giraph.zk.ZooKeeperExt;
-
-import junit.framework.TestCase;
+import org.junit.Before;
 
 /**
  * Extended TestCase for making setting up Bsp testing.
  */
-public class BspCase extends TestCase implements Watcher {
+public class BspCase implements Watcher {
   /** JobTracker system property */
   private final String jobTracker =
       System.getProperty("prop.mapred.job.tracker");
@@ -50,6 +48,7 @@ public class BspCase extends TestCase im
   private int numWorkers = 1;
   /** ZooKeeper list system property */
   private final String zkList = System.getProperty("prop.zookeeper.list");
+  private String testName;
 
   /**
    * Adjust the configuration to the basic test case
@@ -86,13 +85,17 @@ public class BspCase extends TestCase im
     conf.setLong(GeneratedVertexReader.READER_VERTICES, 5);
   }
 
+  private String getName() {
+    return testName;
+  }
+
   /**
    * Create the test case
    *
    * @param testName name of the test case
    */
   public BspCase(String testName) {
-    super(testName);
+    this.testName = testName;
 
   }
 
@@ -160,7 +163,7 @@ public class BspCase extends TestCase im
     return singlePartFileStatus;
   }
 
-  @Override
+  @Before
   public void setUp() {
     if (jobTracker != null) {
       System.out.println("Setting tasks to 3 for " + getName() +

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestAutoCheckpoint.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/TestAutoCheckpoint.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestAutoCheckpoint.java 
(original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestAutoCheckpoint.java 
Wed Apr 18 19:30:55 2012
@@ -18,16 +18,16 @@
 
 package org.apache.giraph;
 
-import java.io.IOException;
+import static org.junit.Assert.assertTrue;
 
-import org.apache.hadoop.fs.Path;
+import java.io.IOException;
 
 import org.apache.giraph.examples.SimpleCheckpointVertex;
 import 
org.apache.giraph.examples.SimpleSuperstepVertex.SimpleSuperstepVertexInputFormat;
 import 
org.apache.giraph.examples.SimpleSuperstepVertex.SimpleSuperstepVertexOutputFormat;
 import org.apache.giraph.graph.GiraphJob;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.apache.hadoop.fs.Path;
+import org.junit.Test;
 
 /**
  * Unit test for automated checkpoint restarting
@@ -46,11 +46,9 @@ public class TestAutoCheckpoint extends 
         super(testName);
     }
 
-    /**
-     * @return the suite of tests being tested
-     */
-    public static Test suite() {
-        return new TestSuite(TestAutoCheckpoint.class);
+    
+    public TestAutoCheckpoint() {
+        super(TestAutoCheckpoint.class.getName());
     }
 
     /**
@@ -61,6 +59,7 @@ public class TestAutoCheckpoint extends 
      * @throws ClassNotFoundException
      * @throws InterruptedException
      */
+    @Test
     public void testSingleFault()
             throws IOException, InterruptedException, ClassNotFoundException {
         if (getJobTracker() == null) {

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestBspBasic.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/TestBspBasic.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- incubator/giraph/trunk/src/test/java/org/apache/giraph/TestBspBasic.java 
(original)
+++ incubator/giraph/trunk/src/test/java/org/apache/giraph/TestBspBasic.java 
Wed Apr 18 19:30:55 2012
@@ -18,8 +18,9 @@
 
 package org.apache.giraph;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
 
 import org.apache.giraph.examples.SimpleAggregatorWriter;
 import 
org.apache.giraph.examples.SimplePageRankVertex.SimplePageRankVertexInputFormat;
@@ -61,6 +62,7 @@ import java.io.DataOutputStream;
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 import java.util.List;
+import org.junit.Test;
 
 /**
  * Unit test for many simple BSP applications.
@@ -75,11 +77,8 @@ public class TestBspBasic extends BspCas
     super(testName);
   }
 
-  /**
-   * @return the suite of tests being tested
-   */
-  public static Test suite() {
-    return new TestSuite(TestBspBasic.class);
+  public TestBspBasic() {
+    super(TestBspBasic.class.getName());
   }
 
   /**
@@ -95,6 +94,7 @@ public class TestBspBasic extends BspCas
    * @throws NoSuchMethodException
    * @throws SecurityException
    */
+  @Test
   public void testInstantiateVertex()
       throws InstantiationException, IllegalAccessException,
       IOException, InterruptedException, IllegalArgumentException,
@@ -140,6 +140,7 @@ public class TestBspBasic extends BspCas
    * @throws ClassNotFoundException
    * @throws InterruptedException
    */
+  @Test
   public void testLocalJobRunnerConfig()
       throws IOException, InterruptedException, ClassNotFoundException {
     if (getJobTracker() != null) {
@@ -177,6 +178,7 @@ public class TestBspBasic extends BspCas
    * @throws ClassNotFoundException
    * @throws InterruptedException
    */
+  @Test
   public void testBspFail()
       throws IOException, InterruptedException, ClassNotFoundException {
     // Allow this test only to be run on a real Hadoop setup
@@ -202,6 +204,7 @@ public class TestBspBasic extends BspCas
    * @throws ClassNotFoundException
    * @throws InterruptedException
    */
+  @Test
   public void testBspSuperStep()
       throws IOException, InterruptedException, ClassNotFoundException {
     GiraphJob job = new GiraphJob(getCallingMethodName());
@@ -230,6 +233,7 @@ public class TestBspBasic extends BspCas
    * @throws ClassNotFoundException
    * @throws InterruptedException
    */
+  @Test
   public void testBspMsg()
       throws IOException, InterruptedException, ClassNotFoundException {
     GiraphJob job = new GiraphJob(getCallingMethodName());
@@ -248,6 +252,7 @@ public class TestBspBasic extends BspCas
    * @throws ClassNotFoundException
    * @throws InterruptedException
    */
+  @Test
   public void testEmptyVertexInputFormat()
       throws IOException, InterruptedException, ClassNotFoundException {
     GiraphJob job = new GiraphJob(getCallingMethodName());
@@ -266,6 +271,7 @@ public class TestBspBasic extends BspCas
    * @throws ClassNotFoundException
    * @throws InterruptedException
    */
+  @Test
   public void testBspCombiner()
       throws IOException, InterruptedException, ClassNotFoundException {
     GiraphJob job = new GiraphJob(getCallingMethodName());
@@ -283,6 +289,7 @@ public class TestBspBasic extends BspCas
    * @throws ClassNotFoundException
    * @throws InterruptedException
    */
+  @Test
   public void testBspPageRank()
       throws IOException, InterruptedException, ClassNotFoundException {
     GiraphJob job = new GiraphJob(getCallingMethodName());
@@ -317,6 +324,7 @@ public class TestBspBasic extends BspCas
    * @throws ClassNotFoundException
    * @throws InterruptedException
    */
+  @Test
   public void testBspShortestPaths()
       throws IOException, InterruptedException, ClassNotFoundException {
     GiraphJob job = new GiraphJob(getCallingMethodName());
@@ -354,6 +362,7 @@ public class TestBspBasic extends BspCas
    * @throws ClassNotFoundException
    * @throws InterruptedException
    */
+  @Test
   public void testBspPageRankWithAggregatorWriter()
       throws IOException, InterruptedException, ClassNotFoundException {
     GiraphJob job = new GiraphJob(getCallingMethodName());

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestGraphPartitioner.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/TestGraphPartitioner.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestGraphPartitioner.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestGraphPartitioner.java
 Wed Apr 18 19:30:55 2012
@@ -18,10 +18,10 @@
 
 package org.apache.giraph;
 
+import static org.junit.Assert.assertTrue;
+
 import java.io.IOException;
-import org.apache.hadoop.fs.FileStatus;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
+
 import org.apache.giraph.examples.GeneratedVertexReader;
 import org.apache.giraph.examples.SimpleCheckpointVertex;
 import 
org.apache.giraph.examples.SimpleSuperstepVertex.SimpleSuperstepVertexInputFormat;
@@ -30,9 +30,10 @@ import org.apache.giraph.graph.GiraphJob
 import org.apache.giraph.graph.partition.HashRangePartitionerFactory;
 import org.apache.giraph.graph.partition.PartitionBalancer;
 import org.apache.giraph.integration.SuperstepHashPartitionerFactory;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.junit.Test;
 
 /**
  * Unit test for manual checkpoint restarting
@@ -46,16 +47,11 @@ public class TestGraphPartitioner extend
     public TestGraphPartitioner(String testName) {
         super(testName);
     }
-
-    /**
-     * @return the suite of tests being tested
-     */
-    public static Test suite() {
-        return new TestSuite(TestGraphPartitioner.class);
+    
+    public TestGraphPartitioner() {
+        super(TestGraphPartitioner.class.getName());
     }
 
-
-
     /**
      * Run a sample BSP job locally and test various partitioners and
      * partition algorithms.
@@ -64,6 +60,7 @@ public class TestGraphPartitioner extend
      * @throws ClassNotFoundException
      * @throws InterruptedException
      */
+    @Test
     public void testPartitioners()
             throws IOException, InterruptedException, ClassNotFoundException {
         final int correctLen = 123;

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestJsonBase64Format.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/TestJsonBase64Format.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestJsonBase64Format.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestJsonBase64Format.java
 Wed Apr 18 19:30:55 2012
@@ -17,6 +17,7 @@
  */
 
 package org.apache.giraph;
+import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 
@@ -29,9 +30,7 @@ import org.apache.giraph.lib.JsonBase64V
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.Test;
 
 /**
  * Test out the JsonBase64 format.
@@ -45,12 +44,9 @@ public class TestJsonBase64Format extend
   public TestJsonBase64Format(String testName) {
     super(testName);
   }
-
-  /**
-   * @return the suite of tests being tested
-   */
-  public static Test suite() {
-    return new TestSuite(TestJsonBase64Format.class);
+  
+  public TestJsonBase64Format() {
+    super(TestJsonBase64Format.class.getName());
   }
 
   /**
@@ -62,6 +58,7 @@ public class TestJsonBase64Format extend
    * @throws ClassNotFoundException
    * @throws InterruptedException
    */
+  @Test
   public void testContinue()
     throws IOException, InterruptedException, ClassNotFoundException {
     GiraphJob job = new GiraphJob(getCallingMethodName());

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestManualCheckpoint.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/TestManualCheckpoint.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestManualCheckpoint.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestManualCheckpoint.java
 Wed Apr 18 19:30:55 2012
@@ -17,17 +17,17 @@
  */
 
 package org.apache.giraph;
+import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 
 import org.apache.giraph.examples.SimpleCheckpointVertex;
-import 
org.apache.giraph.examples.SimpleSuperstepVertex.SimpleSuperstepVertexOutputFormat;
 import 
org.apache.giraph.examples.SimpleSuperstepVertex.SimpleSuperstepVertexInputFormat;
+import 
org.apache.giraph.examples.SimpleSuperstepVertex.SimpleSuperstepVertexOutputFormat;
 import org.apache.giraph.graph.GiraphJob;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.Path;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.Test;
 
 /**
  * Unit test for manual checkpoint restarting
@@ -45,12 +45,9 @@ public class TestManualCheckpoint extend
   public TestManualCheckpoint(String testName) {
     super(testName);
   }
-
-  /**
-   * @return the suite of tests being tested
-   */
-  public static Test suite() {
-    return new TestSuite(TestManualCheckpoint.class);
+  
+  public TestManualCheckpoint() {
+    super(TestManualCheckpoint.class.getName());
   }
 
   /**
@@ -59,6 +56,7 @@ public class TestManualCheckpoint extend
    * @throws ClassNotFoundException
    * @throws InterruptedException
    */
+  @Test
   public void testBspCheckpoint()
       throws IOException, InterruptedException, ClassNotFoundException {
     GiraphJob job = new GiraphJob(getCallingMethodName());

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestMutateGraphVertex.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/TestMutateGraphVertex.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestMutateGraphVertex.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestMutateGraphVertex.java
 Wed Apr 18 19:30:55 2012
@@ -18,16 +18,16 @@
 
 package org.apache.giraph;
 
+import static org.junit.Assert.assertTrue;
+
 import java.io.IOException;
 
-import org.apache.hadoop.fs.Path;
 import org.apache.giraph.examples.SimpleMutateGraphVertex;
 import 
org.apache.giraph.examples.SimplePageRankVertex.SimplePageRankVertexInputFormat;
 import 
org.apache.giraph.examples.SimplePageRankVertex.SimplePageRankVertexOutputFormat;
 import org.apache.giraph.graph.GiraphJob;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.apache.hadoop.fs.Path;
+import org.junit.Test;
 
 /**
  * Unit test for graph mutation
@@ -41,12 +41,9 @@ public class TestMutateGraphVertex exten
     public TestMutateGraphVertex(String testName) {
         super(testName);
     }
-
-    /**
-     * @return the suite of tests being tested
-     */
-    public static Test suite() {
-        return new TestSuite(TestMutateGraphVertex.class);
+    
+    public TestMutateGraphVertex() {
+        super(TestMutateGraphVertex.class.getName());
     }
 
     /**
@@ -56,6 +53,7 @@ public class TestMutateGraphVertex exten
      * @throws ClassNotFoundException
      * @throws InterruptedException
      */
+    @Test
     public void testMutateGraph()
             throws IOException, InterruptedException, ClassNotFoundException {
         GiraphJob job = new GiraphJob(getCallingMethodName());

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestNotEnoughMapTasks.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/TestNotEnoughMapTasks.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestNotEnoughMapTasks.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestNotEnoughMapTasks.java
 Wed Apr 18 19:30:55 2012
@@ -18,15 +18,16 @@
 
 package org.apache.giraph;
 
+import static org.junit.Assert.assertFalse;
+
 import java.io.IOException;
 
 import org.apache.giraph.examples.SimpleCheckpointVertex;
-import 
org.apache.giraph.examples.SimpleSuperstepVertex.SimpleSuperstepVertexOutputFormat;
 import 
org.apache.giraph.examples.SimpleSuperstepVertex.SimpleSuperstepVertexInputFormat;
+import 
org.apache.giraph.examples.SimpleSuperstepVertex.SimpleSuperstepVertexOutputFormat;
 import org.apache.giraph.graph.GiraphJob;
 import org.apache.hadoop.fs.Path;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.Test;
 
 /**
  * Unit test for not enough map tasks
@@ -40,12 +41,9 @@ public class TestNotEnoughMapTasks exten
     public TestNotEnoughMapTasks(String testName) {
         super(testName);
     }
-
-    /**
-     * @return the suite of tests being tested
-     */
-    public static Test suite() {
-        return new TestSuite(TestNotEnoughMapTasks.class);
+    
+    public TestNotEnoughMapTasks() {
+        super(TestNotEnoughMapTasks.class.getName());
     }
 
     /**
@@ -55,6 +53,7 @@ public class TestNotEnoughMapTasks exten
      * @throws ClassNotFoundException
      * @throws InterruptedException
      */
+    @Test
     public void testNotEnoughMapTasks()
             throws IOException, InterruptedException, ClassNotFoundException {
         if (getJobTracker() == null) {

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestPredicateLock.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/TestPredicateLock.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestPredicateLock.java 
(original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestPredicateLock.java 
Wed Apr 18 19:30:55 2012
@@ -18,15 +18,17 @@
 
 package org.apache.giraph;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.giraph.zk.BspEvent;
 import org.apache.giraph.zk.PredicateLock;
+import org.junit.Test;
 
 /**
  * Ensure that PredicateLock objects work correctly.
  */
-public class TestPredicateLock extends TestCase {
+public class TestPredicateLock {
     private static class SignalThread extends Thread {
         private final BspEvent event;
         public SignalThread(BspEvent event) {
@@ -44,41 +46,44 @@ public class TestPredicateLock extends T
     /**
      * Make sure the the event is not signaled.
      */
+  @Test
     public void testWaitMsecsNoEvent() {
         BspEvent event = new PredicateLock();
         boolean gotPredicate = event.waitMsecs(50);
-        assertTrue(gotPredicate == false);
+        assertFalse(gotPredicate);
     }
 
     /**
      * Single threaded case
      */
+  @Test
     public void testEvent() {
         BspEvent event = new PredicateLock();
         event.signal();
         boolean gotPredicate = event.waitMsecs(-1);
-        assertTrue(gotPredicate == true);
+        assertTrue(gotPredicate );
         event.reset();
         gotPredicate = event.waitMsecs(0);
-        assertTrue(gotPredicate == false);
+        assertFalse(gotPredicate);
     }
 
     /**
      * Make sure the the event is signaled correctly
      * @throws InterruptedException
      */
+  @Test
     public void testWaitMsecs() {
         System.out.println("testWaitMsecs:");
         BspEvent event = new PredicateLock();
         Thread signalThread = new SignalThread(event);
         signalThread.start();
         boolean gotPredicate = event.waitMsecs(2000);
-        assertTrue(gotPredicate == true);
+        assertTrue(gotPredicate);
         try {
             signalThread.join();
         } catch (InterruptedException e) {
         }
         gotPredicate = event.waitMsecs(0);
-        assertTrue(gotPredicate == true);
+        assertTrue(gotPredicate);
     }
 }

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestVertexTypes.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/TestVertexTypes.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- incubator/giraph/trunk/src/test/java/org/apache/giraph/TestVertexTypes.java 
(original)
+++ incubator/giraph/trunk/src/test/java/org/apache/giraph/TestVertexTypes.java 
Wed Apr 18 19:30:55 2012
@@ -20,18 +20,15 @@ package org.apache.giraph;
 
 import java.io.IOException;
 import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
 
 import org.apache.giraph.examples.GeneratedVertexInputFormat;
 import 
org.apache.giraph.examples.SimpleSuperstepVertex.SimpleSuperstepVertexInputFormat;
 import org.apache.giraph.graph.BasicVertex;
-import org.apache.giraph.graph.GiraphJob;
 import org.apache.giraph.graph.EdgeListVertex;
+import org.apache.giraph.graph.GiraphJob;
+import org.apache.giraph.graph.GraphMapper;
 import org.apache.giraph.graph.VertexCombiner;
 import org.apache.giraph.graph.VertexInputFormat;
-import org.apache.giraph.graph.GraphMapper;
 import org.apache.giraph.graph.VertexOutputFormat;
 import org.apache.giraph.lib.JsonBase64VertexInputFormat;
 import org.apache.giraph.lib.JsonBase64VertexOutputFormat;
@@ -41,11 +38,10 @@ import org.apache.hadoop.io.DoubleWritab
 import org.apache.hadoop.io.FloatWritable;
 import org.apache.hadoop.io.IntWritable;
 import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.io.Writable;
+import org.junit.Test;
 
 
-public class TestVertexTypes
-    extends TestCase {
+public class TestVertexTypes {
 
     /**
      * Matches the {@link GeneratedVertexInputFormat}
@@ -104,6 +100,7 @@ public class TestVertexTypes
         }
     }
 
+    @Test
     public void testMatchingType() throws SecurityException,
             NoSuchMethodException, NoSuchFieldException {
         @SuppressWarnings("rawtypes")
@@ -121,6 +118,7 @@ public class TestVertexTypes
         mapper.determineClassTypes(conf);
     }
 
+    @Test
     public void testDerivedMatchingType() throws SecurityException,
             NoSuchMethodException, NoSuchFieldException {
         @SuppressWarnings("rawtypes")
@@ -135,6 +133,7 @@ public class TestVertexTypes
         mapper.determineClassTypes(conf);
     }
 
+    @Test
     public void testDerivedInputFormatType() throws SecurityException,
             NoSuchMethodException, NoSuchFieldException {
         @SuppressWarnings("rawtypes")
@@ -149,6 +148,7 @@ public class TestVertexTypes
         mapper.determineClassTypes(conf);
     }
 
+    @Test
     public void testMismatchingVertex() throws SecurityException,
             NoSuchMethodException, NoSuchFieldException {
         @SuppressWarnings("rawtypes")
@@ -167,7 +167,8 @@ public class TestVertexTypes
         } catch (IllegalArgumentException e) {
         }
     }
-
+    
+    @Test
     public void testMismatchingCombiner() throws SecurityException,
             NoSuchMethodException, NoSuchFieldException {
         @SuppressWarnings("rawtypes")
@@ -190,6 +191,7 @@ public class TestVertexTypes
         }
     }
 
+    @Test
     public void testJsonBase64FormatType() throws SecurityException,
             NoSuchMethodException, NoSuchFieldException {
         @SuppressWarnings("rawtypes")

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestZooKeeperExt.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/TestZooKeeperExt.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestZooKeeperExt.java 
(original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/TestZooKeeperExt.java 
Wed Apr 18 19:30:55 2012
@@ -18,6 +18,8 @@
 
 package org.apache.giraph;
 
+import static org.junit.Assert.assertTrue;
+
 import java.util.List;
 
 import org.apache.giraph.zk.ZooKeeperExt;
@@ -26,11 +28,11 @@ import org.apache.zookeeper.KeeperExcept
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
 import org.apache.zookeeper.ZooDefs.Ids;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
 
-import junit.framework.TestCase;
-
-public class TestZooKeeperExt
-        extends TestCase implements Watcher {
+public class TestZooKeeperExt implements Watcher {
     /** ZooKeeperExt instance */
     private ZooKeeperExt zooKeeperExt = null;
     /** ZooKeeper server list */
@@ -43,7 +45,7 @@ public class TestZooKeeperExt
         return;
     }
 
-    @Override
+    @Before
     public void setUp() {
         try {
             if (zkList == null) {
@@ -59,7 +61,7 @@ public class TestZooKeeperExt
         }
     }
 
-    @Override
+    @After
     public void tearDown() {
         if (zooKeeperExt == null) {
             return;
@@ -71,6 +73,7 @@ public class TestZooKeeperExt
         }
     }
 
+    @Test
     public void testCreateExt() throws KeeperException, InterruptedException {
         if (zooKeeperExt == null) {
             System.out.println(
@@ -88,6 +91,7 @@ public class TestZooKeeperExt
         zooKeeperExt.delete(BASE_PATH, -1);
     }
 
+    @Test
     public void testDeleteExt() throws KeeperException, InterruptedException {
         if (zooKeeperExt == null) {
             System.out.println(
@@ -111,6 +115,7 @@ public class TestZooKeeperExt
         zooKeeperExt.deleteExt(BASE_PATH, -1, true);
     }
 
+    @Test
     public void testGetChildrenExt()
         throws KeeperException, InterruptedException {
         if (zooKeeperExt == null) {

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/comm/RPCCommunicationsTest.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/comm/RPCCommunicationsTest.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/comm/RPCCommunicationsTest.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/comm/RPCCommunicationsTest.java
 Wed Apr 18 19:30:55 2012
@@ -18,19 +18,20 @@
 
 package org.apache.giraph.comm;
 
+import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
-import junit.framework.TestCase;
-
 import org.apache.giraph.graph.GiraphJob;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.IntWritable;
 import org.apache.hadoop.mapreduce.JobID;
 import org.apache.hadoop.mapreduce.Mapper.Context;
+import org.junit.Test;
 
-public class RPCCommunicationsTest extends TestCase {
+public class RPCCommunicationsTest {
 
+    @Test
     public void testDuplicateRpcPort() throws Exception {
         @SuppressWarnings("rawtypes")
         Context context = mock(Context.class);

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/ConnectedComponentsVertexTest.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/ConnectedComponentsVertexTest.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/ConnectedComponentsVertexTest.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/ConnectedComponentsVertexTest.java
 Wed Apr 18 19:30:55 2012
@@ -18,25 +18,29 @@
 
 package org.apache.giraph.examples;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Set;
+
+import org.apache.giraph.utils.InternalVertexRunner;
+import org.junit.Test;
+
 import com.google.common.base.Splitter;
 import com.google.common.collect.HashMultimap;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Maps;
 import com.google.common.collect.SetMultimap;
-import junit.framework.TestCase;
-
-import org.apache.giraph.utils.InternalVertexRunner;
-
-import java.util.Set;
 
 /**
  *  Tests for {@link ConnectedComponentsVertex}
  */
-public class ConnectedComponentsVertexTest extends TestCase {
+public class ConnectedComponentsVertexTest {
 
     /**
      * A local integration test on toy data
      */
+    @Test
     public void testToyData() throws Exception {
 
         // a small graph with three components

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/MinimumIntCombinerTest.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/MinimumIntCombinerTest.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/MinimumIntCombinerTest.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/MinimumIntCombinerTest.java
 Wed Apr 18 19:30:55 2012
@@ -18,17 +18,18 @@
 
 package org.apache.giraph.examples;
 
-import junit.framework.TestCase;
-import org.apache.giraph.graph.VertexCombiner;
-import org.apache.hadoop.io.IntWritable;
-
-import com.google.common.collect.Iterables;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
-import java.io.IOException;
 import java.util.Arrays;
 
-public class MinimumIntCombinerTest extends TestCase {
+import org.apache.giraph.graph.VertexCombiner;
+import org.apache.hadoop.io.IntWritable;
+import org.junit.Test;
+
+public class MinimumIntCombinerTest {
 
+    @Test
     public void testCombiner() throws Exception {
 
         VertexCombiner<IntWritable, IntWritable> combiner =

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/SimpleShortestPathVertexTest.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/SimpleShortestPathVertexTest.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/SimpleShortestPathVertexTest.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/SimpleShortestPathVertexTest.java
 Wed Apr 18 19:30:55 2012
@@ -18,10 +18,12 @@
 
 package org.apache.giraph.examples;
 
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Map;
+
 import org.apache.giraph.utils.InternalVertexRunner;
 import org.apache.giraph.utils.MockUtils;
 import org.apache.hadoop.io.DoubleWritable;
@@ -29,18 +31,22 @@ import org.apache.hadoop.io.FloatWritabl
 import org.apache.hadoop.io.LongWritable;
 import org.json.JSONArray;
 import org.json.JSONException;
+import org.junit.Test;
 import org.mockito.Mockito;
 
-import java.util.Map;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 
 /**
  * Contains a simple unit test for {@link SimpleShortestPathsVertex}
  */
-public class SimpleShortestPathVertexTest extends TestCase {
+public class SimpleShortestPathVertexTest {
 
   /**
    * Test the behavior when a shorter path to a vertex has been found
    */
+  @Test
   public void testOnShorterPathFound() throws Exception {
 
     SimpleShortestPathsVertex vertex = new SimpleShortestPathsVertex();
@@ -71,6 +77,7 @@ public class SimpleShortestPathVertexTes
    * Test the behavior when a new, but not shorter path to a vertex has been
    * found.
    */
+  @Test
   public void testOnNoShorterPathFound() throws Exception {
 
     SimpleShortestPathsVertex vertex = new SimpleShortestPathsVertex();
@@ -98,6 +105,7 @@ public class SimpleShortestPathVertexTes
   /**
    * A local integration test on toy data
    */
+  @Test
   public void testToyData() throws Exception {
 
     // a small four vertex graph

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/TryMultiRpcBindingPortsTest.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/TryMultiRpcBindingPortsTest.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/TryMultiRpcBindingPortsTest.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/examples/TryMultiRpcBindingPortsTest.java
 Wed Apr 18 19:30:55 2012
@@ -18,13 +18,15 @@
 
 package org.apache.giraph.examples;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.util.Map;
 import java.util.Set;
 
-import junit.framework.TestCase;
-
 import org.apache.giraph.graph.GiraphJob;
 import org.apache.giraph.utils.InternalVertexRunner;
+import org.junit.Test;
 
 import com.google.common.base.Splitter;
 import com.google.common.collect.HashMultimap;
@@ -35,11 +37,12 @@ import com.google.common.collect.SetMult
 /**
  *  Tests for {@link TryMultiRpcBindingPortsTest}
  */
-public class TryMultiRpcBindingPortsTest extends TestCase {
+public class TryMultiRpcBindingPortsTest {
 
     /**
      * A local integration test on toy data
      */
+    @Test
     public void testToyData() throws Exception {
 
         // a small graph with three components

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/graph/TestEdgeListVertex.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/graph/TestEdgeListVertex.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/graph/TestEdgeListVertex.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/graph/TestEdgeListVertex.java
 Wed Apr 18 19:30:55 2012
@@ -17,30 +17,33 @@
  */
 package org.apache.giraph.graph;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
-import junit.framework.TestCase;
-import org.apache.giraph.graph.GiraphJob;
-import org.apache.giraph.utils.WritableUtils;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 
+import org.apache.giraph.utils.WritableUtils;
 import org.apache.hadoop.io.DoubleWritable;
 import org.apache.hadoop.io.FloatWritable;
 import org.apache.hadoop.io.IntWritable;
 import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
+import org.junit.Before;
+import org.junit.Test;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
 /**
  * Tests {@link EdgeListVertex}.
  */
-public class TestEdgeListVertex extends TestCase {
+public class TestEdgeListVertex {
   /** Instantiated vertex filled in from setup() */
   private IFDLEdgeListVertex vertex;
   /** Job filled in by setup() */
@@ -58,7 +61,7 @@ public class TestEdgeListVertex extends 
     }
   }
 
-  @Override
+  @Before
   public void setUp() {
     try {
       job = new GiraphJob("TestEdgeArrayVertex");
@@ -79,10 +82,12 @@ public class TestEdgeListVertex extends 
       createVertex(job.getConfiguration());
   }
 
+  @Test
   public void testInstantiate() throws IOException {
     assertNotNull(vertex);
   }
 
+  @Test
   public void testEdges() {
     Map<IntWritable, DoubleWritable> edgeMap = Maps.newHashMap();
     for (int i = 1000; i > 0; --i) {
@@ -102,6 +107,7 @@ public class TestEdgeListVertex extends 
     assertEquals(vertex.getNumOutEdges(), 999);
   }
 
+  @Test
   public void testGetEdges() {
     Map<IntWritable, DoubleWritable> edgeMap = Maps.newHashMap();
     for (int i = 1000; i > 0; --i) {
@@ -120,6 +126,7 @@ public class TestEdgeListVertex extends 
         new DoubleWritable(700 * 3.0));
   }
 
+  @Test
   public void testAddRemoveEdges() {
     Map<IntWritable, DoubleWritable> edgeMap = Maps.newHashMap();
     vertex.initialize(null, null, edgeMap, null);
@@ -154,6 +161,7 @@ public class TestEdgeListVertex extends 
     assertEquals(vertex.getNumOutEdges(), 0);
   }
 
+  @Test
   public void testSerialize() {
     Map<IntWritable, DoubleWritable> edgeMap = Maps.newHashMap();
     for (int i = 1000; i > 0; --i) {

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestAdjacencyListTextVertexOutputFormat.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestAdjacencyListTextVertexOutputFormat.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestAdjacencyListTextVertexOutputFormat.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestAdjacencyListTextVertexOutputFormat.java
 Wed Apr 18 19:30:55 2012
@@ -17,26 +17,29 @@
  */
 package org.apache.giraph.lib;
 
-import junit.framework.TestCase;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+
 import org.apache.giraph.graph.BasicVertex;
+import 
org.apache.giraph.lib.AdjacencyListTextVertexOutputFormat.AdjacencyListVertexWriter;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.DoubleWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.mapreduce.RecordWriter;
 import org.apache.hadoop.mapreduce.TaskAttemptContext;
+import org.junit.Test;
 import org.mockito.Matchers;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import static 
org.apache.giraph.lib.AdjacencyListTextVertexOutputFormat.AdjacencyListVertexWriter;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+public class TestAdjacencyListTextVertexOutputFormat {
 
-public class TestAdjacencyListTextVertexOutputFormat extends TestCase {
+  @Test
   public void testVertexWithNoEdges() throws IOException, InterruptedException 
{
     Configuration conf = new Configuration();
     TaskAttemptContext tac = mock(TaskAttemptContext.class);
@@ -59,6 +62,7 @@ public class TestAdjacencyListTextVertex
     verify(vertex, times(0)).getEdgeValue(Matchers.<WritableComparable>any());
   }
 
+  @Test
   public void testVertexWithEdges() throws IOException, InterruptedException {
     Configuration conf = new Configuration();
     TaskAttemptContext tac = mock(TaskAttemptContext.class);
@@ -87,6 +91,7 @@ public class TestAdjacencyListTextVertex
     verify(vertex, times(2)).getEdgeValue(Matchers.<WritableComparable>any());
   }
 
+  @Test
   public void testWithDifferentDelimiter() throws IOException, 
InterruptedException {
     Configuration conf = new Configuration();
     conf.set(AdjacencyListVertexWriter.LINE_TOKENIZE_VALUE, ":::");

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestIdWithValueTextOutputFormat.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestIdWithValueTextOutputFormat.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestIdWithValueTextOutputFormat.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestIdWithValueTextOutputFormat.java
 Wed Apr 18 19:30:55 2012
@@ -18,28 +18,29 @@
 
 package org.apache.giraph.lib;
 
-import junit.framework.TestCase;
+import static 
org.apache.giraph.lib.IdWithValueTextOutputFormat.IdWithValueVertexWriter.LINE_TOKENIZE_VALUE;
+import static 
org.apache.giraph.lib.IdWithValueTextOutputFormat.IdWithValueVertexWriter.REVERSE_ID_AND_VALUE;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.util.ArrayList;
+
 import org.apache.giraph.graph.BasicVertex;
+import 
org.apache.giraph.lib.IdWithValueTextOutputFormat.IdWithValueVertexWriter;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.DoubleWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.mapreduce.RecordWriter;
 import org.apache.hadoop.mapreduce.TaskAttemptContext;
+import org.junit.Test;
 import org.mockito.Matchers;
 
-import java.io.IOException;
-import java.util.ArrayList;
-
-import static 
org.apache.giraph.lib.IdWithValueTextOutputFormat.IdWithValueVertexWriter;
-import static 
org.apache.giraph.lib.IdWithValueTextOutputFormat.IdWithValueVertexWriter.LINE_TOKENIZE_VALUE;
-import static 
org.apache.giraph.lib.IdWithValueTextOutputFormat.IdWithValueVertexWriter.REVERSE_ID_AND_VALUE;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-public class TestIdWithValueTextOutputFormat extends TestCase {
+public class TestIdWithValueTextOutputFormat {
+  @Test
   public void testHappyPath() throws IOException, InterruptedException {
     Configuration conf = new Configuration();
     Text expected = new Text("Four Tops\t4.0");
@@ -47,6 +48,7 @@ public class TestIdWithValueTextOutputFo
     IdWithValueTestWorker(conf, expected);
   }
 
+  @Test
   public void testReverseIdAndValue() throws IOException, InterruptedException 
{
     Configuration conf = new Configuration();
     conf.setBoolean(REVERSE_ID_AND_VALUE, true);
@@ -55,6 +57,7 @@ public class TestIdWithValueTextOutputFo
     IdWithValueTestWorker(conf, expected);
   }
 
+  @Test
   public void testWithDifferentDelimiter()  throws IOException,
       InterruptedException {
     Configuration conf = new Configuration();

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestLongDoubleDoubleAdjacencyListVertexInputFormat.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestLongDoubleDoubleAdjacencyListVertexInputFormat.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestLongDoubleDoubleAdjacencyListVertexInputFormat.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestLongDoubleDoubleAdjacencyListVertexInputFormat.java
 Wed Apr 18 19:30:55 2012
@@ -18,12 +18,22 @@
 package org.apache.giraph.lib;
 
 
-import junit.framework.TestCase;
+import static 
org.apache.giraph.lib.TestTextDoubleDoubleAdjacencyListVertexInputFormat.assertValidVertex;
+import static 
org.apache.giraph.lib.TestTextDoubleDoubleAdjacencyListVertexInputFormat.setGraphState;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.util.Iterator;
+
 import org.apache.giraph.graph.BasicVertex;
 import org.apache.giraph.graph.Edge;
+import org.apache.giraph.graph.EdgeListVertex;
 import org.apache.giraph.graph.GiraphJob;
 import org.apache.giraph.graph.GraphState;
-import org.apache.giraph.graph.EdgeListVertex;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.BooleanWritable;
 import org.apache.hadoop.io.DoubleWritable;
@@ -32,22 +42,17 @@ import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.mapreduce.RecordReader;
 import org.apache.hadoop.mapreduce.TaskAttemptContext;
+import org.junit.Before;
+import org.junit.Test;
 
-import java.io.IOException;
-import java.util.Iterator;
-
-import static 
org.apache.giraph.lib.TestTextDoubleDoubleAdjacencyListVertexInputFormat.assertValidVertex;
-import static 
org.apache.giraph.lib.TestTextDoubleDoubleAdjacencyListVertexInputFormat.setGraphState;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-public class TestLongDoubleDoubleAdjacencyListVertexInputFormat extends 
TestCase {
+public class TestLongDoubleDoubleAdjacencyListVertexInputFormat {
 
   private RecordReader<LongWritable, Text> rr;
   private Configuration conf;
   private TaskAttemptContext tac;
   private GraphState<LongWritable, DoubleWritable, DoubleWritable, 
BooleanWritable> graphState;
 
+  @Before
   public void setUp() throws IOException, InterruptedException {
     rr = mock(RecordReader.class);
     when(rr.nextKeyValue()).thenReturn(true);
@@ -60,6 +65,7 @@ public class TestLongDoubleDoubleAdjacen
     when(tac.getConfiguration()).thenReturn(conf);
   }
 
+  @Test
   public void testIndexMustHaveValue() throws IOException, 
InterruptedException {
     String input = "123";
 
@@ -78,6 +84,7 @@ public class TestLongDoubleDoubleAdjacen
     }
   }
 
+  @Test
   public void testEdgesMustHaveValues() throws IOException, 
InterruptedException {
     String input = "99\t55.2\t100";
 
@@ -96,6 +103,7 @@ public class TestLongDoubleDoubleAdjacen
     }
   }
 
+  @Test
   public void testHappyPath() throws Exception {
     String input = "42\t0.1\t99\t0.2\t2000\t0.3\t4000\t0.4";
 
@@ -117,6 +125,7 @@ public class TestLongDoubleDoubleAdjacen
     assertEquals(vertex.getNumOutEdges(), 3);
   }
 
+  @Test
   public void testDifferentSeparators() throws Exception {
     String input = "12345:42.42:9999999:99.9";
 

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestTextDoubleDoubleAdjacencyListVertexInputFormat.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestTextDoubleDoubleAdjacencyListVertexInputFormat.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestTextDoubleDoubleAdjacencyListVertexInputFormat.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/lib/TestTextDoubleDoubleAdjacencyListVertexInputFormat.java
 Wed Apr 18 19:30:55 2012
@@ -17,16 +17,25 @@
  */
 package org.apache.giraph.lib;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import junit.framework.TestCase;
 import org.apache.giraph.graph.BasicVertex;
 import org.apache.giraph.graph.BspUtils;
 import org.apache.giraph.graph.Edge;
+import org.apache.giraph.graph.EdgeListVertex;
 import org.apache.giraph.graph.GiraphJob;
 import org.apache.giraph.graph.GraphState;
-import org.apache.giraph.graph.EdgeListVertex;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.BooleanWritable;
 import org.apache.hadoop.io.DoubleWritable;
@@ -36,24 +45,20 @@ import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.mapreduce.RecordReader;
 import org.apache.hadoop.mapreduce.TaskAttemptContext;
+import org.junit.Before;
+import org.junit.Test;
 
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 
-public class TestTextDoubleDoubleAdjacencyListVertexInputFormat extends 
TestCase {
+public class TestTextDoubleDoubleAdjacencyListVertexInputFormat {
 
   private RecordReader<LongWritable, Text> rr;
   private Configuration conf;
   private TaskAttemptContext tac;
   private GraphState<Text, DoubleWritable, DoubleWritable, BooleanWritable> 
graphState;
 
+  @Before
   public void setUp() throws IOException, InterruptedException {
     rr = mock(RecordReader.class);
     when(rr.nextKeyValue()).thenReturn(true).thenReturn(false);
@@ -66,6 +71,7 @@ public class TestTextDoubleDoubleAdjacen
     when(tac.getConfiguration()).thenReturn(conf);
   }
 
+  @Test
   public void testIndexMustHaveValue() throws IOException, 
InterruptedException {
     String input = "hi";
 
@@ -84,6 +90,7 @@ public class TestTextDoubleDoubleAdjacen
     }
   }
 
+  @Test
   public void testEdgesMustHaveValues() throws IOException, 
InterruptedException {
     String input = "index\t55.66\tindex2";
 
@@ -145,6 +152,7 @@ public class TestTextDoubleDoubleAdjacen
     }
   }
 
+  @Test
   public void testHappyPath() throws Exception {
     String input = "Hi\t0\tCiao\t1.123\tBomdia\t2.234\tOla\t3.345";
 
@@ -164,6 +172,7 @@ public class TestTextDoubleDoubleAdjacen
     assertEquals(vertex.getNumOutEdges(), 3);
   }
 
+  @Test
   public void testLineSanitizer() throws Exception {
     String input = "Bye\t0.01\tCiao\t1.001\tTchau\t2.0001\tAdios\t3.00001";
 
@@ -193,6 +202,7 @@ public class TestTextDoubleDoubleAdjacen
     assertEquals(vertex.getNumOutEdges(), 3);
   }
 
+  @Test
   public void testDifferentSeparators() throws Exception {
     String input = "alpha:42:beta:99";
 

Modified: 
incubator/giraph/trunk/src/test/java/org/apache/giraph/utils/ComparisonUtilsTest.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/org/apache/giraph/utils/ComparisonUtilsTest.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- 
incubator/giraph/trunk/src/test/java/org/apache/giraph/utils/ComparisonUtilsTest.java
 (original)
+++ 
incubator/giraph/trunk/src/test/java/org/apache/giraph/utils/ComparisonUtilsTest.java
 Wed Apr 18 19:30:55 2012
@@ -18,11 +18,16 @@
 
 package org.apache.giraph.utils;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
 import com.google.common.collect.Lists;
-import junit.framework.TestCase;
 
-public class ComparisonUtilsTest extends TestCase {
+public class ComparisonUtilsTest {
 
+    @Test
     public void testEquality() {
         Iterable<String> one = Lists.newArrayList("one", "two", "three");
         Iterable<String> two = Lists.newArrayList("one", "two", "three");
@@ -33,6 +38,7 @@ public class ComparisonUtilsTest extends
         assertTrue(ComparisonUtils.equal(two, one));
     }
 
+    @Test
     public void testEqualityEmpty() {
         Iterable<String> one = Lists.newArrayList();
         Iterable<String> two = Lists.newArrayList();
@@ -43,6 +49,7 @@ public class ComparisonUtilsTest extends
         assertTrue(ComparisonUtils.equal(two, one));
     }
 
+    @Test
     public void testInEquality() {
         Iterable<String> one = Lists.newArrayList("one", "two", "three");
         Iterable<String> two = Lists.newArrayList("two", "three", "four");
@@ -56,6 +63,7 @@ public class ComparisonUtilsTest extends
         assertFalse(ComparisonUtils.equal(three, two));
     }
 
+    @Test
     public void testInEqualityDifferentLengths() {
         Iterable<String> one = Lists.newArrayList("one", "two", "three");
         Iterable<String> two = Lists.newArrayList("one", "two", "three", 
"four");

Modified: incubator/giraph/trunk/src/test/java/zk/TestZooKeeperManager.java
URL: 
http://svn.apache.org/viewvc/incubator/giraph/trunk/src/test/java/zk/TestZooKeeperManager.java?rev=1327637&r1=1327636&r2=1327637&view=diff
==============================================================================
--- incubator/giraph/trunk/src/test/java/zk/TestZooKeeperManager.java (original)
+++ incubator/giraph/trunk/src/test/java/zk/TestZooKeeperManager.java Wed Apr 
18 19:30:55 2012
@@ -17,12 +17,17 @@
  */
 package zk;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import org.apache.giraph.graph.GiraphJob;
 import org.apache.giraph.zk.ZooKeeperManager;
 import org.apache.hadoop.conf.Configuration;
+import org.junit.Test;
 
-public class TestZooKeeperManager extends TestCase {
+public class TestZooKeeperManager {
+  @Test
   public void testGetBasePath() {
     Configuration conf = new Configuration();
 


Reply via email to