Skip to content

Commit ddf3a7f

Browse files
committed
Phase 2 : switch to varchar_rows()
1 parent 66257d1 commit ddf3a7f

20 files changed

+57
-77
lines changed

source/api/ut_runner.pkb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ create or replace package body ut_runner is
9999
l_include_object_names ut_object_names;
100100
l_paths ut_varchar2_list := ut_varchar2_list();
101101
l_random_test_order_seed positive;
102+
l_tags ut_varchar2_rows := ut_varchar2_rows();
102103
begin
103104
ut_event_manager.initialize();
104105
if a_reporters is not empty then
@@ -139,7 +140,12 @@ create or replace package body ut_runner is
139140
if a_exclude_objects is not empty then
140141
l_exclude_object_names := to_ut_object_list(a_exclude_objects, l_coverage_schema_names);
141142
end if;
142-
143+
144+
if a_tags is not null then
145+
l_tags := l_tags multiset union distinct ut_utils.convert_collection(
146+
ut_utils.filter_list(ut_utils.string_to_table(a_tags,','),'^(\w|\S)+$')
147+
);
148+
end if;
143149
l_exclude_object_names := l_exclude_object_names multiset union all ut_suite_manager.get_schema_ut_packages(l_coverage_schema_names);
144150

145151
l_include_object_names := to_ut_object_list(a_include_objects, l_coverage_schema_names);
@@ -154,10 +160,10 @@ create or replace package body ut_runner is
154160
set(a_test_file_mappings),
155161
a_client_character_set,
156162
l_random_test_order_seed,
157-
a_tags
163+
l_tags
158164
);
159165

160-
ut_suite_manager.configure_execution_by_path(l_paths, l_run.items, l_random_test_order_seed, a_tags);
166+
ut_suite_manager.configure_execution_by_path(l_paths, l_run.items, l_random_test_order_seed, l_tags);
161167
if a_force_manual_rollback then
162168
l_run.set_rollback_type( a_rollback_type => ut_utils.gc_rollback_manual, a_force => true );
163169
end if;

source/api/ut_suite_item_info.tps

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ create or replace type ut_suite_item_info as object (
2222
item_type varchar2( 250 ), -- the type of item (UT_SUITE/UT_SUITE_CONTEXT/UT_TEST)
2323
item_line_no integer, -- line_number where annotation identifying the item exists
2424
path varchar2( 4000 ),-- suitepath of the item
25-
disabled_flag integer -- 0 (zero) if item is not disabled, 1 if item is disabled by --%disabled annotation
25+
disabled_flag integer, -- 0 (zero) if item is not disabled, 1 if item is disabled by --%disabled annotation
26+
tags varchar2(4000)
2627
)
2728
/

source/core/types/ut_run.tpb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ create or replace type body ut_run as
2727
a_test_file_mappings ut_file_mappings := null,
2828
a_client_character_set varchar2 := null,
2929
a_random_test_order_seed positive := null,
30-
a_run_tags varchar2 := null
30+
a_run_tags ut_varchar2_rows := null
3131
) return self as result is
3232
begin
3333
self.run_paths := a_run_paths;

