You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ja...@apache.org on 2014/10/09 09:13:26 UTC

svn commit: r1630301 - in /pdfbox/trunk/tools: ./ src/test/java/org/apache/pdfbox/tools/ src/test/java/org/apache/pdfbox/tools/imageio/ src/test/resources/

Author: jahewson
Date: Thu Oct  9 07:13:26 2014
New Revision: 1630301

URL: http://svn.apache.org/r1630301
Log:
PDFBOX-2387: Clean up logging for TestImageIOUtils

Added:
    pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/imageio/
    pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/imageio/TestImageIOUtils.java
      - copied, changed from r1630259, pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/TestImageIOUtils.java
    pdfbox/trunk/tools/src/test/resources/logging.properties
Removed:
    pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/TestImageIOUtils.java
Modified:
    pdfbox/trunk/tools/pom.xml

Modified: pdfbox/trunk/tools/pom.xml
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/pom.xml?rev=1630301&r1=1630300&r2=1630301&view=diff
==============================================================================
--- pdfbox/trunk/tools/pom.xml (original)
+++ pdfbox/trunk/tools/pom.xml Thu Oct  9 07:13:26 2014
@@ -76,6 +76,14 @@
       </resource>
     </resources>
     <plugins>
+        <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+                <systemPropertyVariables>
+                    <java.util.logging.config.file>src/test/resources/logging.properties</java.util.logging.config.file>
+                </systemPropertyVariables>
+            </configuration>
+        </plugin>
     </plugins>
   </build>
 

Copied: pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/imageio/TestImageIOUtils.java (from r1630259, pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/TestImageIOUtils.java)
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/imageio/TestImageIOUtils.java?p2=pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/imageio/TestImageIOUtils.java&p1=pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/TestImageIOUtils.java&r1=1630259&r2=1630301&rev=1630301&view=diff
==============================================================================
--- pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/TestImageIOUtils.java (original)
+++ pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/imageio/TestImageIOUtils.java Thu Oct  9 07:13:26 2014
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.pdfbox.tools;
+package org.apache.pdfbox.tools.imageio;
 
 import java.awt.Color;
 import java.awt.image.BufferedImage;
@@ -47,7 +47,6 @@ import org.apache.pdfbox.pdmodel.graphic
 import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject;
 import org.apache.pdfbox.rendering.ImageType;
 import org.apache.pdfbox.rendering.PDFRenderer;
-import org.apache.pdfbox.tools.imageio.ImageIOUtil;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -58,7 +57,6 @@ import org.w3c.dom.NodeList;
 public class TestImageIOUtils extends TestCase
 {
     private static final Log LOG = LogFactory.getLog(TestImageIOUtils.class);
-
     
     /**
      * Check whether the resource images can be saved.
@@ -236,6 +234,7 @@ public class TestImageIOUtils extends Te
         BufferedImage image = renderer.renderImageWithDPI(0, dpi, imageType);
         String fileName = outputPrefix + 1;
         LOG.info("Writing: " + fileName + "." + imageFormat);
+        System.out.println("  " + fileName + "." + imageFormat); // for Maven (keep me!)
         boolean res = ImageIOUtil.writeImage(image, fileName + "." + imageFormat, Math.round(dpi));
         assertTrue("ImageIOUtil.writeImage() failed for file " + fileName, res);
         if ("jpg".equals(imageFormat) || "gif".equals(imageFormat))

Added: pdfbox/trunk/tools/src/test/resources/logging.properties
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/test/resources/logging.properties?rev=1630301&view=auto
==============================================================================
--- pdfbox/trunk/tools/src/test/resources/logging.properties (added)
+++ pdfbox/trunk/tools/src/test/resources/logging.properties Thu Oct  9 07:13:26 2014
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+handlers=java.util.logging.FileHandler java.util.logging.ConsoleHandler
+.level=WARNING
+
+java.util.logging.ConsoleHandler.level = SEVERE
+
+java.util.logging.FileHandler.level = FINE
+java.util.logging.FileHandler.pattern = target/tools.log
+java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter