Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd2b000

Browse files
committed
Update old tests
1 parent 9261431 commit fd2b000

5 files changed

Lines changed: 129 additions & 73 deletions

old_tests/RunAll.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ exec ut_coverage.coverage_start_develop();
8383
@@lib/RunTest.sql ut_reporters/ut_sonar_test_reporter.AcceptsFileMapping.sql
8484
@@lib/RunTest.sql ut_reporters/ut_sonar_test_reporter.ProducesExpectedOutputs.sql
8585
@@lib/RunTest.sql ut_reporters/ut_teamcity_reporter.ProducesExpectedOutputs.sql
86-
@@lib/RunTest.sql ut_reporters/ut_xunit_reporter.ProducesExpectedOutputs.sql
86+
@@lib/RunTest.sql ut_reporters/ut_junit_reporter.ProducesExpectedOutputs.sql
8787
@@lib/RunTest.sql ut_reporters/ut_html_reporter.UserOverrideSchemaCoverage.sql
8888
@@lib/RunTest.sql ut_reporters/ut_html_reporter.DefaultSchemaCoverage.sql
8989
@@lib/RunTest.sql ut_reporters/ut_documentation_reporter.reportMultipleWarnings.sql
90-
@@lib/RunTest.sql ut_reporters/ut_xunit_reporter.ReportOnSuiteWithoutDesc.sql
91-
@@lib/RunTest.sql ut_reporters/ut_xunit_reporter.ReportOnTestWithoutDesc.sql
90+
@@lib/RunTest.sql ut_reporters/ut_junit_reporter.ReportOnSuiteWithoutDesc.sql
91+
@@lib/RunTest.sql ut_reporters/ut_junit_reporter.ReportOnTestWithoutDesc.sql
9292
@@lib/RunTest.sql ut_reporters/ut_documentation_reporter.reportTestTiming.sql
9393

9494
@@lib/RunTest.sql ut/ut.run.AcceptsCoverageFileList.sql
@@ -437,8 +437,8 @@ begin
437437
'source/reporters/ut_teamcity_reporter.tps',
438438
'source/reporters/ut_teamcity_reporter_helper.pkb',
439439
'source/reporters/ut_teamcity_reporter_helper.pks',
440-
'source/reporters/ut_xunit_reporter.tpb',
441-
'source/reporters/ut_xunit_reporter.tps');
440+
'source/reporters/ut_junit_reporter.tpb',
441+
'source/reporters/ut_junit_reporter.tps');
442442

443443
l_test_run := ut_run(a_items => ut_suite_items(), a_project_file_mappings => ut_file_mapper.build_file_mappings( user,l_project_file_list));
444444

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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+
/

old_tests/ut_reporters/ut_xunit_reporter.ReportOnSuiteWithoutDesc.sql renamed to old_tests/ut_reporters/ut_junit_reporter.ReportOnSuiteWithoutDesc.sql

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
set termout off
2-
create or replace package tst_package_xunit_nodesc as
2+
create or replace package tst_package_junit_nodesc as
33
--%suite
44

55
--%test(Test name)
66
procedure test1;
77
end;
88
/
99

10-
create or replace package body tst_package_xunit_nodesc as
10+
create or replace package body tst_package_junit_nodesc as
1111
procedure test1 is begin ut.expect(1).to_equal(1); end;
1212
procedure test2 is begin ut.expect(1).to_equal(1); end;
1313
end;
@@ -21,17 +21,21 @@ declare
2121
l_output varchar2(32767);
2222
l_expected varchar2(32767);
2323
begin
24-
l_expected := q'[<testsuites tests="1" skipped="0" error="0" failure="0" name="" time="%" >
25-
<testsuite tests="1" id="1" package="tst_package_xunit_nodesc" skipped="0" error="0" failure="0" name="tst_package_xunit_nodesc" time="%" >
26-
<testcase classname="tst_package_xunit_nodesc" assertions="1" skipped="0" error="0" failure="0" name="Test name" time="%" >
24+
l_expected := q'[<testsuites tests="1" disabled="0" errors="0" failures="0" name="" time=".006307" >
25+
<testsuite tests="1" id="1" package="tst_package_junit_nodesc" disabled="0" errors="0" failures="0" name="tst_package_junit_nodesc" time=".006108" >
26+
<testcase classname="tst_package_junit_nodesc" assertions="1" name="Test name" time=".005542" >
27+
<system-out/>
28+
<system-err/>
2729
</testcase>
30+
<system-out/>
31+
<system-err/>
2832
</testsuite>
2933
</testsuites>]';
3034

