Apache Nutch is an extensible and scalable web crawler
Fixed test for NUTCH-901
Markus Jelsma14e43b4a71dd
diff --git a/src/plugin/index-more/src/test/org/apache/nutch/indexer/more/TestMoreIndexingFilter.java b/src/plugin/index-more/src/test/org/apache/nutch/indexer/more/TestMoreIndexingFilter.javaindex 1c3d3e1d4..ed214cd2b 100644--- a/src/plugin/index-more/src/test/org/apache/nutch/indexer/more/TestMoreIndexingFilter.java+++ b/src/plugin/index-more/src/test/org/apache/nutch/indexer/more/TestMoreIndexingFilter.java@@ -49,23 +49,25 @@ public class TestMoreIndexingFilter extends TestCase {* @since NUTCH-901*/public void testNoParts(){- Configuration conf = NutchConfiguration.create();- conf.setBoolean("moreIndexingFilter.indexMimeTypeParts", false);- MoreIndexingFilter filter = new MoreIndexingFilter();- filter.setConf(conf);- assertNotNull(filter);- NutchDocument doc = new NutchDocument();- try{- filter.filter(doc, "http://nutch.apache.org/index.html", new WebPage());- }- catch(Exception e){- e.printStackTrace();- fail(e.getMessage());- }- assertNotNull(doc);- assertTrue(doc.getFieldNames().contains("type"));- assertEquals(1, doc.getFieldValues("type").size());- assertEquals("text/html", doc.getFieldValue("type"));+ Configuration conf = NutchConfiguration.create();+ conf.setBoolean("moreIndexingFilter.indexMimeTypeParts", false);+ MoreIndexingFilter filter = new MoreIndexingFilter();+ filter.setConf(conf);+ assertNotNull(filter);+ NutchDocument doc = new NutchDocument();+ ParseImpl parse = new ParseImpl("foo bar", new ParseData());++ try{+ filter.filter(doc, parse, new Text("http://nutch.apache.org/index.html"), new CrawlDatum(), new Inlinks());+ }+ catch(Exception e){+ e.printStackTrace();+ fail(e.getMessage());+ }+ assertNotNull(doc);+ assertTrue(doc.getFieldNames().contains("type"));+ assertEquals(1, doc.getField("type").getValues().size());+ assertEquals("text/html", doc.getFieldValue("type"));}private void assertParts(String[] parts, int count, String... expected) {