@@ -229,11 +229,10 @@ public void sameNamedDestinationsInDifferentStructureElementsOnPageTest(PdfName
229
229
PdfNamedDestination namedDestination = getNamedDestination (pdfDoc , structElem , "dest" );
230
230
addLinkAnnotations (destLocation , pdfDoc , namedDestination );
231
231
});
232
- framework .assertITextFail ("sameNamedDestinations_" + destLocation .getValue (),
233
- PdfUAExceptionMessageConstants .SAME_LINKS_IN_DIFFERENT_STRUCT_ELEMS , PdfUAConformance .PDF_UA_2 );
234
232
// TODO DEVSIX-9036. VeraPDF claims the document to be valid, although it's not.
235
233
// We will need to update this test when veraPDF behavior is fixed and veraPDF version is updated.
236
- framework .assertVeraPdfValid ("sameNamedDestinations_" + destLocation .getValue (), PdfUAConformance .PDF_UA_2 );
234
+ framework .assertOnlyITextFail ("sameNamedDestinations_" + destLocation .getValue (),
235
+ PdfUAExceptionMessageConstants .SAME_LINKS_IN_DIFFERENT_STRUCT_ELEMS , PdfUAConformance .PDF_UA_2 );
237
236
}
238
237
239
238
@ ParameterizedTest
@@ -244,11 +243,10 @@ public void sameStringDestinationsInDifferentStructureElementsOnPageTest(PdfName
244
243
PdfStringDestination namedDestination = getStringDestination (pdfDoc , structElem , "dest" );
245
244
addLinkAnnotations (destLocation , pdfDoc , namedDestination );
246
245
});
247
- framework .assertITextFail ("sameStringDestinations_" + destLocation .getValue (),
248
- PdfUAExceptionMessageConstants .SAME_LINKS_IN_DIFFERENT_STRUCT_ELEMS , PdfUAConformance .PDF_UA_2 );
249
246
// TODO DEVSIX-9036. VeraPDF claims the document to be valid, although it's not.
250
247
// We will need to update this test when veraPDF behavior is fixed and veraPDF version is updated.
251
- framework .assertVeraPdfValid ("sameStringDestinations_" + destLocation .getValue (), PdfUAConformance .PDF_UA_2 );
248
+ framework .assertOnlyITextFail ("sameStringDestinations_" + destLocation .getValue (),
249
+ PdfUAExceptionMessageConstants .SAME_LINKS_IN_DIFFERENT_STRUCT_ELEMS , PdfUAConformance .PDF_UA_2 );
252
250
}
253
251
254
252
@ ParameterizedTest
@@ -267,11 +265,11 @@ public void sameStringDestinationsInDifferentStructureElementsSDTest(PdfName des
267
265
268
266
addLinkAnnotations (destLocation , pdfDoc , namedDestination );
269
267
});
270
- framework .assertITextFail ("sameStringDestinationsSD_" + destLocation .getValue (),
271
- PdfUAExceptionMessageConstants .SAME_LINKS_IN_DIFFERENT_STRUCT_ELEMS , PdfUAConformance .PDF_UA_2 );
272
268
// TODO DEVSIX-9036. VeraPDF claims the document to be valid, although it's not.
273
269
// We will need to update this test when veraPDF behavior is fixed and veraPDF version is updated.
274
- framework .assertVeraPdfValid ("sameStringDestinationsSD_" + destLocation .getValue (), PdfUAConformance .PDF_UA_2 );
270
+ framework .assertOnlyITextFail ("sameStringDestinationsSD_" + destLocation .getValue (),
271
+ PdfUAExceptionMessageConstants .SAME_LINKS_IN_DIFFERENT_STRUCT_ELEMS , PdfUAConformance .PDF_UA_2 );
272
+
275
273
}
276
274
277
275
@ ParameterizedTest
@@ -290,17 +288,15 @@ public void sameStringDestinationsInDifferentStructureElementsDTest(PdfName dest
290
288
});
291
289
// TODO DEVSIX-9036. VeraPDF claims the document to be valid, although it's not.
292
290
// We will need to update this test when veraPDF behavior is fixed and veraPDF version is updated.
293
- framework .assertITextFail ("sameStringDestinationsD_" + destLocation .getValue (),
294
- PdfUAExceptionMessageConstants .SAME_LINKS_IN_DIFFERENT_STRUCT_ELEMS , PdfUAConformance .PDF_UA_2 );
295
291
if (PdfName .SD .equals (destLocation )) {
296
- framework .assertVeraPdfValid ("sameStringDestinationsD_" + destLocation .getValue (),
297
- PdfUAConformance .PDF_UA_2 );
292
+ framework .assertOnlyITextFail ("sameStringDestinationsD_" + destLocation .getValue (),
293
+ PdfUAExceptionMessageConstants . SAME_LINKS_IN_DIFFERENT_STRUCT_ELEMS , PdfUAConformance .PDF_UA_2 );
298
294
} else {
299
295
// In case PdfName.D or Dest equals destLocation, VeraPDF doesn't allow actions with structure destination being
300
296
// placed in D entry. Instead, it requires structure destination to be added into special SD entry. There is
301
297
// no such requirement in released PDF 2.0 spec. Although it is already mentioned in errata version.
302
- framework .assertVeraPdfFail ("sameStringDestinationsD_" + destLocation .getValue (),
303
- PdfUAConformance .PDF_UA_2 );
298
+ framework .assertBothFail ("sameStringDestinationsD_" + destLocation .getValue (),
299
+ PdfUAExceptionMessageConstants . SAME_LINKS_IN_DIFFERENT_STRUCT_ELEMS , PdfUAConformance .PDF_UA_2 );
304
300
}
305
301
}
306
302
@@ -333,12 +329,10 @@ public void differentNamedDestinationsInSameStructureElementTest(PdfName destLoc
333
329
334
330
addLinkAnnotations (destLocation , pdfDoc , namedDestination1 , namedDestination2 , false );
335
331
});
336
- framework .assertITextFail ("differentNamedDestinations_" + destLocation .getValue (),
337
- PdfUAExceptionMessageConstants .DIFFERENT_LINKS_IN_SINGLE_STRUCT_ELEM , PdfUAConformance .PDF_UA_2 );
338
332
// TODO DEVSIX-9036. VeraPDF claims the document to be valid, although it's not.
339
333
// We will need to update this test when veraPDF behavior is fixed and veraPDF version is updated.
340
- framework .assertVeraPdfValid ("differentNamedDestinations_" + destLocation .getValue (),
341
- PdfUAConformance .PDF_UA_2 );
334
+ framework .assertOnlyITextFail ("differentNamedDestinations_" + destLocation .getValue (),
335
+ PdfUAExceptionMessageConstants . DIFFERENT_LINKS_IN_SINGLE_STRUCT_ELEM , PdfUAConformance .PDF_UA_2 );
342
336
}
343
337
344
338
@ ParameterizedTest
@@ -353,12 +347,10 @@ public void differentStringDestinationsInSameStructureElementTest(PdfName destLo
353
347
354
348
addLinkAnnotations (destLocation , pdfDoc , namedDestination1 , namedDestination2 , false );
355
349
});
356
- framework .assertITextFail ("differentStringDestinations_" + destLocation .getValue (),
357
- PdfUAExceptionMessageConstants .DIFFERENT_LINKS_IN_SINGLE_STRUCT_ELEM , PdfUAConformance .PDF_UA_2 );
358
350
// TODO DEVSIX-9036. VeraPDF claims the document to be valid, although it's not.
359
351
// We will need to update this test when veraPDF behavior is fixed and veraPDF version is updated.
360
- framework .assertVeraPdfValid ("differentStringDestinations_" + destLocation .getValue (),
361
- PdfUAConformance .PDF_UA_2 );
352
+ framework .assertOnlyITextFail ("differentStringDestinations_" + destLocation .getValue (),
353
+ PdfUAExceptionMessageConstants . DIFFERENT_LINKS_IN_SINGLE_STRUCT_ELEM , PdfUAConformance .PDF_UA_2 );
362
354
}
363
355
364
356
@ ParameterizedTest
@@ -465,14 +457,13 @@ private static PdfFont loadFont() {
465
457
private void validate (String filename , String expectedMessage , PdfName destLocation ) throws IOException {
466
458
// TODO DEVSIX-9036. VeraPDF claims the document to be valid, although it's not.
467
459
// We will need to update this test when veraPDF behavior is fixed and veraPDF version is updated.
468
- framework .assertITextFail (filename + destLocation .getValue (), expectedMessage , PdfUAConformance .PDF_UA_2 );
469
460
if (PdfName .D .equals (destLocation )) {
470
461
// In case PdfName.D equals destLocation, VeraPDF doesn't allow actions with structure destination being
471
462
// placed in D entry. Instead, it requires structure destination to be added into special SD entry. There is
472
463
// no such requirement in released PDF 2.0 spec. Although it is already mentioned in errata version.
473
- framework .assertVeraPdfFail (filename + destLocation .getValue (), PdfUAConformance .PDF_UA_2 );
464
+ framework .assertBothFail (filename + destLocation .getValue (), PdfUAConformance .PDF_UA_2 );
474
465
} else {
475
- framework .assertVeraPdfValid (filename + destLocation .getValue (), PdfUAConformance .PDF_UA_2 );
466
+ framework .assertOnlyITextFail (filename + destLocation .getValue (), expectedMessage , PdfUAConformance .PDF_UA_2 );
476
467
}
477
468
}
478
469
}
0 commit comments