pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1733346 - /pdfbox/branches/1.8/jempbox/src/test/java/org/apache/jempbox/xmp/XMPMetadataTest.java
Date Wed, 02 Mar 2016 18:14:22 GMT
Author: tilman
Date: Wed Mar  2 18:14:22 2016
New Revision: 1733346

URL: http://svn.apache.org/viewvc?rev=1733346&view=rev
Log:
PDFBOX-3257: add test

Modified:
    pdfbox/branches/1.8/jempbox/src/test/java/org/apache/jempbox/xmp/XMPMetadataTest.java

Modified: pdfbox/branches/1.8/jempbox/src/test/java/org/apache/jempbox/xmp/XMPMetadataTest.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/jempbox/src/test/java/org/apache/jempbox/xmp/XMPMetadataTest.java?rev=1733346&r1=1733345&r2=1733346&view=diff
==============================================================================
--- pdfbox/branches/1.8/jempbox/src/test/java/org/apache/jempbox/xmp/XMPMetadataTest.java
(original)
+++ pdfbox/branches/1.8/jempbox/src/test/java/org/apache/jempbox/xmp/XMPMetadataTest.java
Wed Mar  2 18:14:22 2016
@@ -18,6 +18,8 @@ package org.apache.jempbox.xmp;
 
 import java.io.IOException;
 import java.io.StringReader;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
 
 import junit.framework.TestCase;
 
@@ -81,5 +83,57 @@ public class XMPMetadataTest extends Tes
 		XMPMetadata xmp = XMPMetadata.load(new InputSource(new StringReader(xmpmeta)));
 		assertEquals("Dublin Core description", xmp.getDublinCoreSchema().getDescription());
 	}
-	
+        
+    public void testPDFBOX3257() throws IOException
+    {
+        // taken from file test-landscape2.pdf
+        String xmpmeta = "<?xpacket begin=\"\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>\n"
+                + "<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"Adobe XMP Core 4.0-c316
44.253921, Sun Oct 01 2006 17:14:39\">\n"
+                + "   <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n"
+                + "      <rdf:Description rdf:about=\"\"\n"
+                + "            xmlns:xap=\"http://ns.adobe.com/xap/1.0/\">\n"
+                + "         <xap:CreatorTool>Acrobat PDFMaker 8.1 für Word</xap:CreatorTool>\n"
+                + "         <xap:ModifyDate>2008-11-12T15:29:43+01:00</xap:ModifyDate>\n"
+                + "         <xap:CreateDate>2008-11-12T15:29:40+01:00</xap:CreateDate>\n"
+                + "         <xap:MetadataDate>2008-11-12T15:29:43+01:00</xap:MetadataDate>\n"
+                + "      </rdf:Description>\n"
+                + "      <rdf:Description rdf:about=\"\"\n"
+                + "            xmlns:pdf=\"http://ns.adobe.com/pdf/1.3/\">\n"
+                + "         <pdf:Producer>Acrobat Distiller 8.1.0 (Windows)</pdf:Producer>\n"
+                + "      </rdf:Description>\n"
+                + "      <rdf:Description rdf:about=\"\"\n"
+                + "            xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n"
+                + "         <dc:format>application/pdf</dc:format>\n"
+                + "         <dc:creator>\n"
+                + "            <rdf:Seq>\n"
+                + "               <rdf:li>R002325</rdf:li>\n"
+                + "            </rdf:Seq>\n"
+                + "         </dc:creator>\n"
+                + "         <dc:title>\n"
+                + "            <rdf:Alt>\n"
+                + "               <rdf:li xml:lang=\"x-default\"> </rdf:li>\n"
+                + "            </rdf:Alt>\n"
+                + "         </dc:title>\n"
+                + "      </rdf:Description>\n"
+                + "      <rdf:Description rdf:about=\"\"\n"
+                + "            xmlns:xapMM=\"http://ns.adobe.com/xap/1.0/mm/\">\n"
+                + "         <xapMM:DocumentID>uuid:31ae92cf-9a27-45e0-9371-0d2741e25919</xapMM:DocumentID>\n"
+                + "         <xapMM:InstanceID>uuid:2c7eb5da-9210-4666-8cef-e02ef6631c5e</xapMM:InstanceID>\n"
+                + "      </rdf:Description>\n"
+                + "      <rdf:Description rdf:about=\"\"\n"
+                + "            xmlns:pdfx=\"http://ns.adobe.com/pdfx/1.3/\">\n"
+                + "         <pdfx:Company>RWE</pdfx:Company>\n"
+                + "         <pdfx:SourceModified>D:20081112142931</pdfx:SourceModified>\n"
+                + "      </rdf:Description>\n"
+                + "   </rdf:RDF>\n"
+                + "</x:xmpmeta>\n"
+                + "<?xpacket end=\"w\"?>";
+        XMPMetadata xmp = XMPMetadata.load(new InputSource(new StringReader(xmpmeta)));
+        XMPSchemaBasic basicSchema = xmp.getBasicSchema();
+        Calendar createDate1 = basicSchema.getCreateDate();
+        basicSchema.setCreateDate(new GregorianCalendar());
+        Calendar createDate2 = basicSchema.getCreateDate();
+        assertFalse("CreateDate has not been set", createDate1.equals(createDate2));
+    }
+
 }



Mime
View raw message