Author: tilman
Date: Mon Dec 29 09:58:13 2025
New Revision: 1930962

Log:
PDFBOX-6133: expand test

Modified:
   pdfbox/trunk/xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java

Modified: 
pdfbox/trunk/xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java
==============================================================================
--- 
pdfbox/trunk/xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java   
    Mon Dec 29 09:58:08 2025        (r1930961)
+++ 
pdfbox/trunk/xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java   
    Mon Dec 29 09:58:13 2025        (r1930962)
@@ -1496,7 +1496,7 @@ class DomXmpParserTest
     }
 
     @Test
-    void testPDFBox6133() throws IOException, XmpParsingException, 
BadFieldValueException
+    void testPDFBox6133() throws IOException, XmpParsingException, 
BadFieldValueException, TransformerException
     {
         // Namespace is used both for the schema and the type,
         // and that there are two types with the same namespace
@@ -1519,6 +1519,27 @@ class DomXmpParserTest
             assertEquals("[DocumentSection=TextType:cited-references]", 
struct4.getProperty("DocumentSection").toString());
             assertEquals("[StartPage=RealType:47.0]", 
struct4.getProperty("StartPage").toString());
             assertEquals("[NumberOfPages=RealType:1.0]", 
struct4.getProperty("NumberOfPages").toString());
+
+            // Serialize and repeat to ensure nothing was broken in 
serialization
+            XmpSerializer serializer = new XmpSerializer();
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            serializer.serialize(xmp, baos, true);
+            xmp = new DomXmpParser().parse(baos.toByteArray());
+            epaSchema = 
xmp.getSchema("http://www.epo.org/patent-bibliographic-data/1.0/";);
+            assertEquals("[TotalNumberOfPages=RealType:47.0]", 
epaSchema.getProperty("TotalNumberOfPages").toString());
+            pub = (DefinedStructuredType) epaSchema.getProperty("Publication");
+            assertEquals("[CountryCode=TextType:EP]", 
pub.getProperty("CountryCode").toString());
+            classification = (ArrayProperty) 
epaSchema.getProperty("Classification");
+            assertEquals(4, classification.getAllProperties().size());
+            class3 = (TextType) classification.getAllProperties().get(3);
+            assertEquals("A61K 39/215 20060101ALI20160203BHEP", 
class3.getStringValue());
+            assertEquals("CORONAVIRUS", 
epaSchema.getUnqualifiedLanguagePropertyValue("Title", "de"));
+            documentStructure = (ArrayProperty) 
epaSchema.getProperty("DocumentStructure");
+            assertEquals(5, documentStructure.getAllProperties().size());
+            struct4 = (DefinedStructuredType) 
documentStructure.getAllProperties().get(4);
+            assertEquals("[DocumentSection=TextType:cited-references]", 
struct4.getProperty("DocumentSection").toString());
+            assertEquals("[StartPage=RealType:47.0]", 
struct4.getProperty("StartPage").toString());
+            assertEquals("[NumberOfPages=RealType:1.0]", 
struct4.getProperty("NumberOfPages").toString());
         }
     }
 

Reply via email to