3135
--act
3236
select *
3337
bulk collect into l_output_data
34-
from table(ut.run('tst_package_xunit_nodesc',ut_xunit_reporter()));
38+
from table(ut.run('tst_package_junit_nodesc',ut_junit_reporter()));
3539

3640
l_output := ut_utils.table_to_clob(l_output_data);
3741

@@ -44,4 +48,4 @@ begin
4448
end;
4549
/
4650

47-
drop package tst_package_xunit_nodesc;
51+
drop package tst_package_junit_nodesc;

old_tests/ut_reporters/ut_xunit_reporter.ReportOnTestWithoutDesc.sql renamed to old_tests/ut_reporters/ut_junit_reporter.ReportOnTestWithoutDesc.sql

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set termout off
2-
create or replace package tst_package_xunit_nodesc as
2+
create or replace package tst_package_junit_nodesc as
33
--%suite(Suite name)
44

55
--%test
@@ -10,7 +10,7 @@ create or replace package tst_package_xunit_nodesc as
1010
end;
1111
/
1212

13-
create or replace package body tst_package_xunit_nodesc as
13+
create or replace package body tst_package_junit_nodesc as
1414
procedure test1 is begin ut.expect(1).to_equal(1); end;
1515
procedure test2 is begin ut.expect(1).to_equal(1); end;
1616
end;
@@ -24,19 +24,25 @@ declare
2424
l_output varchar2(32767);
2525
l_expected varchar2(32767);
2626
begin
27-
l_expected := q'[<testsuites tests="2" skipped="0" error="0" failure="0" name="" time="%" >
28-
<testsuite tests="2" id="1" package="tst_package_xunit_nodesc" skipped="0" error="0" failure="0" name="Suite name" time="%" >
29-
<testcase classname="tst_package_xunit_nodesc" assertions="1" skipped="0" error="0" failure="0" name="test1" time="%" >
27+
l_expected := q'[<testsuites tests="2" disabled="0" errors="0" failures="0" name="" time=".011945" >
28+
<testsuite tests="2" id="1" package="tst_package_junit_nodesc" disabled="0" errors="0" failures="0" name="Suite name" time=".011724" >
29+
<testcase classname="tst_package_junit_nodesc" assertions="1" name="test1" time=".005558" >
30+
<system-out/>
31+
<system-err/>
3032
</testcase>
31-
<testcase classname="tst_package_xunit_nodesc" assertions="1" skipped="0" error="0" failure="0" name="Test name" time="%" >
33+
<testcase classname="tst_package_junit_nodesc" assertions="1" name="Test name" time=".005361" >
34+
<system-out/>
35+
<system-err/>
3236
</testcase>
37+
<system-out/>
38+
<system-err/>
3339
</testsuite>
3440
</testsuites>]';
3541

3642
--act
3743
select *
3844
bulk collect into l_output_data
39-
from table(ut.run('tst_package_xunit_nodesc',ut_xunit_reporter()));
45+
from table(ut.run('tst_package_junit_nodesc',ut_junit_reporter()));
4046

4147
l_output := ut_utils.table_to_clob(l_output_data);
4248

@@ -49,4 +55,4 @@ begin
4955
end;
5056
/
5157

52-
drop package tst_package_xunit_nodesc;
58+
drop package tst_package_junit_nodesc;

old_tests/ut_reporters/ut_xunit_reporter.ProducesExpectedOutputs.sql

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)