@@ -29,12 +29,10 @@ This file is part of the iText (R) project.
2929import com .itextpdf .kernel .counter .event .IEvent ;
3030import com .itextpdf .kernel .counter .event .IMetaInfo ;
3131import com .itextpdf .metainfo .TestMetaInfo ;
32+ import com .itextpdf .pdfocr .IntegrationTestHelper ;
3233import com .itextpdf .pdfocr .tesseract4 .AbstractTesseract4OcrEngine ;
33- import com .itextpdf .pdfocr .tesseract4 .Tesseract4ExecutableOcrEngine ;
34- import com .itextpdf .pdfocr .tesseract4 .Tesseract4LibOcrEngine ;
3534import com .itextpdf .pdfocr .tesseract4 .Tesseract4OcrEngineProperties ;
3635import com .itextpdf .pdfocr .tesseract4 .events .PdfOcrTesseract4Event ;
37- import com .itextpdf .test .ExtendedITextTest ;
3836import com .itextpdf .test .annotations .type .IntegrationTest ;
3937
4038import java .io .File ;
@@ -49,29 +47,16 @@ This file is part of the iText (R) project.
4947import org .junit .rules .ExpectedException ;
5048
5149@ Category (IntegrationTest .class )
52- public abstract class MultiThreadingTest extends ExtendedITextTest {
50+ public abstract class MultiThreadingTest extends IntegrationTestHelper {
5351 protected static final String destinationFolder = "./target/test/com/itextpdf/pdfocr/events/multithreading/" ;
5452 protected static final String sourceFolder = "./src/test/resources/com/itextpdf/pdfocr/events/multithreading/" ;
5553
56- private AbstractTesseract4OcrEngine tesseractReader ;
57- private String testFileTypeName ;
58- private boolean isExecutableReaderType ;
59-
60- private static Tesseract4LibOcrEngine tesseractLibReader = new Tesseract4LibOcrEngine (
61- new Tesseract4OcrEngineProperties ());
62- private static Tesseract4ExecutableOcrEngine tesseractExecutableReader = new Tesseract4ExecutableOcrEngine (
63- new Tesseract4OcrEngineProperties ());
54+ AbstractTesseract4OcrEngine tesseractReader ;
6455
6556 @ Rule
6657 public ExpectedException junitExpectedException = ExpectedException .none ();
6758
6859 public MultiThreadingTest (ReaderType type ) {
69- isExecutableReaderType = type .equals (ReaderType .EXECUTABLE );
70- if (isExecutableReaderType ) {
71- testFileTypeName = "executable" ;
72- } else {
73- testFileTypeName = "lib" ;
74- }
7560 tesseractReader = getTesseractReader (type );
7661 }
7762
@@ -80,14 +65,6 @@ public static void beforeClass() {
8065 createDestinationFolder (destinationFolder );
8166 }
8267
83- protected static AbstractTesseract4OcrEngine getTesseractReader (ReaderType type ) {
84- if (type .equals (ReaderType .LIB )) {
85- return tesseractLibReader ;
86- } else {
87- return tesseractExecutableReader ;
88- }
89- }
90-
9168 @ Before
9269 public void initTesseractProperties () {
9370 Tesseract4OcrEngineProperties ocrEngineProperties =
@@ -168,8 +145,4 @@ protected void onEvent(IEvent event, IMetaInfo metaInfo) {
168145 }
169146 }
170147
171- public enum ReaderType {
172- LIB ,
173- EXECUTABLE
174- }
175148}
0 commit comments