Skip to content

Commit 095ec03

Browse files
committed
Changed code, not to use key-val pair to navigate through annotations for now as we don't implement key-val pairs in annotations yet.
1 parent 696b1f9 commit 095ec03

16 files changed

+276
-270
lines changed

source/core/ut_annotations.pkb

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ create or replace package body ut_annotations as
4848
l_annotation_params_str varchar2(32767);
4949
l_annotation_name varchar2(1000);
5050
l_annotation_params tt_annotation_params;
51+
l_annotation t_annotation;
5152
l_annotations_list tt_annotations;
5253
begin
5354
-- loop while there are unprocessed comment blocks
@@ -102,8 +103,9 @@ create or replace package body ut_annotations as
102103
end;
103104
end loop;
104105
end if;
105-
106-
l_annotations_list(l_annotation_name) := l_annotation_params;
106+
l_annotation.text := l_annotation_params_str;
107+
l_annotation.params := l_annotation_params;
108+
l_annotations_list(l_annotation_name) := l_annotation;
107109
end if;
108110
l_loop_index := l_loop_index + 1;
109111
end loop;
@@ -324,14 +326,14 @@ create or replace package body ut_annotations as
324326
end if;
325327
end;
326328

327-
function get_annotation_param(a_param_list tt_annotation_params, a_def_index pls_integer) return varchar2 is
328-
l_result varchar2(32767);
329-
begin
330-
if a_param_list.exists(a_def_index) then
331-
l_result := a_param_list(a_def_index).val;
332-
end if;
333-
return l_result;
334-
end get_annotation_param;
329+
-- function get_annotation_param(a_param_list tt_annotation_params, a_def_index pls_integer) return varchar2 is
330+
-- l_result varchar2(32767);
331+
-- begin
332+
-- if a_param_list.exists(a_def_index) then
333+
-- l_result := a_param_list(a_def_index).val;
334+
-- end if;
335+
-- return l_result;
336+
-- end get_annotation_param;
335337

336338
end ut_annotations;
337339
/

source/core/ut_annotations.pks

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,16 @@ create or replace package ut_annotations authid current_user as
4646
*/
4747
type tt_annotation_params is table of typ_annotation_param index by pls_integer;
4848

49+
type t_annotation is record(
50+
text varchar2(4000),
51+
params tt_annotation_params
52+
);
53+
4954
/*
5055
type: tt_annotations
5156
a list of tt_annotation_params index by the annotation name
5257
*/
53-
type tt_annotations is table of tt_annotation_params index by t_annotation_name;
58+
type tt_annotations is table of t_annotation index by t_annotation_name;
5459

5560
/*
5661
type: tt_procedure_annotations
@@ -87,7 +92,7 @@ create or replace package ut_annotations authid current_user as
8792

8893
get annotation parameter on a specified index position
8994
*/
90-
function get_annotation_param(a_param_list tt_annotation_params, a_def_index pls_integer) return varchar2;
95+
-- function get_annotation_param(a_param_list tt_annotation_params, a_def_index pls_integer) return varchar2;
9196

9297
end ut_annotations;
9398
/

source/core/ut_suite_manager.pkb

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,17 @@ create or replace package body ut_suite_manager is
7979
if l_annotation_data.package_annotations.exists('suite') then
8080

8181
if l_annotation_data.package_annotations.exists('displayname') then
82-
l_suite_name := ut_annotations.get_annotation_param(l_annotation_data.package_annotations('displayname'), 1);
83-
elsif l_annotation_data.package_annotations('suite').count>0 then
84-
l_suite_name := ut_annotations.get_annotation_param(l_annotation_data.package_annotations('suite'), 1);
82+
l_suite_name := l_annotation_data.package_annotations('displayname').text;
83+
else
84+
l_suite_name := l_annotation_data.package_annotations('suite').text;
8585
end if;
8686

8787
if l_annotation_data.package_annotations.exists('suitepath') then
88-
l_suite_path := ut_annotations.get_annotation_param(l_annotation_data.package_annotations('suitepath'), 1) || '.' ||
89-
lower(l_object_name);
88+
l_suite_path := l_annotation_data.package_annotations('suitepath').text || '.' || lower(l_object_name);
9089
end if;
9190

9291
if l_annotation_data.package_annotations.exists('rollback') then
93-
l_suite_rollback_annotation := ut_annotations.get_annotation_param(l_annotation_data.package_annotations('rollback')
94-
,1);
92+
l_suite_rollback_annotation := l_annotation_data.package_annotations('rollback').text;
9593
l_suite_rollback := case lower(l_suite_rollback_annotation)
9694
when 'manual' then
9795
ut_utils.gc_rollback_manual
@@ -145,21 +143,21 @@ create or replace package body ut_suite_manager is
145143
l_displayname varchar2(4000);
146144
begin
147145
if l_proc_annotations.exists('beforetest') then
148-
l_beforetest_procedure := ut_annotations.get_annotation_param(l_proc_annotations('beforetest'), 1);
146+
l_beforetest_procedure := l_proc_annotations('beforetest').text;
149147
end if;
150148

151149
if l_proc_annotations.exists('aftertest') then
152-
l_aftertest_procedure := ut_annotations.get_annotation_param(l_proc_annotations('aftertest'), 1);
150+
l_aftertest_procedure := l_proc_annotations('aftertest').text;
153151
end if;
154152

155153
if l_proc_annotations.exists('displayname') then
156-
l_displayname := ut_annotations.get_annotation_param(l_proc_annotations('displayname'), 1);
157-
elsif l_proc_annotations('test').count > 0 then
158-
l_displayname := ut_annotations.get_annotation_param(l_proc_annotations('test'), 1);
154+
l_displayname := l_proc_annotations('displayname').text;
155+
else
156+
l_displayname := l_proc_annotations('test').text;
159157
end if;
160158

161159
if l_proc_annotations.exists('rollback') then
162-
l_rollback_annotation := ut_annotations.get_annotation_param(l_proc_annotations('rollback'), 1);
160+
l_rollback_annotation := l_proc_annotations('rollback').text;
163161
l_rollback_type := case lower(l_rollback_annotation)
164162
when 'manual' then
165163
ut_utils.gc_rollback_manual

0 commit comments

Comments
 (0)