From c170390c0d4bfee406fcd79ee76d382ea5d58fa5 Mon Sep 17 00:00:00 2001 From: gojomo Date: Tue, 16 Nov 2010 00:58:13 +0000 Subject: [PATCH] Fix selftest failures where empty 'profile' directory may not exist (eg git) * SelfTestBase only copy profile directory if it exists --- .../test/java/org/archive/crawler/selftest/SelfTestBase.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/src/test/java/org/archive/crawler/selftest/SelfTestBase.java b/engine/src/test/java/org/archive/crawler/selftest/SelfTestBase.java index 4a30021c..f69ec817 100644 --- a/engine/src/test/java/org/archive/crawler/selftest/SelfTestBase.java +++ b/engine/src/test/java/org/archive/crawler/selftest/SelfTestBase.java @@ -86,7 +86,10 @@ public abstract class SelfTestBase extends TmpDirTestCase { // Copy the selftest's profile in the project directory to the // default profile in the temporary Heritrix directory. File tmpDefProfile = new File(tmpJobs, "selftest-job"); - org.apache.commons.io.FileUtils.copyDirectory(new File(src, "profile"), tmpDefProfile); + File profileTemplate = new File(src, "profile"); + if(profileTemplate.exists()) { + org.apache.commons.io.FileUtils.copyDirectory(profileTemplate, tmpDefProfile); + } // Start up a Jetty that serves the selftest's content directory. startHttpServer();