@@ -110,11 +110,30 @@ public void setup() {
110110 sb .append ("END;" );
111111 jdbcTemplate .execute (sb .toString ());
112112 new CodeCoverageReporterTest ().setup ();
113+ sb .setLength (0 );
114+ sb .append ("CREATE OR REPLACE PACKAGE junit_utplsql_test2_pkg is\n " );
115+ sb .append (" --%suite(JUnit testing)\n " );
116+ sb .append (" --%suitepath(b)\n \n " );
117+
118+ sb .append (" --%test(test XML with nested CDATA)\n " );
119+ sb .append (" PROCEDURE test_nested_cdata;\n \n " );
120+ sb .append ("END;" );
121+ jdbcTemplate .execute (sb .toString ());
122+ sb .setLength (0 );
123+ sb .append ("CREATE OR REPLACE PACKAGE BODY junit_utplsql_test2_pkg IS\n " );
124+ sb .append (" PROCEDURE test_nested_cdata IS\n " );
125+ sb .append (" BEGIN\n " );
126+ sb .append (" dbms_output.put_line('nested cdata block: <![CDATA[...]]>, to be handled.');\n " );
127+ sb .append (" ut.expect(1).to_equal(1);\n " );
128+ sb .append (" END;\n " );
129+ sb .append ("END;" );
130+ jdbcTemplate .execute (sb .toString ());
113131 }
114132
115133 @ After
116134 public void teardown () {
117135 executeAndIgnore (jdbcTemplate , "DROP PACKAGE junit_utplsql_test1_pkg" );
136+ executeAndIgnore (jdbcTemplate , "DROP PACKAGE junit_utplsql_test2_pkg" );
118137 new CodeCoverageReporterTest ().teardown ();
119138 }
120139
@@ -150,12 +169,17 @@ public void runTestsWithCodeCoverage() {
150169 Assert .assertNotNull (runner );
151170 runner .dispose ();
152171 }
172+
173+ @ Test
174+ public void runTestWithNestedCdataSection () {
175+ UtplsqlRunner runner = new UtplsqlRunner (Collections .singletonList (":b" ), getNewConnection (), getNewConnection ());
153176 runner .runTestAsync ();
154177
155178 SystemTools .waitForThread (runner .getProducerThread (), 200000 );
156179 SystemTools .waitForThread (runner .getConsumerThread (), 200000 );
157180 SystemTools .sleep (4 * 1000 );
158181 Assert .assertNotNull (runner );
182+ Assert .assertFalse (runner .isRunning ());
159183 runner .dispose ();
160184 }
161185}
0 commit comments