source/core/types/ut_run.tps

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ create or replace type ut_run under ut_suite_item (
2121
project_name varchar2(4000),
2222
items ut_suite_items,
2323
run_paths ut_varchar2_list,
24-
run_tags varchar2(4000),
24+
run_tags ut_varchar2_rows,
2525
coverage_options ut_coverage_options,
2626
test_file_mappings ut_file_mappings,
2727
client_character_set varchar2(100),
@@ -37,7 +37,7 @@ create or replace type ut_run under ut_suite_item (
3737
a_test_file_mappings ut_file_mappings := null,
3838
a_client_character_set varchar2 := null,
3939
a_random_test_order_seed positive := null,
40-
a_run_tags varchar2 := null
40+
a_run_tags ut_varchar2_rows := null
4141
) return self as result,
4242
overriding member procedure mark_as_skipped(self in out nocopy ut_run),
4343
overriding member function do_execute(self in out nocopy ut_run) return boolean,

source/core/types/ut_suite.tpb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ create or replace type body ut_suite as
1818

1919
constructor function ut_suite (
2020
self in out nocopy ut_suite, a_object_owner varchar2, a_object_name varchar2, a_line_no integer,
21-
a_tags varchar2 := null
21+
a_tags ut_varchar2_rows := null
2222
) return self as result is
2323
begin
2424
self.self_type := $$plsql_unit;
2525
self.init(a_object_owner, a_object_name, a_object_name, a_line_no);
2626
self.items := ut_suite_items();
2727
before_all_list := ut_executables();
2828
after_all_list := ut_executables();
29-
self.tags := a_tags;
29+
self.tags := coalesce(a_tags,ut_varchar2_rows());
3030
return;
3131
end;
3232

source/core/types/ut_suite.tps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ create or replace type ut_suite under ut_logical_suite (
2828
after_all_list ut_executables,
2929
constructor function ut_suite (
3030
self in out nocopy ut_suite, a_object_owner varchar2, a_object_name varchar2, a_line_no integer,
31-
a_tags varchar2 := null
31+
a_tags ut_varchar2_rows := null
3232
) return self as result,
3333
overriding member function do_execute(self in out nocopy ut_suite) return boolean,
3434
overriding member function get_error_stack_traces(self ut_suite) return ut_varchar2_list,

source/core/types/ut_suite_item.tps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ create or replace type ut_suite_item force under ut_event_item (
6363
/**
6464
* Hold list of tags assign to test
6565
*/
66-
tags varchar2(4000),
66+
tags ut_varchar2_rows,
6767
member procedure init(self in out nocopy ut_suite_item, a_object_owner varchar2, a_object_name varchar2, a_name varchar2, a_line_no integer),
6868
member function get_disabled_flag return boolean,
6969
not instantiable member procedure mark_as_skipped(self in out nocopy ut_suite_item),

source/core/types/ut_test.tpb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ create or replace type body ut_test as
1818

1919
constructor function ut_test(
2020
self in out nocopy ut_test, a_object_owner varchar2 := null, a_object_name varchar2, a_name varchar2,
21-
a_line_no integer, a_expected_error_codes ut_integer_list := null, a_tags varchar2 := null
21+
a_line_no integer, a_expected_error_codes ut_integer_list := null, a_tags ut_varchar2_rows := null
2222
) return self as result is
2323
begin
2424
self.self_type := $$plsql_unit;
@@ -31,7 +31,7 @@ create or replace type body ut_test as
3131
self.all_expectations := ut_expectation_results();
3232
self.failed_expectations := ut_expectation_results();
3333
self.expected_error_codes := a_expected_error_codes;
34-
self.tags := a_tags;
34+
self.tags := coalesce(a_tags,ut_varchar2_rows());
3535
return;
3636
end;
3737

source/core/types/ut_test.tps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ create or replace type ut_test force under ut_suite_item (
5757
expected_error_codes ut_integer_list,
5858
constructor function ut_test(
5959
self in out nocopy ut_test, a_object_owner varchar2 := null, a_object_name varchar2, a_name varchar2,
60-
a_line_no integer, a_expected_error_codes ut_integer_list := null, a_tags varchar2 := null
60+
a_line_no integer, a_expected_error_codes ut_integer_list := null, a_tags ut_varchar2_rows := null
6161
) return self as result,
6262
overriding member procedure mark_as_skipped(self in out nocopy ut_test),
6363
overriding member function do_execute(self in out nocopy ut_test) return boolean,

source/core/ut_suite_builder.pkb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ create or replace package body ut_suite_builder is
309309

310310
procedure add_tags_to_test(
311311
a_suite in out nocopy ut_suite,
312-
a_list in out nocopy varchar2,
312+
a_list in out nocopy ut_varchar2_rows,
313313
a_procedure_name t_object_name,
314314
a_tags_ann_text tt_annotation_texts
315315
) is
@@ -328,10 +328,8 @@ create or replace package body ut_suite_builder is
328328
ut_utils.string_to_table(a_tags_ann_text(l_annotation_pos),',')
329329
);
330330
end if;
331-
--remove empty strings from table list e.g. tag1,,tag2
332-
a_list := ut_utils.table_to_clob(
333-
ut_utils.filter_list(l_tag_list,'^(\w|\S)+$'),
334-
',');
331+
--remove empty strings from table list e.g. tag1,,tag2 and conver to rows
332+
a_list := ut_utils.convert_collection( ut_utils.filter_list(l_tag_list,'^(\w|\S)+$') );
335333
l_annotation_pos := a_tags_ann_text.next(l_annotation_pos);
336334
end loop;
337335

@@ -643,9 +641,7 @@ create or replace package body ut_suite_builder is
643641
l_annotation_pos := a_tags_ann_text.next(l_annotation_pos);
644642
end loop;
645643
--remove empty strings from table list e.g. tag1,,tag2
646-
a_suite.tags := ut_utils.table_to_clob(
647-
ut_utils.filter_list(l_tag_list,'^(\w|\S)+$'),
648-
',');
644+
a_suite.tags := ut_utils.convert_collection(ut_utils.filter_list(l_tag_list,'^(\w|\S)+$'));
649645
end;
650646

651647
procedure add_suite_tests(

0 commit comments

Comments
 (0)