aboutsummaryrefslogtreecommitdiffstats
path: root/test/java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2007-10-26 07:34:09 +0000
committerJeremias Maerki <jeremias@apache.org>2007-10-26 07:34:09 +0000
commit1a43096a10cba160b249c0ee363d44bffdf3bd97 (patch)
tree64ec272793b9208448100e703cfcc28ffc8cfb2b /test/java
parentbbad9cfcfc18d6523878c6d1ec6e924a911a0995 (diff)
downloadxmlgraphics-fop-1a43096a10cba160b249c0ee363d44bffdf3bd97.tar.gz
xmlgraphics-fop-1a43096a10cba160b249c0ee363d44bffdf3bd97.zip
Some log fine-tuning.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@588546 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/java')
-rw-r--r--test/java/org/apache/fop/visual/BatchDiffer.java28
1 files changed, 13 insertions, 15 deletions
diff --git a/test/java/org/apache/fop/visual/BatchDiffer.java b/test/java/org/apache/fop/visual/BatchDiffer.java
index b42e440d7..aa3f5504f 100644
--- a/test/java/org/apache/fop/visual/BatchDiffer.java
+++ b/test/java/org/apache/fop/visual/BatchDiffer.java
@@ -35,19 +35,15 @@ import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
import org.apache.avalon.framework.container.ContainerUtil;
-
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.filefilter.IOFileFilter;
import org.apache.commons.io.filefilter.SuffixFileFilter;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
import org.apache.fop.layoutengine.LayoutEngineTestSuite;
import org.apache.xmlgraphics.image.writer.ImageWriter;
import org.apache.xmlgraphics.image.writer.ImageWriterRegistry;
-
import org.xml.sax.SAXException;
/**
@@ -192,8 +188,8 @@ public class BatchDiffer {
Collection files = FileUtils.listFiles(srcDir, filter, null);
Iterator i = files.iterator();
while (i.hasNext()) {
+ File f = (File)i.next();
try {
- File f = (File)i.next();
log.info("---=== " + f + " ===---");
long[] times = new long[producers.length];
for (int j = 0; j < producers.length; j++) {
@@ -201,18 +197,20 @@ public class BatchDiffer {
bitmaps[j] = producers[j].produce(f, context);
times[j] = System.currentTimeMillis() - times[j];
}
- StringBuffer sb = new StringBuffer("Bitmap production times: ");
- for (int j = 0; j < producers.length; j++) {
- if (j > 0) {
- sb.append(", ");
+ if (log.isDebugEnabled()) {
+ StringBuffer sb = new StringBuffer("Bitmap production times: ");
+ for (int j = 0; j < producers.length; j++) {
+ if (j > 0) {
+ sb.append(", ");
+ }
+ sb.append(times[j]).append("ms");
}
- sb.append(times[j]).append("ms");
+ log.debug(sb.toString());
}
- log.info(sb.toString());
//Create combined image
if (bitmaps[0] == null) {
- throw new RuntimeException("First producer didn't return a bitmap."
- + " Cannot continue.");
+ throw new RuntimeException("First producer didn't return a bitmap for "
+ + f + ". Cannot continue.");
}
BufferedImage combined = BitmapComparator.buildCompareImage(bitmaps);
@@ -233,9 +231,9 @@ public class BatchDiffer {
bitmaps[k] = null;
}
} catch (RuntimeException e) {
- System.out.println("Catching RE: " + e.getMessage());
+ log.error("Catching RE on file " + f + ": " + e.getMessage());
if (stopOnException) {
- System.out.println("rethrowing...");
+ log.error("rethrowing...");
throw e;
}
}