|
1 | 1 | create or replace package ut_output_tests |
2 | 2 | as |
3 | 3 | --%suite |
4 | | - |
| 4 | + |
5 | 5 | --%beforeeach |
6 | 6 | procedure beforeeach; |
7 | | - |
| 7 | + |
8 | 8 | --%aftereach |
9 | 9 | procedure aftereach; |
10 | | - |
| 10 | + |
11 | 11 | --%test |
12 | 12 | --%beforetest(beforetest) |
13 | 13 | --%aftertest(aftertest) |
14 | 14 | procedure ut_passing_test; |
15 | | - |
| 15 | + |
16 | 16 | procedure beforetest; |
17 | | - |
| 17 | + |
18 | 18 | procedure aftertest; |
19 | | - |
| 19 | + |
20 | 20 | --%beforeall |
21 | 21 | procedure beforeall; |
22 | | - --%afterall |
| 22 | + --%afterall |
23 | 23 | procedure afterall; |
24 | | - |
| 24 | + |
25 | 25 | end; |
26 | 26 | / |
27 | 27 |
|
|
38 | 38 | begin |
39 | 39 | dbms_output.put_line('<!aftertest!>'); |
40 | 40 | end; |
41 | | - |
| 41 | + |
42 | 42 | procedure beforeeach is |
43 | 43 | begin |
44 | 44 | dbms_output.put_line('<!beforeeach!>'); |
|
55 | 55 | dbms_output.put_line('<!thetest!>'); |
56 | 56 | ut.expect(1,'Test 1 Should Pass').to_equal(1); |
57 | 57 | end; |
58 | | - |
| 58 | + |
59 | 59 | procedure beforeall is |
60 | 60 | begin |
61 | 61 | dbms_output.put_line('<!beforeall!>'); |
|
70 | 70 | / |
71 | 71 |
|
72 | 72 | declare |
73 | | - l_output_data dbms_output.chararr; |
74 | | - l_num_lines integer := 100000; |
| 73 | + l_output_data ut_varchar2_list; |
75 | 74 | l_output clob; |
76 | 75 | begin |
77 | 76 | --act |
78 | | - ut.run('ut_output_tests',ut_teamcity_reporter); |
| 77 | + select * |
| 78 | + bulk collect into l_output_data |
| 79 | + from table(ut.run('ut_output_tests',ut_teamcity_reporter())); |
79 | 80 |
|
| 81 | + l_output := ut_utils.table_to_clob(l_output_data); |
80 | 82 | --assert |
81 | | - dbms_output.get_lines( l_output_data, l_num_lines); |
82 | | - dbms_lob.createtemporary(l_output,true); |
83 | | - for i in 1 .. l_num_lines loop |
84 | | - dbms_lob.append(l_output,l_output_data(i)); |
85 | | - end loop; |
| 83 | + |
86 | 84 | if l_output like '%##teamcity[testStarted%<!beforeeach!>%<!beforetest!>%<!thetest!>%<!aftertest!>%<!aftereach!>%##teamcity[testFinished%' then |
87 | 85 | :test_result := ut_utils.tr_success; |
88 | | - end if; |
89 | | - |
90 | | - if :test_result != ut_utils.tr_success or :test_result is null then |
91 | | - for i in 1 .. l_num_lines loop |
| 86 | + else |
| 87 | + for i in 1 .. l_output_data.count loop |
92 | 88 | dbms_output.put_line(l_output_data(i)); |
93 | 89 | end loop; |
94 | | - dbms_output.put_line('Failed: Wrong output'); |
95 | 90 | end if; |
| 91 | + |
96 | 92 | end; |
97 | 93 | / |
98 | 94 |
|
|
0 commit comments