Search in sources :

Example 11 with LogMessages

use of com.itextpdf.test.annotations.LogMessages in project i7j-pdfsweep by itext.

the class PdfCleanUpToolTest method incorrectBDCToBMCTest.

@Test
@LogMessages(messages = @LogMessage(messageTemplate = IoLogMessageConstant.PDF_REFERS_TO_NOT_EXISTING_PROPERTY_DICTIONARY))
public void incorrectBDCToBMCTest() throws IOException, InterruptedException {
    String fileName = "incorrectBDCToBMCTest";
    String input = INPUT_PATH + fileName + ".pdf";
    String output = OUTPUT_PATH + fileName + ".pdf";
    String cmp = INPUT_PATH + "cmp_" + fileName + ".pdf";
    List<PdfCleanUpLocation> cleanUpLocations = Arrays.asList(new PdfCleanUpLocation(1, new Rectangle(0, 0, 10, 10), ColorConstants.RED));
    cleanUp(input, output, cleanUpLocations);
    compareByContent(cmp, output, OUTPUT_PATH, "diff_" + fileName);
}
Also used : Rectangle(com.itextpdf.kernel.geom.Rectangle) PdfString(com.itextpdf.kernel.pdf.PdfString) IntegrationTest(com.itextpdf.test.annotations.type.IntegrationTest) ExtendedITextTest(com.itextpdf.test.ExtendedITextTest) Test(org.junit.Test) LogMessages(com.itextpdf.test.annotations.LogMessages)

Example 12 with LogMessages

use of com.itextpdf.test.annotations.LogMessages in project i7j-pdfsweep by itext.

the class PdfCleanUpToolTest method noninvertibleMatrixRemoveNothingTest.

@Test
@LogMessages(messages = @LogMessage(messageTemplate = CleanUpLogMessageConstant.FAILED_TO_PROCESS_A_TRANSFORMATION_MATRIX))
public void noninvertibleMatrixRemoveNothingTest() throws IOException, InterruptedException {
    String fileName = "noninvertibleMatrixRemoveNothingTest";
    String input = INPUT_PATH + "noninvertibleMatrix.pdf";
    String output = OUTPUT_PATH + fileName + ".pdf";
    String cmp = INPUT_PATH + "cmp_" + fileName + ".pdf";
    PdfCleanUpLocation dummyLocation = new PdfCleanUpLocation(1, new Rectangle(0, 0, 0, 0), null);
    cleanUp(input, output, Arrays.asList(dummyLocation));
    compareByContent(cmp, output, OUTPUT_PATH, "diff_noninvertibleMatrixRemoveNothingTest");
}
Also used : Rectangle(com.itextpdf.kernel.geom.Rectangle) PdfString(com.itextpdf.kernel.pdf.PdfString) IntegrationTest(com.itextpdf.test.annotations.type.IntegrationTest) ExtendedITextTest(com.itextpdf.test.ExtendedITextTest) Test(org.junit.Test) LogMessages(com.itextpdf.test.annotations.LogMessages)

Aggregations

ExtendedITextTest (com.itextpdf.test.ExtendedITextTest)12 LogMessages (com.itextpdf.test.annotations.LogMessages)12 IntegrationTest (com.itextpdf.test.annotations.type.IntegrationTest)12 Test (org.junit.Test)12 Rectangle (com.itextpdf.kernel.geom.Rectangle)9 PdfString (com.itextpdf.kernel.pdf.PdfString)7 PdfDocument (com.itextpdf.kernel.pdf.PdfDocument)1 PdfNumber (com.itextpdf.kernel.pdf.PdfNumber)1 PdfReader (com.itextpdf.kernel.pdf.PdfReader)1 PdfStream (com.itextpdf.kernel.pdf.PdfStream)1 PdfWriter (com.itextpdf.kernel.pdf.PdfWriter)1 PdfImageXObject (com.itextpdf.kernel.pdf.xobject.PdfImageXObject)1 PdfCleanUpLocation (com.itextpdf.pdfcleanup.PdfCleanUpLocation)1 CompositeCleanupStrategy (com.itextpdf.pdfcleanup.autosweep.CompositeCleanupStrategy)1 RegexBasedCleanupStrategy (com.itextpdf.pdfcleanup.autosweep.RegexBasedCleanupStrategy)1 CleanUpImagesCompareTool (com.itextpdf.pdfcleanup.util.CleanUpImagesCompareTool)1 ArrayList (java.util.ArrayList)1