Author: tilman
Date: Sat Jun 28 11:28:59 2025
New Revision: 1926800

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

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

Modified: 
pdfbox/branches/3.0/xmpbox/src/test/java/org/apache/xmpbox/schema/PDFAIdentificationOthersTest.java
URL: 
http://svn.apache.org/viewvc/pdfbox/branches/3.0/xmpbox/src/test/java/org/apache/xmpbox/schema/PDFAIdentificationOthersTest.java?rev=1926800&r1=1926799&r2=1926800&view=diff
==============================================================================
--- 
pdfbox/branches/3.0/xmpbox/src/test/java/org/apache/xmpbox/schema/PDFAIdentificationOthersTest.java
 (original)
+++ 
pdfbox/branches/3.0/xmpbox/src/test/java/org/apache/xmpbox/schema/PDFAIdentificationOthersTest.java
 Sat Jun 28 11:28:59 2025
@@ -21,11 +21,14 @@
 
 package org.apache.xmpbox.schema;
 
+import java.io.ByteArrayOutputStream;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
 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.jupiter.api.Test;
 
 class PDFAIdentificationOthersTest
@@ -55,7 +58,18 @@ class PDFAIdentificationOthersTest
         // check retrieve this schema in metadata
         assertEquals(pdfaid, metadata.getPDFAIdentificationSchema());
 
-        // 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.getPDFAIdentificationSchema();
+
+        assertEquals(versionId, pdfaid.getPart());
+        assertEquals(amdId, pdfaid.getAmendment());
+        assertEquals(conformance, pdfaid.getConformance());
+
+        assertEquals("" + versionId, 
pdfaid.getPartProperty().getStringValue());
+        assertEquals(amdId, pdfaid.getAmdProperty().getStringValue());
+        assertEquals(conformance, 
pdfaid.getConformanceProperty().getStringValue());
     }
 
     @Test


Reply via email to