pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1630302 - in /pdfbox/trunk/xmpbox/src: main/java/org/apache/xmpbox/xml/DomXmpParser.java test/java/org/apache/xmpbox/schema/TestExifXmp.java
Date Thu, 09 Oct 2014 07:14:54 GMT
Author: jahewson
Date: Thu Oct  9 07:14:54 2014
New Revision: 1630302

URL: http://svn.apache.org/r1630302
Log:
PDFBOX-2299: Disable console logging for xmpbox parser validation errors

Modified:
    pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
    pdfbox/trunk/xmpbox/src/test/java/org/apache/xmpbox/schema/TestExifXmp.java

Modified: pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java?rev=1630302&r1=1630301&r2=1630302&view=diff
==============================================================================
--- pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java (original)
+++ pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java Thu Oct  9 07:14:54
2014
@@ -111,6 +111,7 @@ public class DomXmpParser
         Document document = null;
         try
         {
+            dBuilder.setErrorHandler(null); // prevents validation messages polluting the
console
             document = dBuilder.parse(input);
         }
         catch (SAXException e)

Modified: pdfbox/trunk/xmpbox/src/test/java/org/apache/xmpbox/schema/TestExifXmp.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/xmpbox/src/test/java/org/apache/xmpbox/schema/TestExifXmp.java?rev=1630302&r1=1630301&r2=1630302&view=diff
==============================================================================
--- pdfbox/trunk/xmpbox/src/test/java/org/apache/xmpbox/schema/TestExifXmp.java (original)
+++ pdfbox/trunk/xmpbox/src/test/java/org/apache/xmpbox/schema/TestExifXmp.java Thu Oct  9
07:14:54 2014
@@ -21,6 +21,7 @@
 
 package org.apache.xmpbox.schema;
 
+import java.io.ByteArrayOutputStream;
 import org.apache.xmpbox.XMPMetadata;
 import org.apache.xmpbox.type.OECFType;
 import org.apache.xmpbox.type.TextType;
@@ -34,9 +35,6 @@ import java.io.InputStream;
 
 public class TestExifXmp
 {
-
-
-
     @Test
     public void testNonStrict() throws Exception
     {
@@ -52,7 +50,8 @@ public class TestExifXmp
     }
 
     @Test
-    public void testGenerate () throws Exception {
+    public void testGenerate () throws Exception
+    {
         XMPMetadata metadata = XMPMetadata.createXMPMetadata();
         TypeMapping tmapping = metadata.getTypeMapping();
         ExifSchema exif = new ExifSchema(metadata);
@@ -63,9 +62,7 @@ public class TestExifXmp
         exif.addProperty(oecf);
 
         XmpSerializer serializer = new XmpSerializer();
-        serializer.serialize(metadata,System.out,false);
-
-
 
+        serializer.serialize(metadata, new ByteArrayOutputStream(), false);
     }
 }



Mime
View raw message