@@ -46,6 +46,7 @@ This file is part of the iText (R) project.
4646import com .itextpdf .forms .PdfAcroForm ;
4747import com .itextpdf .html2pdf .ConverterProperties ;
4848import com .itextpdf .html2pdf .HtmlConverter ;
49+ import com .itextpdf .kernel .PdfException ;
4950import com .itextpdf .kernel .pdf .PdfDocument ;
5051import com .itextpdf .kernel .pdf .PdfReader ;
5152import com .itextpdf .kernel .pdf .PdfWriter ;
@@ -55,8 +56,10 @@ This file is part of the iText (R) project.
5556import org .junit .Assert ;
5657import org .junit .BeforeClass ;
5758import org .junit .Ignore ;
59+ import org .junit .Rule ;
5860import org .junit .Test ;
5961import org .junit .experimental .categories .Category ;
62+ import org .junit .rules .ExpectedException ;
6063
6164import java .io .FileInputStream ;
6265import java .io .IOException ;
@@ -73,6 +76,9 @@ public static void beforeClass() {
7376 createDestinationFolder (destinationFolder );
7477 }
7578
79+ @ Rule
80+ public ExpectedException junitExpectedException = ExpectedException .none ();
81+
7682 @ Test
7783 public void simpleTextFieldTagged () throws IOException , InterruptedException {
7884 runTest ("simpleTextFieldTagged" );
@@ -124,13 +130,22 @@ public void simpleRadioFormTagged() throws IOException, InterruptedException {
124130
125131 @ Test
126132 @ Ignore ("DEVSIX-980. DefaultHtmlProcessor ERROR No worker found for tag datalist" )
127- public void datalistFormTagged () throws IOException , InterruptedException {
128- runTest ("datalistFormTagged" );
133+ public void dataListFormTagged () throws IOException , InterruptedException {
134+ runTest ("dataListFormTagged" );
135+ }
136+
137+ @ Test
138+ public void fieldSetFormTagged () throws IOException , InterruptedException {
139+ runTest ("fieldSetFormTagged" );
129140 }
130141
131142 @ Test
132- public void fieldsetFormTagged () throws IOException , InterruptedException {
133- runTest ("fieldsetFormTagged" );
143+ // TODO DEVSIX-4601
144+ // exception is thrown on "convert tagged PDF with acroform" stage
145+ public void inputFormPrematureFlush () throws IOException , InterruptedException {
146+ junitExpectedException .expect (PdfException .class );
147+ junitExpectedException .expectMessage (PdfException .TagStructureFlushingFailedItMightBeCorrupted );
148+ runTest ("inputFormPrematureFlush" );
134149 }
135150
136151 private void runTest (String name ) throws IOException , InterruptedException {
0 commit comments