File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
xmpbox/src/test/java/org/apache/xmpbox/parser Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 4545import org .apache .xmpbox .schema .XMPMediaManagementSchema ;
4646import org .apache .xmpbox .schema .XMPSchema ;
4747import org .apache .xmpbox .type .BadFieldValueException ;
48+ import org .apache .xmpbox .type .DateType ;
49+ import org .apache .xmpbox .type .DefinedStructuredType ;
4850import org .apache .xmpbox .type .ThumbnailType ;
4951import org .apache .xmpbox .xml .DomXmpParser ;
5052import 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:john@acme.com]" , dst .getProperty ("mailto" ).toString ());
200+
191201 checkTransform (metadata , "64755266855514150823517184659364700851455308334441170957883187622624192802093" , metadata .getAllSchemas ().size ());
192202 }
193203 }
You can’t perform that action at this time.
0 commit comments