@Test
public void testCreateProductCrawler() throws Exception {

   PGETaskInstance pgeTask = createTestInstance();
   pgeTask.pgeMetadata.replaceMetadata(MIME_EXTRACTOR_REPO,
         "src/main/resources/examples/Crawler/mime-extractor-map.xml");
   pgeTask.pgeMetadata.replaceMetadata(
         INGEST_CLIENT_TRANSFER_SERVICE_FACTORY,
         "org.apache.oodt.cas.filemgr.datatransfer.LocalDataTransferFactory");
   pgeTask.pgeMetadata.replaceMetadata(INGEST_FILE_MANAGER_URL,
         "http://localhost:9000");
   pgeTask.pgeMetadata.replaceMetadata(CRAWLER_CONFIG_FILE,
         "src/main/resources/examples/Crawler/crawler-config.xml");
   pgeTask.pgeMetadata.replaceMetadata(ACTION_IDS,
         Lists.newArrayList("DeleteDataFile", "MoveMetadataFileToFailureDir"));
   pgeTask.pgeMetadata.replaceMetadata(REQUIRED_METADATA,
         Lists.newArrayList("Owners"));
   pgeTask.pgeMetadata.replaceMetadata(CRAWLER_CRAWL_FOR_DIRS,
         Boolean.toString(false));
   pgeTask.pgeMetadata.replaceMetadata(CRAWLER_RECUR,
         Boolean.toString(true));
   ProductCrawler pc = pgeTask.createProductCrawler();
   assertEquals(
         "org.apache.oodt.cas.filemgr.datatransfer.LocalDataTransferFactory",
         pc.getClientTransferer());
   assertEquals("http://localhost:9000", pc.getFilemgrUrl());
   assertEquals(
         Sets.newHashSet("DeleteDataFile", "MoveMetadataFileToFailureDir"),
         Sets.newHashSet(pc.getActionIds()));
   CrawlerAction action = (CrawlerAction) pc.getApplicationContext().getBean("DeleteDataFile");
   assertNotNull(action);
   MoveFile moveFileAction = (MoveFile) pc.getApplicationContext().getBean("MoveMetadataFileToFailureDir");
   Properties properties = new Properties();
   properties.load(new FileInputStream(new File(
         "src/main/resources/examples/Crawler/action-beans.properties")));
   assertEquals(properties.get("crawler.failure.dir"),
         moveFileAction.getToDir());
   assertTrue(pc.getRequiredMetadata().contains("Owners"));
   assertFalse(pc.isCrawlForDirs());
   assertFalse(pc.isNoRecur());
}