@@ -29,12 +29,10 @@ This file is part of the iText (R) project.
29
29
import com .itextpdf .kernel .counter .event .IEvent ;
30
30
import com .itextpdf .kernel .counter .event .IMetaInfo ;
31
31
import com .itextpdf .metainfo .TestMetaInfo ;
32
+ import com .itextpdf .pdfocr .IntegrationTestHelper ;
32
33
import com .itextpdf .pdfocr .tesseract4 .AbstractTesseract4OcrEngine ;
33
- import com .itextpdf .pdfocr .tesseract4 .Tesseract4ExecutableOcrEngine ;
34
- import com .itextpdf .pdfocr .tesseract4 .Tesseract4LibOcrEngine ;
35
34
import com .itextpdf .pdfocr .tesseract4 .Tesseract4OcrEngineProperties ;
36
35
import com .itextpdf .pdfocr .tesseract4 .events .PdfOcrTesseract4Event ;
37
- import com .itextpdf .test .ExtendedITextTest ;
38
36
import com .itextpdf .test .annotations .type .IntegrationTest ;
39
37
40
38
import java .io .File ;
@@ -49,29 +47,16 @@ This file is part of the iText (R) project.
49
47
import org .junit .rules .ExpectedException ;
50
48
51
49
@ Category (IntegrationTest .class )
52
- public abstract class MultiThreadingTest extends ExtendedITextTest {
50
+ public abstract class MultiThreadingTest extends IntegrationTestHelper {
53
51
protected static final String destinationFolder = "./target/test/com/itextpdf/pdfocr/events/multithreading/" ;
54
52
protected static final String sourceFolder = "./src/test/resources/com/itextpdf/pdfocr/events/multithreading/" ;
55
53
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 ;
64
55
65
56
@ Rule
66
57
public ExpectedException junitExpectedException = ExpectedException .none ();
67
58
68
59
public MultiThreadingTest (ReaderType type ) {
69
- isExecutableReaderType = type .equals (ReaderType .EXECUTABLE );
70
- if (isExecutableReaderType ) {
71
- testFileTypeName = "executable" ;
72
- } else {
73
- testFileTypeName = "lib" ;
74
- }
75
60
tesseractReader = getTesseractReader (type );
76
61
}
77
62
@@ -80,14 +65,6 @@ public static void beforeClass() {
80
65
createDestinationFolder (destinationFolder );
81
66
}
82
67
83
- protected static AbstractTesseract4OcrEngine getTesseractReader (ReaderType type ) {
84
- if (type .equals (ReaderType .LIB )) {
85
- return tesseractLibReader ;
86
- } else {
87
- return tesseractExecutableReader ;
88
- }
89
- }
90
-
91
68
@ Before
92
69
public void initTesseractProperties () {
93
70
Tesseract4OcrEngineProperties ocrEngineProperties =
@@ -168,8 +145,4 @@ protected void onEvent(IEvent event, IMetaInfo metaInfo) {
168
145
}
169
146
}
170
147
171
- public enum ReaderType {
172
- LIB ,
173
- EXECUTABLE
174
- }
175
148
}
0 commit comments