Skip to content

Commit 8d80365

Browse files
committed
PDFBOX-5660: improve test coverage
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1930847 13f79535-47bb-0310-9956-ffa450edef68
1 parent 36a4413 commit 8d80365

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

xmpbox/src/test/java/org/apache/xmpbox/parser/DeserializationTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
import org.apache.xmpbox.schema.XMPMediaManagementSchema;
4646
import org.apache.xmpbox.schema.XMPSchema;
4747
import org.apache.xmpbox.type.BadFieldValueException;
48+
import org.apache.xmpbox.type.DateType;
49+
import org.apache.xmpbox.type.DefinedStructuredType;
4850
import org.apache.xmpbox.type.ThumbnailType;
4951
import org.apache.xmpbox.xml.DomXmpParser;
5052
import org.apache.xmpbox.xml.XmpParsingException;
@@ -188,6 +190,14 @@ void testIsartorStyleWithThumbs()
188190
assertEquals("JPEG", thumb.getFormat());
189191
assertEquals("/9j/4AAQSkZJRgABAgEASABIAAD", thumb.getImage());
190192

193+
// Check the extension schema (also serves as example on how to retrieve)
194+
XMPSchema acmeMailSchema = metadata.getSchema("http://www.acme.com/ns/email/1/");
195+
DateType deliveryDate = (DateType) acmeMailSchema.getProperty("Delivery-Date");
196+
assertEquals("2007-11-09T09:55:36+01:00", deliveryDate.getStringValue());
197+
DefinedStructuredType dst = (DefinedStructuredType) acmeMailSchema.getProperty("From");
198+
assertEquals("[name=TextType:John Doe]", dst.getProperty("name").toString());
199+
assertEquals("[mailto=TextType:[email protected]]", dst.getProperty("mailto").toString());
200+
191201
checkTransform(metadata, "64755266855514150823517184659364700851455308334441170957883187622624192802093", metadata.getAllSchemas().size());
192202
}
193203
}

0 commit comments

Comments
 (0)