|
1 | | -PROMPT Disable whole suite by disabled flag |
2 | | - |
3 | 1 | --Arrange |
| 2 | +create or replace package test_disabled_suite as |
| 3 | + --%suite |
| 4 | + --%disabled |
| 5 | + gv_glob_val number := 0; |
| 6 | + --%beforeall |
| 7 | + procedure before_all; |
| 8 | + --%test |
| 9 | + procedure test1; |
| 10 | + --%test |
| 11 | + procedure test2; |
| 12 | +end; |
| 13 | +/ |
| 14 | + |
4 | 15 | declare |
5 | | - l_suite ut_logical_suite; |
6 | | - l_test ut_test; |
7 | | - l_parsing_result ut_annotations.typ_annotated_package; |
8 | | - l_expected ut_annotations.typ_annotated_package; |
9 | | - l_ann_param ut_annotations.typ_annotation_param; |
10 | | - l_cnt number; |
11 | | - l_listener ut_event_listener := ut_event_listener(ut_reporters()); |
| 16 | + l_lines ut_varchar2_list; |
| 17 | + l_results clob; |
12 | 18 | begin |
13 | | - |
14 | | - delete from ut$test_table; |
15 | | - |
16 | | - l_test := ut_test(a_object_name => 'ut_transaction_control',a_name => 'test', a_rollback_type => ut_utils.gc_rollback_auto); |
17 | | - l_suite := ut_suite (a_description => 'Suite name', a_name => 'UT_TRANSACTION_CONTROL', a_object_name => 'UT_TRANSACTION_CONTROL', a_rollback_type => ut_utils.gc_rollback_auto,a_path => 'ut_transaction_control'); |
18 | | - l_suite.add_item(l_test); |
19 | | - l_suite.set_disabled_flag(true); |
20 | | - |
21 | 19 | --Act |
22 | | - l_suite.do_execute(l_listener); |
| 20 | + select * bulk collect into l_lines from table(ut.run('test_disabled_suite')); |
23 | 21 |
|
24 | | - ut_expectation_processor.clear_expectations; |
| 22 | + l_results := ut_utils.table_to_clob(l_lines); |
25 | 23 |
|
26 | 24 | --Assert |
27 | | - ut.expect(ut_transaction_control.count_rows('t')).to_equal(0); |
| 25 | + ut.expect(l_results).to_be_like('%test1 [0 sec] (IGNORED)%'); |
| 26 | + ut.expect(l_results).to_be_like('%test2 [0 sec] (IGNORED)%'); |
| 27 | + ut.expect(l_results).to_be_like('%2 tests, 0 failed, 0 errored, 2 disabled, 0 warning(s)%'); |
28 | 28 |
|
29 | 29 | if ut_expectation_processor.get_status = ut_utils.tr_success then |
30 | 30 | :test_result := ut_utils.tr_success; |
| 31 | + else |
| 32 | + dbms_output.put_line( |
| 33 | + xmltype( |
| 34 | + anydata.convertcollection( |
| 35 | + ut_expectation_processor.get_expectations_results() |
| 36 | + ) |
| 37 | + ).getclobval() |
| 38 | + ); |
31 | 39 | end if; |
32 | | - |
33 | 40 | end; |
34 | 41 | / |
| 42 | + |
| 43 | +drop package test_disabled_suite |
| 44 | +/ |
0 commit comments