@@ -58,6 +58,7 @@ This file is part of the iText (R) project.
58
58
59
59
import java .io .ByteArrayInputStream ;
60
60
import java .io .ByteArrayOutputStream ;
61
+ import java .io .FileNotFoundException ;
61
62
import java .io .IOException ;
62
63
import java .nio .charset .StandardCharsets ;
63
64
@@ -211,7 +212,8 @@ public void createEmptyDocumentWithAbcXmp() throws IOException, XMPException {
211
212
@ Test
212
213
@ Ignore ("DEVSIX-1899: fails in .NET passes in Java" )
213
214
public void customXmpTest () throws IOException , InterruptedException {
214
- String xmp = "<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d' bytes='770'?>\n " +
215
+ runCustomXmpTest ("customXmp" ,
216
+ "<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d' bytes='770'?>\n " +
215
217
"\n " +
216
218
"<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'\n " +
217
219
" xmlns:iX='http://ns.adobe.com/iX/1.0/'>\n " +
@@ -232,9 +234,22 @@ public void customXmpTest() throws IOException, InterruptedException {
232
234
" </rdf:Description>\n " +
233
235
"\n " +
234
236
"</rdf:RDF>\n " +
235
- "<?xpacket end='r'?>" ;
236
- String outPath = destinationFolder + "customXmp.pdf" ;
237
- String cmpPath = sourceFolder + "cmp_customXmp.pdf" ;
237
+ "<?xpacket end='r'?>" );
238
+ }
239
+
240
+ @ Test
241
+ @ Ignore ("DEVSIX-1899: fails in .NET passes in Java" )
242
+ public void customXmpTest02 () throws IOException , InterruptedException {
243
+ runCustomXmpTest ("customXmp02" ,
244
+ "<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d' bytes='1026'?><rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'><rdf:Description about='' xmlns='http://ns.adobe.com/pdf/1.3/' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:CreationDate='2016-01-27T13:07:23Z' pdf:ModDate='2016-01-27T13:07:23Z' pdf:Producer='Acrobat Distiller 5.0.5 (Windows)' pdf:Author='Koeck' pdf:Creator='PScript5.dll Version 5.2.2' pdf:Title='Rasant_ACE.indd'/>\n " +
245
+ "<rdf:Description about='' xmlns='http://ns.adobe.com/xap/1.0/' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:CreateDate='2016-01-27T13:07:23Z' xap:ModifyDate='2016-01-27T13:07:23Z' xap:Author='Koeck' xap:MetadataDate='2016-01-27T13:07:23Z'><xap:Title><rdf:Alt><rdf:li xml:lang='x-default'>Rasant_ACE.indd</rdf:li></rdf:Alt></xap:Title></rdf:Description>\n " +
246
+ "<rdf:Description about='' xmlns='http://purl.org/dc/elements/1.1/' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:creator='Koeck' dc:title='Rasant_ACE.indd'/>\n " +
247
+ "</rdf:RDF><?xpacket end='r'?>" );
248
+ }
249
+
250
+ private void runCustomXmpTest (String name , String xmp ) throws IOException , InterruptedException {
251
+ String outPath = destinationFolder + name + ".pdf" ;
252
+ String cmpPath = sourceFolder + "cmp_" + name + ".pdf" ;
238
253
239
254
PdfDocument pdfDoc = new PdfDocument (new PdfWriter (outPath ));
240
255
PdfPage page = pdfDoc .addNewPage ();
@@ -243,7 +258,7 @@ public void customXmpTest() throws IOException, InterruptedException {
243
258
pdfDoc .close ();
244
259
245
260
CompareTool compareTool = new CompareTool ();
246
- Assert .assertNull (compareTool .compareByContent (outPath , cmpPath , destinationFolder , "diff_customXmp_ " ));
261
+ Assert .assertNull (compareTool .compareByContent (outPath , cmpPath , destinationFolder , "diff_" + name + "_ " ));
247
262
Assert .assertNull (compareTool .compareDocumentInfo (outPath , cmpPath ));
248
263
}
249
264
0 commit comments