Author: tilman
Date: Sat Jun 28 11:29:06 2025
New Revision: 1926802

URL: http://svn.apache.org/viewvc?rev=1926802&view=rev
Log:
PDFBOX-6026: test serializer results

Modified:
    
pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/schema/PDFAIdentificationOthersTest.java

Modified: 
pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/schema/PDFAIdentificationOthersTest.java
URL: 
http://svn.apache.org/viewvc/pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/schema/PDFAIdentificationOthersTest.java?rev=1926802&r1=1926801&r2=1926802&view=diff
==============================================================================
--- 
pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/schema/PDFAIdentificationOthersTest.java
 (original)
+++ 
pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/schema/PDFAIdentificationOthersTest.java
 Sat Jun 28 11:29:06 2025
@@ -21,8 +21,11 @@
 
 package org.apache.xmpbox.schema;
 
+import java.io.ByteArrayOutputStream;
 import org.apache.xmpbox.XMPMetadata;
 import org.apache.xmpbox.type.BadFieldValueException;
+import org.apache.xmpbox.xml.DomXmpParser;
+import org.apache.xmpbox.xml.XmpSerializer;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -62,7 +65,18 @@ public class PDFAIdentificationOthersTes
         // check retrieve this schema in metadata
         Assert.assertEquals(pdfaid, metadata.getPDFIdentificationSchema());
 
-        // SaveMetadataHelper.serialize(metadata, true, System.out);
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        new XmpSerializer().serialize(metadata, bos, true);
+        XMPMetadata rxmp = new DomXmpParser().parse(bos.toByteArray());
+        pdfaid = rxmp.getPDFIdentificationSchema();
+
+        Assert.assertEquals(versionId, pdfaid.getPart());
+        Assert.assertEquals(amdId, pdfaid.getAmendment());
+        Assert.assertEquals(conformance, pdfaid.getConformance());
+
+        Assert.assertEquals("" + versionId, 
pdfaid.getPartProperty().getStringValue());
+        Assert.assertEquals(amdId, pdfaid.getAmdProperty().getStringValue());
+        Assert.assertEquals(conformance, 
pdfaid.getConformanceProperty().getStringValue());
     }
 
     @Test(expected = BadFieldValueException.class)


Reply via email to