|
| 1 | +declare |
| 2 | + l_output_data ut_varchar2_list; |
| 3 | + l_output varchar2(32767); |
| 4 | + l_expected varchar2(32767); |
| 5 | +begin |
| 6 | + l_expected := q'[<testsuites tests="5" disabled="1" errors="1" failures="1" name="" time=".026823" > |
| 7 | +<testsuite tests="5" id="1" package="org" disabled="1" errors="1" failures="1" name="org" time=".026549" > |
| 8 | +<testsuite tests="5" id="2" package="org.utplsql" disabled="1" errors="1" failures="1" name="utplsql" time=".026335" > |
| 9 | +<testsuite tests="5" id="3" package="org.utplsql.utplsql" disabled="1" errors="1" failures="1" name="utplsql" time=".026109" > |
| 10 | +<testsuite tests="5" id="4" package="org.utplsql.utplsql.test" disabled="1" errors="1" failures="1" name="test" time=".025908" > |
| 11 | +<testsuite tests="5" id="5" package="org.utplsql.utplsql.test.test_reporters" disabled="1" errors="1" failures="1" name="A suite for testing different outcomes from reporters" time=".025575" > |
| 12 | +<testsuite tests="1" id="6" package="org.utplsql.utplsql.test.test_reporters.test_reporters_1" disabled="0" errors="0" failures="0" name="A suite for testing html coverage options" time=".003939" > |
| 13 | +<testcase classname="org.utplsql.utplsql.test.test_reporters.test_reporters_1" assertions="1" name="a test calling package outside schema" time=".003485" > |
| 14 | +<system-out/> |
| 15 | +<system-err/> |
| 16 | +</testcase> |
| 17 | +<system-out/> |
| 18 | +<system-err/> |
| 19 | +</testsuite> |
| 20 | +<testcase classname="org.utplsql.utplsql.test.test_reporters" assertions="1" name="passing_test" time=".006677" > |
| 21 | +<system-out> |
| 22 | +<![CDATA[ |
| 23 | +<!beforeeach!> |
| 24 | +<!beforetest!> |
| 25 | +<!passing test!> |
| 26 | +<!aftertest!> |
| 27 | +<!aftereach!> |
| 28 | +]]> |
| 29 | +</system-out> |
| 30 | +<system-err/> |
| 31 | +</testcase> |
| 32 | +<testcase classname="org.utplsql.utplsql.test.test_reporters" assertions="1" name="a test with failing assertion" time=".00566" status="Failure"> |
| 33 | +<failure> |
| 34 | +<![CDATA[ |
| 35 | +"Fails as values are different" |
| 36 | +Actual: 1 (number) was expected to equal: 2 (number) |
| 37 | +at "UT3.TEST_REPORTERS", line 36 ut.expect(1,'Fails as values are different').to_equal(2); |
| 38 | +]]> |
| 39 | +</failure> |
| 40 | +<system-out> |
| 41 | +<![CDATA[ |
| 42 | +<!beforeeach!> |
| 43 | +<!failing test!> |
| 44 | +<!aftereach!> |
| 45 | +]]> |
| 46 | +</system-out> |
| 47 | +<system-err/> |
| 48 | +</testcase> |
| 49 | +<testcase classname="org.utplsql.utplsql.test.test_reporters" assertions="0" name="a test raising unhandled exception" time=".003977" status="Error"> |
| 50 | +<error> |
| 51 | +<![CDATA[ |
| 52 | +ORA-06502: PL/SQL: numeric or value error: character to number conversion error |
| 53 | +ORA-06512: at "UT3.TEST_REPORTERS", line 44 |
| 54 | +ORA-06512: at line 6 |
| 55 | +]]> |
| 56 | +</error> |
| 57 | +<system-out> |
| 58 | +<![CDATA[ |
| 59 | +<!beforeeach!> |
| 60 | +<!erroring test!> |
| 61 | +<!aftereach!> |
| 62 | +]]> |
| 63 | +</system-out> |
| 64 | +<system-err/> |
| 65 | +</testcase> |
| 66 | +<testcase classname="org.utplsql.utplsql.test.test_reporters" assertions="0" name="a disabled test" time="0" status="Disabled"> |
| 67 | +<skipped/> |
| 68 | +<system-out/> |
| 69 | +<system-err/> |
| 70 | +</testcase> |
| 71 | +<system-out> |
| 72 | +<![CDATA[ |
| 73 | +<!beforeall!> |
| 74 | +<!afterall!> |
| 75 | +]]> |
| 76 | +</system-out> |
| 77 | +<system-err/> |
| 78 | +</testsuite> |
| 79 | +</testsuite> |
| 80 | +</testsuite> |
| 81 | +</testsuite> |
| 82 | +</testsuite> |
| 83 | +</testsuites>]'; |
| 84 | + |
| 85 | + --act |
| 86 | + select * |
| 87 | + bulk collect into l_output_data |
| 88 | + from table(ut.run('test_reporters',ut_junit_reporter())); |
| 89 | + |
| 90 | + l_output := ut_utils.table_to_clob(l_output_data); |
| 91 | + |
| 92 | + --assert |
| 93 | + if l_output like l_expected then |
| 94 | + :test_result := ut_utils.gc_success; |
| 95 | + else |
| 96 | + dbms_output.put_line('Actual:"'||l_output||'"'); |
| 97 | + end if; |
| 98 | +end; |
| 99 | +/ |
0 commit comments