GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Nested CDATA section causes invalid XML message by ut_realtime_reporter · Issue #1073 · utPLSQL/utPLSQL Closed Labels DescriptionDescribe the bugWhen an utPLSQL output contains a CDATA section, then the This is related to utPLSQL/utPLSQL-SQLDeveloper#107. Provide version infoTo Reproduce1. Create Test PackageCREATE OR REPLACE PACKAGE junit_utplsql_test2_pkg is --%suite(JUnit testing) --%suitepath(b)\n --%test(test XML with nested CDATA) PROCEDURE test_nested_cdata; END; / CREATE OR REPLACE PACKAGE BODY junit_utplsql_test2_pkg IS PROCEDURE test_nested_cdata IS BEGIN dbms_output.put_line('nested cdata block: <![CDATA[...]]>, to be handled.'); ut.expect(1).to_equal(1); END; END; / 2. Run TestDECLARE l_reporter ut_realtime_reporter := ut_realtime_reporter(); BEGIN l_reporter.set_reporter_id('12345'); l_reporter.output_buffer.init(); sys.dbms_output.enable(NULL); ut_runner.run( a_paths => ut_varchar2_list('junit_utplsql_test2_pkg'), a_reporters => ut_reporters(l_reporter) ); sys.dbms_output.disable; END; / 3. Consume wrong XML messageWITH
FUNCTION reporter return ut_realtime_reporter IS
l_reporter ut_realtime_reporter := ut_realtime_reporter();
BEGIN
l_reporter.set_reporter_id('12345');
RETURN l_reporter;
END;
SELECT text
FROM TABLE(reporter().get_lines())
WHERE item_type = 'post-test'
/This produces the following output: <?xml version="1.0"?> <event type="post-test"> <test id="junit_utplsql_test2_pkg.test_nested_cdata"> <testNumber>1</testNumber> <totalNumberOfTests>1</totalNumberOfTests> <startTime>2020-06-04T10:47:00.245501</startTime> <endTime>2020-06-04T10:47:00.250778</endTime> <executionTime>.005277</executionTime> <counter> <disabled>0</disabled> <success>1</success> <failure>0</failure> <error>0</error> <warning>0</warning> </counter> <serverOutput><![CDATA[nested cdata block: <![CDATA[...]]>, to be handled. ]]></serverOutput> </test> </event> This is not a valid XML document. You can go to https://www.xmlvalidation.com/ and paste the result there for details. The reason is the nested CDATA section. Expected behaviorProduce a valid XML document. Always. ActivityMetadataMetadataAssigneesLabelsTypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |