8000 Merge pull request #1085 from utPLSQL/feature/fix_cdata_tagging · utPLSQL/utPLSQL@20bf6dd · GitHub
[go: up one dir, main page]

Skip to content

Commit 20bf6dd

Browse files
authored
Merge pull request #1085 from utPLSQL/feature/fix_cdata_tagging
Fixed CDATA tagging in JUnit reporter
2 parents 4e7631b + cd7d738 commit 20bf6dd

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

source/core/ut_utils.pkb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,9 @@ create or replace package body ut_utils is
827827
begin
828828
if a_clob is not null and a_clob != empty_clob() then
829829
l_result := replace( a_clob, gc_cdata_end_tag, gc_cdata_end_tag_wrap );
830+
l_result := to_clob(gc_cdata_start_tag)
831+
|| replace( a_clob, gc_cdata_end_tag, gc_cdata_end_tag_wrap )
832+
|| to_clob(gc_cdata_end_tag);
830833
else
831834
l_result := a_clob;
832835
end if;

source/reporters/ut_realtime_reporter.tpb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ create or replace type body ut_realtime_reporter is
252252
) is
253253
begin
254254
if a_content is not null then
255-
self.print_xml_fragment('<' || a_name || '><![CDATA[' || ut_utils.to_cdata(a_content) || ']]></' || a_name || '>');
255+
self.print_xml_fragment('<' || a_name || '>' || ut_utils.to_cdata(a_content) || '</' || a_name || '>');
256256
end if;
257257
end print_cdata_node;
258258

test/ut3_user/reporters/test_junit_reporter.pkb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ create or replace package body test_junit_reporter as
1515
begin
1616
ut3_develop.ut.expect(1).to_equal(1);
1717
ut3_develop.ut.expect(1).to_equal(2);
18+
dbms_output.put_line('<xml_tag><![CDATA[ and some raw CDATA <with_xml_tag/> ]]></xml_tag>');
1819
end;
1920

2021
end;]';
@@ -87,6 +88,8 @@ create or replace package body test_junit_reporter as
8788
--Assert
8889
ut.expect(l_actual).not_to_be_like('%<tag>%');
8990
ut.expect(l_actual).to_be_like('%&lt;tag&gt;%');
91+
ut.expect(l_actual).to_be_like(q'/%<![CDATA[<xml_tag><![CDATA[ and some raw CDATA <with_xml_tag/> ]]]]><![CDATA[></xml_tag>
92+
]]>%/');
9093
end;
9194

9295
procedure reports_only_failed_or_errored is

0 commit comments

Comments
 (0)
0