Modified: 
nutch/branches/2.x/src/test/org/apache/nutch/indexer/TestIndexingFilters.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/indexer/TestIndexingFilters.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- 
nutch/branches/2.x/src/test/org/apache/nutch/indexer/TestIndexingFilters.java 
(original)
+++ 
nutch/branches/2.x/src/test/org/apache/nutch/indexer/TestIndexingFilters.java 
Sun May 19 21:11:54 2013
@@ -16,7 +16,8 @@
  */
 package org.apache.nutch.indexer;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
 import org.apache.avro.util.Utf8;
 import org.apache.hadoop.conf.Configuration;
@@ -24,12 +25,13 @@ import org.apache.nutch.metadata.Metadat
 import org.apache.nutch.storage.WebPage;
 import org.apache.nutch.util.NutchConfiguration;
 
-public class TestIndexingFilters extends TestCase {
+public class TestIndexingFilters {
 
   /**
    * Test behaviour when defined filter does not exist.
    * @throws IndexingException
    */
+  @Test
   public void testNonExistingIndexingFilter() throws IndexingException {
     Configuration conf = NutchConfiguration.create();
     conf.addResource("nutch-default.xml");
@@ -50,6 +52,7 @@ public class TestIndexingFilters extends
    * Test behaviour when NutchDOcument is null
    * @throws IndexingException
    */
+  @Test
   public void testNutchDocumentNullIndexingFilter() throws IndexingException{
     Configuration conf = NutchConfiguration.create();
     conf.addResource("nutch-default.xml");
@@ -64,38 +67,38 @@ public class TestIndexingFilters extends
     assertNull(doc);
   }
 
-    /**
-     * Test behaviour when reset the index filter order will not take effect
-     *
-     * @throws IndexingException
-     */
-    public void testFilterCacheIndexingFilter() throws IndexingException{
-        Configuration conf = NutchConfiguration.create();
-        conf.addResource("nutch-default.xml");
-        conf.addResource("crawl-tests.xml");
-
-        String class1 = "org.apache.nutch.indexer.basic.BasicIndexingFilter";
-        conf.set(IndexingFilters.INDEXINGFILTER_ORDER, class1);
-
-        IndexingFilters filters1 = new IndexingFilters(conf);
-        WebPage page = new WebPage();
-        page.setText(new Utf8("text"));
-        page.setTitle(new Utf8("title"));
-        NutchDocument fdoc1 = filters1.filter(new 
NutchDocument(),"http://www.example.com/",page);
-
-        // add another index filter
-        String class2 = "org.apache.nutch.indexer.metadata.MetadataIndexer";
-        // set content metadata
-        Metadata md = new Metadata();
-        md.add("example","data");
-        // set content metadata property defined in MetadataIndexer
-        conf.set("index.content.md","example");
-        // add MetadataIndxer filter
-        conf.set(IndexingFilters.INDEXINGFILTER_ORDER, class1 + " " + class2);
-        IndexingFilters filters2 = new IndexingFilters(conf);
-        NutchDocument fdoc2 = filters2.filter(new 
NutchDocument(),"http://www.example.com/",page);
-        
assertEquals(fdoc1.getFieldNames().size(),fdoc2.getFieldNames().size());
-    }
+  /**
+   * Test behaviour when reset the index filter order will not take effect
+   *
+   * @throws IndexingException
+   */
+  @Test
+  public void testFilterCacheIndexingFilter() throws IndexingException{
+    Configuration conf = NutchConfiguration.create();
+    conf.addResource("nutch-default.xml");
+    conf.addResource("crawl-tests.xml");
+
+    String class1 = "org.apache.nutch.indexer.basic.BasicIndexingFilter";
+    conf.set(IndexingFilters.INDEXINGFILTER_ORDER, class1);
 
+    IndexingFilters filters1 = new IndexingFilters(conf);
+    WebPage page = new WebPage();
+    page.setText(new Utf8("text"));
+    page.setTitle(new Utf8("title"));
+    NutchDocument fdoc1 = filters1.filter(new 
NutchDocument(),"http://www.example.com/",page);
+
+    // add another index filter
+    String class2 = "org.apache.nutch.indexer.metadata.MetadataIndexer";
+    // set content metadata
+    Metadata md = new Metadata();
+    md.add("example","data");
+    // set content metadata property defined in MetadataIndexer
+    conf.set("index.content.md","example");
+    // add MetadataIndxer filter
+    conf.set(IndexingFilters.INDEXINGFILTER_ORDER, class1 + " " + class2);
+    IndexingFilters filters2 = new IndexingFilters(conf);
+    NutchDocument fdoc2 = filters2.filter(new 
NutchDocument(),"http://www.example.com/",page);
+    assertEquals(fdoc1.getFieldNames().size(),fdoc2.getFieldNames().size());
+  }
 
 }

Modified: 
nutch/branches/2.x/src/test/org/apache/nutch/metadata/TestMetadata.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/metadata/TestMetadata.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- nutch/branches/2.x/src/test/org/apache/nutch/metadata/TestMetadata.java 
(original)
+++ nutch/branches/2.x/src/test/org/apache/nutch/metadata/TestMetadata.java Sun 
May 19 21:11:54 2013
@@ -22,30 +22,16 @@ import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.util.Properties;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
 /**
  * JUnit based tests of class {@link org.apache.nutch.metadata.Metadata}.
  */
-public class TestMetadata extends TestCase {
+public class TestMetadata {
 
   private static final String CONTENTTYPE = "contenttype";
 
-  public TestMetadata(String testName) {
-    super(testName);
-  }
-
-  public static Test suite() {
-    return new TestSuite(TestMetadata.class);
-  }
-
-  public static void main(String[] args) {
-    TestRunner.run(suite());
-  }
-  
   /**
    * Test to ensure that only non-null values get written when the
    * {@link Metadata} object is written using a Writeable.
@@ -53,6 +39,7 @@ public class TestMetadata extends TestCa
    * @since NUTCH-406
    * 
    */
+  @Test
   public void testWriteNonNull() {
     Metadata met = new Metadata();
     met.add(CONTENTTYPE, null);
@@ -83,6 +70,7 @@ public class TestMetadata extends TestCa
   }
 
   /** Test for the <code>add(String, String)</code> method. */
+  @Test
   public void testAdd() {
     String[] values = null;
     Metadata meta = new Metadata();
@@ -112,6 +100,7 @@ public class TestMetadata extends TestCa
   }
 
   /** Test for the <code>set(String, String)</code> method. */
+  @Test
   public void testSet() {
     String[] values = null;
     Metadata meta = new Metadata();
@@ -138,6 +127,7 @@ public class TestMetadata extends TestCa
   }
 
   /** Test for <code>setAll(Properties)</code> method. */
+  @Test
   public void testSetProperties() {
     String[] values = null;
     Metadata meta = new Metadata();
@@ -165,6 +155,7 @@ public class TestMetadata extends TestCa
   }
 
   /** Test for <code>get(String)</code> method. */
+  @Test
   public void testGet() {
     Metadata meta = new Metadata();
     assertNull(meta.get("a-name"));
@@ -175,6 +166,7 @@ public class TestMetadata extends TestCa
   }
 
   /** Test for <code>isMultiValued()</code> method. */
+  @Test
   public void testIsMultiValued() {
     Metadata meta = new Metadata();
     assertFalse(meta.isMultiValued("key"));
@@ -185,6 +177,7 @@ public class TestMetadata extends TestCa
   }
 
   /** Test for <code>names</code> method. */
+  @Test
   public void testNames() {
     String[] names = null;
     Metadata meta = new Metadata();
@@ -201,6 +194,7 @@ public class TestMetadata extends TestCa
   }
 
   /** Test for <code>remove(String)</code> method. */
+  @Test
   public void testRemove() {
     Metadata meta = new Metadata();
     meta.remove("name-one");
@@ -222,6 +216,7 @@ public class TestMetadata extends TestCa
   }
 
   /** Test for <code>equals(Object)</code> method. */
+  @Test
   public void testObject() {
     Metadata meta1 = new Metadata();
     Metadata meta2 = new Metadata();
@@ -247,6 +242,7 @@ public class TestMetadata extends TestCa
   }
 
   /** Test for <code>Writable</code> implementation. */
+  @Test
   public void testWritable() {
     Metadata result = null;
     Metadata meta = new Metadata();

Modified: 
nutch/branches/2.x/src/test/org/apache/nutch/metadata/TestSpellCheckedMetadata.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/metadata/TestSpellCheckedMetadata.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- 
nutch/branches/2.x/src/test/org/apache/nutch/metadata/TestSpellCheckedMetadata.java
 (original)
+++ 
nutch/branches/2.x/src/test/org/apache/nutch/metadata/TestSpellCheckedMetadata.java
 Sun May 19 21:11:54 2013
@@ -22,10 +22,8 @@ import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.util.Properties;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
 /**
  * JUnit based tests of class
@@ -34,23 +32,13 @@ import junit.textui.TestRunner;
  * @author Chris Mattmann
  * @author J&eacute;r&ocirc;me Charron
  */
-public class TestSpellCheckedMetadata extends TestCase {
 
-  private static final int NUM_ITERATIONS = 10000;
-
-  public TestSpellCheckedMetadata(String testName) {
-    super(testName);
-  }
+public class TestSpellCheckedMetadata {
 
-  public static Test suite() {
-    return new TestSuite(TestSpellCheckedMetadata.class);
-  }
-
-  public static void main(String[] args) {
-    TestRunner.run(suite());
-  }
+  private static final int NUM_ITERATIONS = 10000;
 
   /** Test for the <code>getNormalizedName(String)</code> method. */
+  @Test
   public void testGetNormalizedName() {
     assertEquals("Content-Type", SpellCheckedMetadata
         .getNormalizedName("Content-Type"));
@@ -67,6 +55,7 @@ public class TestSpellCheckedMetadata ex
   }
   
   /** Test for the <code>add(String, String)</code> method. */
+  @Test
   public void testAdd() {
     String[] values = null;
     SpellCheckedMetadata meta = new SpellCheckedMetadata();
@@ -96,6 +85,7 @@ public class TestSpellCheckedMetadata ex
   }
 
   /** Test for the <code>set(String, String)</code> method. */
+  @Test
   public void testSet() {
     String[] values = null;
     SpellCheckedMetadata meta = new SpellCheckedMetadata();
@@ -122,6 +112,7 @@ public class TestSpellCheckedMetadata ex
   }
 
   /** Test for <code>setAll(Properties)</code> method. */
+  @Test
   public void testSetProperties() {
     String[] values = null;
     SpellCheckedMetadata meta = new SpellCheckedMetadata();
@@ -149,6 +140,7 @@ public class TestSpellCheckedMetadata ex
   }
 
   /** Test for <code>get(String)</code> method. */
+  @Test
   public void testGet() {
     SpellCheckedMetadata meta = new SpellCheckedMetadata();
     assertNull(meta.get("a-name"));
@@ -160,6 +152,7 @@ public class TestSpellCheckedMetadata ex
   }
 
   /** Test for <code>isMultiValued()</code> method. */
+  @Test
   public void testIsMultiValued() {
     SpellCheckedMetadata meta = new SpellCheckedMetadata();
     assertFalse(meta.isMultiValued("key"));
@@ -170,6 +163,7 @@ public class TestSpellCheckedMetadata ex
   }
 
   /** Test for <code>names</code> method. */
+  @Test
   public void testNames() {
     String[] names = null;
     SpellCheckedMetadata meta = new SpellCheckedMetadata();
@@ -186,6 +180,7 @@ public class TestSpellCheckedMetadata ex
   }
 
   /** Test for <code>remove(String)</code> method. */
+  @Test
   public void testRemove() {
     SpellCheckedMetadata meta = new SpellCheckedMetadata();
     meta.remove("name-one");
@@ -207,6 +202,7 @@ public class TestSpellCheckedMetadata ex
   }
 
   /** Test for <code>equals(Object)</code> method. */
+  @Test
   public void testObject() {
     SpellCheckedMetadata meta1 = new SpellCheckedMetadata();
     SpellCheckedMetadata meta2 = new SpellCheckedMetadata();
@@ -232,6 +228,7 @@ public class TestSpellCheckedMetadata ex
   }
 
   /** Test for <code>Writable</code> implementation. */
+  @Test
   public void testWritable() {
     SpellCheckedMetadata result = null;
     SpellCheckedMetadata meta = new SpellCheckedMetadata();
@@ -259,6 +256,7 @@ public class TestSpellCheckedMetadata ex
    * IO Test method, usable only when you plan to do changes in metadata
    * to measure relative performance impact.
    */
+  @Test
   public final void testHandlingSpeed() {
     SpellCheckedMetadata result;
     long start = System.currentTimeMillis();

Modified: nutch/branches/2.x/src/test/org/apache/nutch/net/TestURLFilters.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/net/TestURLFilters.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- nutch/branches/2.x/src/test/org/apache/nutch/net/TestURLFilters.java 
(original)
+++ nutch/branches/2.x/src/test/org/apache/nutch/net/TestURLFilters.java Sun 
May 19 21:11:54 2013
@@ -19,14 +19,16 @@ package org.apache.nutch.net;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.nutch.util.NutchConfiguration;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
-public class TestURLFilters extends TestCase {
+public class TestURLFilters {
 
   /**
    * Testcase for NUTCH-325.
    * @throws URLFilterException
    */
+  @Test
   public void testNonExistingUrlFilter() throws URLFilterException {
     Configuration conf = NutchConfiguration.create();
     String class1 = "NonExistingFilter";
@@ -34,7 +36,12 @@ public class TestURLFilters extends Test
     conf.set(URLFilters.URLFILTER_ORDER, class1 + " " + class2);
 
     URLFilters normalizers = new URLFilters(conf);
-    normalizers.filter("http://someurl/";);
+    assertNotNull(normalizers);
+    try {
+      normalizers.filter("http://someurl/";);
+    } catch (URLFilterException ufe) {
+      fail(ufe.toString());
+    }
   }
 
 }

Modified: 
nutch/branches/2.x/src/test/org/apache/nutch/net/TestURLNormalizers.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/net/TestURLNormalizers.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- nutch/branches/2.x/src/test/org/apache/nutch/net/TestURLNormalizers.java 
(original)
+++ nutch/branches/2.x/src/test/org/apache/nutch/net/TestURLNormalizers.java 
Sun May 19 21:11:54 2013
@@ -21,10 +21,12 @@ import java.net.MalformedURLException;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.nutch.util.NutchConfiguration;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
-public class TestURLNormalizers extends TestCase {
+public class TestURLNormalizers {
 
+  @Test
   public void testURLNormalizers() {
     Configuration conf = NutchConfiguration.create();
     String clazz1 = 
"org.apache.nutch.net.urlnormalizer.regex.RegexURLNormalizer";

Modified: 
nutch/branches/2.x/src/test/org/apache/nutch/parse/TestOutlinkExtractor.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/parse/TestOutlinkExtractor.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- 
nutch/branches/2.x/src/test/org/apache/nutch/parse/TestOutlinkExtractor.java 
(original)
+++ 
nutch/branches/2.x/src/test/org/apache/nutch/parse/TestOutlinkExtractor.java 
Sun May 19 21:11:54 2013
@@ -22,7 +22,8 @@ import org.apache.nutch.parse.OutlinkExt
 import org.apache.hadoop.conf.Configuration;
 import org.apache.nutch.util.NutchConfiguration;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
 /**
  * TestCase to check regExp extraction of URLs.
@@ -31,7 +32,7 @@ import junit.framework.TestCase;
  * 
  * @version 1.0
  */
-public class TestOutlinkExtractor extends TestCase {
+public class TestOutlinkExtractor {
 
   private static Configuration conf = NutchConfiguration.create();
   public void testGetNoOutlinks() {
@@ -46,6 +47,7 @@ public class TestOutlinkExtractor extend
     assertEquals(0, outlinks.length);
   }
   
+  @Test
   public void testGetOutlinksHttp() {
     Outlink[] outlinks = OutlinkExtractor.getOutlinks(
         "Test with http://www.nutch.org/index.html is it found? " +
@@ -58,6 +60,7 @@ public class TestOutlinkExtractor extend
     assertEquals("Wrong URL", "http://www.sybit.com/solutions/portals.html";, 
outlinks[2].getToUrl());
   }
   
+  @Test
   public void testGetOutlinksHttp2() {
     Outlink[] outlinks = OutlinkExtractor.getOutlinks(
         "Test with http://www.nutch.org/index.html is it found? " +
@@ -69,6 +72,8 @@ public class TestOutlinkExtractor extend
     assertEquals("Wrong URL", "http://www.google.de";, outlinks[1].getToUrl());
     assertEquals("Wrong URL", "http://www.sybit.com/solutions/portals.html";, 
outlinks[2].getToUrl());
   }
+  
+  @Test
   public void testGetOutlinksFtp() {
     Outlink[] outlinks = OutlinkExtractor.getOutlinks(
         "Test with ftp://www.nutch.org is it found? " +

Modified: 
nutch/branches/2.x/src/test/org/apache/nutch/parse/TestParserFactory.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/parse/TestParserFactory.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- nutch/branches/2.x/src/test/org/apache/nutch/parse/TestParserFactory.java 
(original)
+++ nutch/branches/2.x/src/test/org/apache/nutch/parse/TestParserFactory.java 
Sun May 19 21:11:54 2013
@@ -17,8 +17,9 @@
 
 package org.apache.nutch.parse;
 
-// JUnit imports
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
 // Nutch imports
 import org.apache.nutch.plugin.Extension;
@@ -29,17 +30,15 @@ import org.apache.nutch.util.NutchConfig
  * Unit test for new parse plugin selection.
  *
  * @author Sebastien Le Callonnec
- * @version 1.0
  */
-public class TestParserFactory extends TestCase {
+public class TestParserFactory {
        
   private Configuration conf;
   private ParserFactory parserFactory;
     
-  public TestParserFactory(String name) { super(name); }
-
   /** Inits the Test Case with the test parse-plugin file */
-  protected void setUp() throws Exception {
+  @Before
+  public void setUp() throws Exception {
       conf = NutchConfiguration.create();
       conf.set("plugin.includes", ".*");
       conf.set("parse.plugin.file",
@@ -48,6 +47,7 @@ public class TestParserFactory extends T
   }
     
   /** Unit test for <code>getExtensions(String)</code> method. */
+  @Test
   public void testGetExtensions() throws Exception {
     Extension ext = parserFactory.getExtensions("text/html").get(0);
     assertEquals("parse-tika", ext.getDescriptor().getPluginId());
@@ -58,6 +58,7 @@ public class TestParserFactory extends T
   }
   
   /** Unit test to check <code>getParsers</code> method */
+  @Test
   public void testGetParsers() throws Exception {
     Parser [] parsers = parserFactory.getParsers("text/html", 
"http://foo.com";);
     assertNotNull(parsers);

Modified: 
nutch/branches/2.x/src/test/org/apache/nutch/plugin/TestPluginSystem.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/plugin/TestPluginSystem.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- nutch/branches/2.x/src/test/org/apache/nutch/plugin/TestPluginSystem.java 
(original)
+++ nutch/branches/2.x/src/test/org/apache/nutch/plugin/TestPluginSystem.java 
Sun May 19 21:11:54 2013
@@ -26,12 +26,14 @@ import java.util.LinkedList;
 import java.util.Locale;
 import java.util.Properties;
 
-import junit.framework.TestCase;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.nutch.util.NutchConfiguration;
-import org.apache.nutch.util.NutchJob;
 import org.apache.nutch.util.NutchJobConf;
 
 /**
@@ -39,14 +41,15 @@ import org.apache.nutch.util.NutchJobCon
  * 
  * @author joa23
  */
-public class TestPluginSystem extends TestCase {
+public class TestPluginSystem {
     private int fPluginCount;
 
-    private LinkedList fFolders = new LinkedList();
+    private LinkedList<File> fFolders = new LinkedList<File>();
     private Configuration conf ;
     private PluginRepository repository;
 
-    protected void setUp() throws Exception {
+    @Before
+    public void setUp() throws Exception {
         this.conf = NutchConfiguration.create();
         conf.set("plugin.includes", ".*");
 //        String string = this.conf.get("plugin.includes", "");
@@ -56,12 +59,8 @@ public class TestPluginSystem extends Te
         this.repository = PluginRepository.get(conf);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see junit.framework.TestCase#tearDown()
-     */
-    protected void tearDown() throws Exception {
+    @After
+    public void tearDown() throws Exception {
         for (int i = 0; i < fFolders.size(); i++) {
             File folder = (File) fFolders.get(i);
             delete(folder);
@@ -72,6 +71,7 @@ public class TestPluginSystem extends Te
 
     /**
      */
+    @Test
     public void testPluginConfiguration() {
         String string = getPluginFolder();
         File file = new File(string);
@@ -83,6 +83,7 @@ public class TestPluginSystem extends Te
 
     /**
      */
+    @Test
     public void testLoadPlugins() {
         PluginDescriptor[] descriptors = repository
                 .getPluginDescriptors();
@@ -98,6 +99,7 @@ public class TestPluginSystem extends Te
         }
     }
 
+    @Test
     public void testRepositoryCache() {
       Configuration config = NutchConfiguration.create();
       PluginRepository repo = PluginRepository.get(config);
@@ -117,6 +119,7 @@ public class TestPluginSystem extends Te
     /**
      *  
      */
+    @Test
     public void testGetExtensionAndAttributes() {
         String xpId = " sdsdsd";
         ExtensionPoint extensionPoint =repository
@@ -135,6 +138,7 @@ public class TestPluginSystem extends Te
     /**
      * @throws PluginRuntimeException
      */
+    @Test
     public void testGetExtensionInstances() throws PluginRuntimeException {
         Extension[] extensions = repository
                 .getExtensionPoint(getGetExtensionId()).getExtensions();
@@ -154,6 +158,7 @@ public class TestPluginSystem extends Te
      * 
      *  
      */
+    @Test
     public void testGetClassLoader() {
         PluginDescriptor[] descriptors = repository
                 .getPluginDescriptors();
@@ -166,6 +171,7 @@ public class TestPluginSystem extends Te
     /**
      * @throws IOException
      */
+    @Test
     public void testGetResources() throws IOException {
         PluginDescriptor[] descriptors = repository
                 .getPluginDescriptors();

Modified: nutch/branches/2.x/src/test/org/apache/nutch/protocol/TestContent.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/protocol/TestContent.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- nutch/branches/2.x/src/test/org/apache/nutch/protocol/TestContent.java 
(original)
+++ nutch/branches/2.x/src/test/org/apache/nutch/protocol/TestContent.java Sun 
May 19 21:11:54 2013
@@ -24,17 +24,17 @@ import org.apache.nutch.util.NutchConfig
 import org.apache.nutch.util.WritableTestUtils;
 import org.apache.tika.mime.MimeTypes;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
 
 /** Unit tests for Content. */
 
-public class TestContent extends TestCase {
+public class TestContent {
 
   private static Configuration conf = NutchConfiguration.create();
 
-  public TestContent(String name) { super(name); }
-
+  @Test
   public void testContent() throws Exception {
 
     String page = "<HTML><BODY><H1>Hello World</H1><P>The Quick Brown Fox 
Jumped Over the Lazy Fox.</BODY></HTML>";
@@ -55,6 +55,7 @@ public class TestContent extends TestCas
   }
 
   /** Unit tests for getContentType(String, String, byte[]) method. */
+  @Test
   public void testGetContentType() throws Exception {
     Content c = null;
     Metadata p = new Metadata();

Modified: 
nutch/branches/2.x/src/test/org/apache/nutch/protocol/TestProtocolFactory.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/protocol/TestProtocolFactory.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- 
nutch/branches/2.x/src/test/org/apache/nutch/protocol/TestProtocolFactory.java 
(original)
+++ 
nutch/branches/2.x/src/test/org/apache/nutch/protocol/TestProtocolFactory.java 
Sun May 19 21:11:54 2013
@@ -20,20 +20,24 @@ import org.apache.hadoop.conf.Configurat
 import org.apache.nutch.util.NutchConfiguration;
 import org.apache.nutch.util.ObjectCache;
 
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
-public class TestProtocolFactory extends TestCase {
+public class TestProtocolFactory {
 
   Configuration conf;
   ProtocolFactory factory;
   
-  protected void setUp() throws Exception {
+  @Before
+  public void setUp() throws Exception {
     conf = NutchConfiguration.create();
     conf.set("plugin.includes", ".*");
     conf.set("http.agent.name", "test-bot");
     factory=new ProtocolFactory(conf);
   }
 
+  @Test
   public void testGetProtocol(){
 
     //non existing protocol
@@ -69,6 +73,7 @@ public class TestProtocolFactory extends
     }
   }
   
+  @Test
   public void testContains(){
     assertTrue(factory.contains("http", "http"));
     assertTrue(factory.contains("http", "http,ftp"));

Modified: 
nutch/branches/2.x/src/test/org/apache/nutch/storage/TestGoraStorage.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/storage/TestGoraStorage.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- nutch/branches/2.x/src/test/org/apache/nutch/storage/TestGoraStorage.java 
(original)
+++ nutch/branches/2.x/src/test/org/apache/nutch/storage/TestGoraStorage.java 
Sun May 19 21:11:54 2013
@@ -35,16 +35,34 @@ import org.apache.nutch.util.AbstractNut
 import org.apache.nutch.util.CrawlTestUtil;
 import org.hsqldb.Server;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
 /**
  * Tests basic Gora functionality by writing and reading webpages.
  */
 public class TestGoraStorage extends AbstractNutchTest {
 
+  @Override
+  @Before
+  public void setUp() throws Exception {
+    super.setUp();
+  }
+
+  @Override
+  @After
+  public void tearDown() throws Exception {
+    super.tearDown();
+  }
+  
   /**
    * Sequentially read and write pages to a store.
    * 
    * @throws Exception
    */
+  @Test
   public void testSinglethreaded() throws Exception {
     String id = "singlethread";
     readWrite(id, webPageStore);
@@ -87,6 +105,7 @@ public class TestGoraStorage extends Abs
    * 
    * @throws Exception
    */
+  @Test
   public void testMultithreaded() throws Exception {
     // create a fixed thread pool
     int numThreads = 8;
@@ -127,6 +146,7 @@ public class TestGoraStorage extends Abs
    * 
    * @throws Exception
    */
+  @Test
   public void testMultiProcess() throws Exception {
     // create and start a hsql server, a stand-alone (memory backed) db
     // (important: a stand-alone server should be used because simple

Modified: 
nutch/branches/2.x/src/test/org/apache/nutch/util/AbstractNutchTest.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/util/AbstractNutchTest.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- nutch/branches/2.x/src/test/org/apache/nutch/util/AbstractNutchTest.java 
(original)
+++ nutch/branches/2.x/src/test/org/apache/nutch/util/AbstractNutchTest.java 
Sun May 19 21:11:54 2013
@@ -16,8 +16,6 @@
  */
 package org.apache.nutch.util;
 
-import junit.framework.TestCase;
-
 import org.apache.gora.store.DataStore;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
@@ -29,7 +27,7 @@ import org.apache.nutch.storage.WebPage;
  * This class provides common routines for setup/teardown of an in-memory data
  * store.
  */
-public class AbstractNutchTest extends TestCase {
+public class AbstractNutchTest {
 
   protected Configuration conf;
   protected FileSystem fs;
@@ -37,9 +35,7 @@ public class AbstractNutchTest extends T
   protected DataStore<String, WebPage> webPageStore;
   protected boolean persistentDataStore = false;
 
-  @Override
   public void setUp() throws Exception {
-    super.setUp();
     conf = CrawlTestUtil.createConfiguration();
     conf.set("storage.data.store.class", "org.apache.gora.sql.store.SqlStore");
     fs = FileSystem.get(conf);
@@ -47,7 +43,6 @@ public class AbstractNutchTest extends T
         WebPage.class);
   }
 
-  @Override
   public void tearDown() throws Exception {
     // empty the database after test
     if (!persistentDataStore) {
@@ -55,7 +50,6 @@ public class AbstractNutchTest extends T
       webPageStore.flush();
       webPageStore.close();
     }
-    super.tearDown();
     fs.delete(testdir, true);
   }
 

Modified: 
nutch/branches/2.x/src/test/org/apache/nutch/util/TestEncodingDetector.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/util/TestEncodingDetector.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- nutch/branches/2.x/src/test/org/apache/nutch/util/TestEncodingDetector.java 
(original)
+++ nutch/branches/2.x/src/test/org/apache/nutch/util/TestEncodingDetector.java 
Sun May 19 21:11:54 2013
@@ -19,14 +19,15 @@ package org.apache.nutch.util;
 import java.io.UnsupportedEncodingException;
 import java.nio.ByteBuffer;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
 import org.apache.avro.util.Utf8;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.nutch.net.protocols.Response;
 import org.apache.nutch.storage.WebPage;
 
-public class TestEncodingDetector extends TestCase {
+public class TestEncodingDetector {
   private static Configuration conf = NutchConfiguration.create();
 
   private static byte[] contentInOctets;
@@ -39,10 +40,7 @@ public class TestEncodingDetector extend
     }
   }
 
-  public TestEncodingDetector(String name) {
-    super(name);
-  }
-
+  @Test
   public void testGuessing() {
     // first disable auto detection
     conf.setInt(EncodingDetector.MIN_CONFIDENCE_KEY, -1);

Modified: nutch/branches/2.x/src/test/org/apache/nutch/util/TestGZIPUtils.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/util/TestGZIPUtils.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- nutch/branches/2.x/src/test/org/apache/nutch/util/TestGZIPUtils.java 
(original)
+++ nutch/branches/2.x/src/test/org/apache/nutch/util/TestGZIPUtils.java Sun 
May 19 21:11:54 2013
@@ -17,15 +17,13 @@
 
 package org.apache.nutch.util;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
 import java.io.IOException;
 
 /** Unit tests for GZIPUtils methods. */
-public class TestGZIPUtils extends TestCase {
-  public TestGZIPUtils(String name) { 
-    super(name); 
-  }
+public class TestGZIPUtils {
 
   /* a short, highly compressable, string */
   String SHORT_TEST_STRING= 
@@ -117,6 +115,7 @@ public class TestGZIPUtils extends TestC
 
   // tests
 
+  @Test
   public void testZipUnzip() {
     byte[] testBytes= SHORT_TEST_STRING.getBytes();
     testZipUnzip(testBytes);
@@ -126,6 +125,7 @@ public class TestGZIPUtils extends TestC
     testZipUnzip(testBytes);
   }
 
+  @Test
   public void testZipUnzipBestEffort() {
     byte[] testBytes= SHORT_TEST_STRING.getBytes();
     testZipUnzipBestEffort(testBytes);
@@ -135,6 +135,7 @@ public class TestGZIPUtils extends TestC
     testZipUnzipBestEffort(testBytes);
   }
   
+  @Test
   public void testTruncation() {
     byte[] testBytes= SHORT_TEST_STRING.getBytes();
     testTruncation(testBytes);
@@ -144,6 +145,7 @@ public class TestGZIPUtils extends TestC
     testTruncation(testBytes);
   }
 
+  @Test
   public void testLimit() {
     byte[] testBytes= SHORT_TEST_STRING.getBytes();
     testLimit(testBytes);

Modified: nutch/branches/2.x/src/test/org/apache/nutch/util/TestNodeWalker.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/util/TestNodeWalker.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- nutch/branches/2.x/src/test/org/apache/nutch/util/TestNodeWalker.java 
(original)
+++ nutch/branches/2.x/src/test/org/apache/nutch/util/TestNodeWalker.java Sun 
May 19 21:11:54 2013
@@ -18,20 +18,17 @@
 package org.apache.nutch.util;
 
 import java.io.ByteArrayInputStream;
-import junit.framework.TestCase;
+
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
 import org.apache.xerces.parsers.DOMParser;
 import org.w3c.dom.Node;
 import org.xml.sax.InputSource;
 
-
-
-
 /** Unit tests for NodeWalker methods. */
-public class TestNodeWalker extends TestCase {
-  public TestNodeWalker(String name) { 
-    super(name); 
-  }
+public class TestNodeWalker {
 
   /* a snapshot of the nutch webpage */
   private final static String WEBPAGE= 
@@ -49,13 +46,15 @@ public class TestNodeWalker extends Test
 
   private final static String[] ULCONTENT = new String[4];
   
-  protected void setUp() throws Exception{
+  @Before
+  public void setUp() throws Exception{
     ULCONTENT[0]="crawl several billion pages per month" ;
     ULCONTENT[1]="maintain an index of these pages" ;
     ULCONTENT[2]="search that index up to 1000 times per second"  ;
     ULCONTENT[3]="operate at minimal cost" ;
   }
 
+  @Test
   public void testSkipChildren() {
     DOMParser parser= new DOMParser();
     

Modified: 
nutch/branches/2.x/src/test/org/apache/nutch/util/TestPrefixStringMatcher.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/util/TestPrefixStringMatcher.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- 
nutch/branches/2.x/src/test/org/apache/nutch/util/TestPrefixStringMatcher.java 
(original)
+++ 
nutch/branches/2.x/src/test/org/apache/nutch/util/TestPrefixStringMatcher.java 
Sun May 19 21:11:54 2013
@@ -17,13 +17,11 @@
 
 package org.apache.nutch.util;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
 /** Unit tests for PrefixStringMatcher. */
-public class TestPrefixStringMatcher extends TestCase {
-  public TestPrefixStringMatcher(String name) { 
-    super(name); 
-  }
+public class TestPrefixStringMatcher {
 
   private final static int NUM_TEST_ROUNDS= 20;
   private final static int MAX_TEST_PREFIXES= 100;
@@ -51,6 +49,7 @@ public class TestPrefixStringMatcher ext
     return new String(chars);
   }
   
+  @Test
   public void testPrefixMatcher() {
     int numMatches= 0;
     int numInputsTested= 0;

Modified: nutch/branches/2.x/src/test/org/apache/nutch/util/TestStringUtil.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/util/TestStringUtil.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- nutch/branches/2.x/src/test/org/apache/nutch/util/TestStringUtil.java 
(original)
+++ nutch/branches/2.x/src/test/org/apache/nutch/util/TestStringUtil.java Sun 
May 19 21:11:54 2013
@@ -17,14 +17,13 @@
 
 package org.apache.nutch.util;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
 /** Unit tests for StringUtil methods. */
-public class TestStringUtil extends TestCase {
-  public TestStringUtil(String name) { 
-    super(name); 
-  }
+public class TestStringUtil {
 
+  @Test
   public void testRightPad() {
     String s= "my string";
 
@@ -42,6 +41,7 @@ public class TestStringUtil extends Test
 
   }
 
+  @Test
   public void testLeftPad() {
     String s= "my string";
 

Modified: 
nutch/branches/2.x/src/test/org/apache/nutch/util/TestSuffixStringMatcher.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/util/TestSuffixStringMatcher.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- 
nutch/branches/2.x/src/test/org/apache/nutch/util/TestSuffixStringMatcher.java 
(original)
+++ 
nutch/branches/2.x/src/test/org/apache/nutch/util/TestSuffixStringMatcher.java 
Sun May 19 21:11:54 2013
@@ -17,13 +17,11 @@
 
 package org.apache.nutch.util;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
 /** Unit tests for SuffixStringMatcher. */
-public class TestSuffixStringMatcher extends TestCase {
-  public TestSuffixStringMatcher(String name) { 
-    super(name); 
-  }
+public class TestSuffixStringMatcher {
 
   private final static int NUM_TEST_ROUNDS= 20;
   private final static int MAX_TEST_SUFFIXES= 100;
@@ -51,6 +49,7 @@ public class TestSuffixStringMatcher ext
     return new String(chars);
   }
   
+  @Test
   public void testSuffixMatcher() {
     int numMatches= 0;
     int numInputsTested= 0;

Modified: nutch/branches/2.x/src/test/org/apache/nutch/util/TestTableUtil.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/util/TestTableUtil.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- nutch/branches/2.x/src/test/org/apache/nutch/util/TestTableUtil.java 
(original)
+++ nutch/branches/2.x/src/test/org/apache/nutch/util/TestTableUtil.java Sun 
May 19 21:11:54 2013
@@ -17,9 +17,10 @@
 package org.apache.nutch.util;
 
 import org.apache.nutch.util.TableUtil;
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
-public class TestTableUtil extends TestCase {
+public class TestTableUtil {
 
   String urlString1 = "http://foo.com/";;
   String urlString2 = "http://foo.com:8900/";;
@@ -38,6 +39,7 @@ public class TestTableUtil extends TestC
   String reversedUrlString6 = "com.foo:http";
   String reversedUrlString7 = ":file/var/www/index.html";
 
+  @Test
   public void testReverseUrl() throws Exception {
     assertReverse(urlString1, reversedUrlString1);
     assertReverse(urlString2, reversedUrlString2);
@@ -49,6 +51,7 @@ public class TestTableUtil extends TestC
     assertReverse(urlString7, reversedUrlString7);
   }
 
+  @Test
   public void testUnreverseUrl() throws Exception {
     assertUnreverse(reversedUrlString1, urlString1);
     assertUnreverse(reversedUrlString2, urlString2);

Modified: nutch/branches/2.x/src/test/org/apache/nutch/util/TestURLUtil.java
URL: 
http://svn.apache.org/viewvc/nutch/branches/2.x/src/test/org/apache/nutch/util/TestURLUtil.java?rev=1484348&r1=1484347&r2=1484348&view=diff
==============================================================================
--- nutch/branches/2.x/src/test/org/apache/nutch/util/TestURLUtil.java 
(original)
+++ nutch/branches/2.x/src/test/org/apache/nutch/util/TestURLUtil.java Sun May 
19 21:11:54 2013
@@ -19,18 +19,13 @@ package org.apache.nutch.util;
 
 import java.net.URL;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
 /** Test class for URLUtil */
-public class TestURLUtil
-  extends TestCase {
-
-  @Override
-  protected void setUp()
-    throws Exception {
-    super.setUp();
-  }
+public class TestURLUtil {
 
+  @Test
   public void testGetDomainName()
     throws Exception {
 
@@ -81,6 +76,7 @@ public class TestURLUtil
 
   }
 
+  @Test
   public void testGetDomainSuffix()
     throws Exception {
     URL url = null;
@@ -133,6 +129,7 @@ public class TestURLUtil
 
   }
 
+  @Test
   public void testGetHostBatches()
     throws Exception {
     URL url;
@@ -165,6 +162,7 @@ public class TestURLUtil
 
   }
 
+  @Test
   public void testChooseRepr()
     throws Exception {
     


Reply via email to