use of org.archive.modules.net.BdbServerCache in project heritrix3 by internetarchive.
the class CrawlControllerTest method makeTempCrawlController.
// TODO TESTME
public static CrawlController makeTempCrawlController() throws Exception {
String tmpPath = System.getProperty(TEST_TMP_SYSTEM_PROPERTY_NAME);
if (tmpPath == null) {
tmpPath = DEFAULT_TEST_TMP_DIR;
}
File tmp = new File(tmpPath);
FileUtils.ensureWriteableDirectory(tmp);
FileWriter fileWriter = null;
try {
fileWriter = new FileWriter(new File(tmp, "seeds.txt"));
fileWriter.write("http://www.pandemoniummovie.com");
fileWriter.close();
} finally {
ArchiveUtils.closeQuietly(fileWriter);
}
File state = new File(tmp, "state");
FileUtils.ensureWriteableDirectory(state);
File checkpoints = new File(tmp, "checkpoints");
FileUtils.ensureWriteableDirectory(checkpoints);
BdbModule bdb = new BdbModule();
bdb.setDir(new ConfigPath("test", state.getAbsolutePath()));
// def.set(bdb, BdbModule.DIR, state.getAbsolutePath());
bdb.start();
CrawlController controller = new CrawlController();
controller.setServerCache(new BdbServerCache());
controller.start();
return controller;
}
Aggregations