Index: src/test/org/apache/nutch/indexer/TestIndexingFilters.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/test/org/apache/nutch/indexer/TestIndexingFilters.java	(revision 1431804)
+++ src/test/org/apache/nutch/indexer/TestIndexingFilters.java	(revision )
@@ -37,6 +37,9 @@
    */
   public void testNonExistingIndexingFilter() throws IndexingException {
     Configuration conf = NutchConfiguration.create();
+        conf.addResource("nutch-default.xml");
+        conf.addResource("crawl-tests.xml");
+
     String class1 = "NonExistingFilter";
     String class2 = "org.apache.nutch.indexer.basic.BasicIndexingFilter";
     conf.set(IndexingFilters.INDEXINGFILTER_ORDER, class1 + " " + class2);
@@ -45,6 +48,57 @@
     filters.filter(new NutchDocument(), new ParseImpl("text", new ParseData(
         new ParseStatus(), "title", new Outlink[0], new Metadata())), new Text(
         "http://www.example.com/"), new CrawlDatum(), new Inlinks());
+  }
+
+  /**
+   * Test behaviour when NutchDOcument is null
+   */
+
+  public void testNutchDocumentNullIndexingFilter() throws IndexingException{
+     Configuration conf = NutchConfiguration.create();
+     conf.addResource("nutch-default.xml");
+     conf.addResource("crawl-tests.xml");
+
+     IndexingFilters filters = new IndexingFilters(conf);
+     NutchDocument doc = filters.filter(null, new ParseImpl("text", new ParseData(
+             new ParseStatus(), "title", new Outlink[0], new Metadata())), new Text(
+             "http://www.example.com/"), new CrawlDatum(), new Inlinks());
+
+     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);
+      NutchDocument fdoc1 = filters1.filter(new NutchDocument(),new ParseImpl("text",new ParseData(
+              new ParseStatus(),"title",new Outlink[0],new Metadata())),new Text("http://www.example.com/"),
+              new CrawlDatum(),new Inlinks());
+
+      // 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(),new ParseImpl("text",new ParseData(
+              new ParseStatus(),"title",new Outlink[0],md)),new Text("http://www.example.com/"),
+              new CrawlDatum(),new Inlinks());
+       assertEquals(fdoc1.getFieldNames().size(),fdoc2.getFieldNames().size());
   }
 
 }
