Fix broken test

* Engine.java
    tolerate (with return-false-forfailure rather than NPE) non-job directories
* EngineTest.java
    use empty temp job directory rather than (possibly full-of-junk) general junit-tests directory
This commit is contained in:
gojomo
2010-04-27 00:44:36 +00:00
parent 57c857d5c6
commit b639873dae
2 changed files with 10 additions and 3 deletions
@@ -1,11 +1,18 @@
package org.archive.crawler.framework;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.archive.util.TmpDirTestCase;
public class EngineTest extends TmpDirTestCase {
public void testGetProfileCxmlResource() {
assertNotNull(new Engine(getTmpDir()).getProfileCxmlResource());
public void testGetProfileCxmlResource() throws IOException {
File dummyJobsDir = new File(getTmpDir(),"dummyJobsDir");
assertTrue(dummyJobsDir.mkdirs());
assertNotNull(new Engine(dummyJobsDir).getProfileCxmlResource());
FileUtils.deleteDirectory(dummyJobsDir);
}
}