@@ -1415,7 +1415,7 @@ void testNoSchema() throws XmpParsingException
14151415 @ Test
14161416 void testNoInstantiation () throws XmpParsingException
14171417 {
1418- // Instantiation fails because of bad date
1418+ // Instantiation fails because of a bad date property
14191419 String s = "<?xml version=\" 1.0\" encoding=\" UTF-8\" standalone=\" no\" ?>\n " +
14201420 "<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?><?adobe-xap-filters esc=\" CRLF\" ?><x:xmpmeta xmlns:x=\" adobe:ns:meta/\" x:xmptk=\" XMP toolkit 2.9.1-13, framework 1.6\" >\n " +
14211421 " <rdf:RDF xmlns:iX=\" http://ns.adobe.com/iX/1.0/\" xmlns:rdf=\" http://www.w3.org/1999/02/22-rdf-syntax-ns#\" >\n " +
@@ -1430,6 +1430,25 @@ void testNoInstantiation() throws XmpParsingException
14301430 assertEquals ("Failed to instantiate DateType property with value 2019-05-02T22:03:5Z in xmp:CreateDate" , ex .getMessage ());
14311431 }
14321432
1433+ @ Test
1434+ void testNoInstantiation2 () throws XmpParsingException
1435+ {
1436+ // Instantiation fails because of a bad date attribute
1437+ String s =
1438+ "<?xml version=\" 1.0\" encoding=\" UTF-8\" standalone=\" no\" ?>\n " +
1439+ "<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?><?adobe-xap-filters esc=\" CRLF\" ?><x:xmpmeta xmlns:x=\" adobe:ns:meta/\" x:xmptk=\" XMP toolkit 2.9.1-13, framework 1.6\" >\n " +
1440+ " <rdf:RDF xmlns:iX=\" http://ns.adobe.com/iX/1.0/\" xmlns:rdf=\" http://www.w3.org/1999/02/22-rdf-syntax-ns#\" >\n " +
1441+ " <rdf:Description xmlns:xap=\" http://ns.adobe.com/xap/1.0/\" xap:CreateDate=\" 2016-03-09T19:47:1Z\" >\n " +
1442+ " <xap:CreatorTool>PrimoPDF http://www.primopdf.com</xap:CreatorTool>\n " +
1443+ " </rdf:Description>\n " +
1444+ " </rdf:RDF>\n " +
1445+ "</x:xmpmeta><?xpacket end='w'?>" ;
1446+ final DomXmpParser xmpParser1 = new DomXmpParser ();
1447+ XmpParsingException ex = assertThrows (XmpParsingException .class ,
1448+ () -> xmpParser1 .parse (s .getBytes (StandardCharsets .UTF_8 )));
1449+ assertEquals ("Failed to instantiate DateType property with value 2016-03-09T19:47:1Z in xap:CreateDate" , ex .getMessage ());
1450+ }
1451+
14331452 @ Test
14341453 void testPDFBox6131 () throws IOException , XmpParsingException , BadFieldValueException
14351454 {
0 commit comments