@@ -110,11 +110,30 @@ public void setup() {
110
110
sb .append ("END;" );
111
111
jdbcTemplate .execute (sb .toString ());
112
112
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 ());
113
131
}
114
132
115
133
@ After
116
134
public void teardown () {
117
135
executeAndIgnore (jdbcTemplate , "DROP PACKAGE junit_utplsql_test1_pkg" );
136
+ executeAndIgnore (jdbcTemplate , "DROP PACKAGE junit_utplsql_test2_pkg" );
118
137
new CodeCoverageReporterTest ().teardown ();
119
138
}
120
139
@@ -150,12 +169,17 @@ public void runTestsWithCodeCoverage() {
150
169
Assert .assertNotNull (runner );
151
170
runner .dispose ();
152
171
}
172
+
173
+ @ Test
174
+ public void runTestWithNestedCdataSection () {
175
+ UtplsqlRunner runner = new UtplsqlRunner (Collections .singletonList (":b" ), getNewConnection (), getNewConnection ());
153
176
runner .runTestAsync ();
154
177
155
178
SystemTools .waitForThread (runner .getProducerThread (), 200000 );
156
179
SystemTools .waitForThread (runner .getConsumerThread (), 200000 );
157
180
SystemTools .sleep (4 * 1000 );
158
181
Assert .assertNotNull (runner );
182
+ Assert .assertFalse (runner .isRunning ());
159
183
runner .dispose ();
160
184
}
161
185
}
0 commit comments