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

Skip to content

Commit 933900a

Browse files
authored
Merge pull request #54 from jgebal/feature/code_cleanup
Cleanup and separation of annotation processing.
2 parents 60a3352 + 03361e5 commit 933900a

18 files changed

Lines changed: 922 additions & 420 deletions

examples/RunExampleTestAnnotationsHugePackage.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set echo off
1010
declare
1111
l_suite ut_test_suite;
1212
begin
13-
ut_suite_manager.config_package(a_owner_name => USER,a_object_name => 'TST_PKG_HUGE',a_suite => l_suite);
13+
l_suite := ut_suite_manager.config_package(a_owner_name => USER,a_object_name => 'TST_PKG_HUGE');
1414
end;
1515
/
1616

source/install.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ whenever oserror exit failure rollback
99
@@types/ut_executable.tps
1010
@@types/ut_assert_result.tps
1111
@@types/ut_assert_list.tps
12-
@@ut_assert.pks
1312
@@types/ut_reporter.tps
1413
@@types/ut_reporters_list.tps
1514
@@types/ut_composite_reporter.tps
@@ -20,6 +19,8 @@ whenever oserror exit failure rollback
2019
@@types/ut_dbms_output_suite_reporter.tps
2120
@@ut_utils.pks
2221
@@ut_metadata.pks
22+
@@ut_assert.pks
23+
@@ut_annotations.pks
2324
@@ut_suite_manager.pks
2425

2526
@@ut_utils.pkb
@@ -34,6 +35,7 @@ whenever oserror exit failure rollback
3435
@@types/ut_reporter_decorator.tpb
3536
@@types/ut_dbms_output_suite_reporter.tpb
3637
@@ut_metadata.pkb
38+
@@ut_annotations.pkb
3739
@@ut_assert.pkb
3840
@@ut_suite_manager.pkb
3941

source/uninstall.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ drop package ut_suite_manager;
22

33
drop package ut_assert;
44

5+
drop package ut_annotations;
6+
57
drop package ut_metadata;
68

79
drop package ut_utils;

source/ut_annotations.pkb

Lines changed: 349 additions & 0 deletions
Large diffs are not rendered by default.

source/ut_annotations.pks

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
create or replace package ut_annotations as
2+
/*
3+
package: ut_annotations
4+
5+
Responsible for parsing and accessing utplsql annotations.
6+
7+
*/
8+
9+
subtype t_annotation_name is varchar2(1000);
10+
subtype t_procedure_name is varchar2(30);
11+
12+
/*
13+
type: typ_annotation_param
14+
15+
a key/value pair of annotation parameters
16+
17+
example:
18+
--%test(name=A name of the test)
19+
will be stored as:
20+
typ_annotation_param( key=> 'name', value=>'A name of the test' )
21+
*/
22+
type typ_annotation_param is record(
23+
key varchar2(255)
24+
,value varchar2(4000));
25+
26+
/*
27+
type: typ_annotation_param
28+
a list of typ_annotation_param
29+
*/
30+
type tt_annotation_params is table of typ_annotation_param index by pls_integer;
31+
32+
/*
33+
type: tt_annotations
34+
a list of tt_annotation_params index by the annotation name
35+
*/
36+
type tt_annotations is table of tt_annotation_params index by t_annotation_name;
37+
38+
/*
39+
type: tt_procedure_annotations
40+
a list of tt_annotations index by the procedure name
41+
*/
42+
type tt_procedure_annotations is table of tt_annotations index by t_procedure_name;
43+
44+
/*
45+
type: typ_annotated_package
46+
a structure containing a list of package level annotations and a list of procedure level annotations
47+
48+
*/
49+
type typ_annotated_package is record(
50+
procedure_annotations tt_procedure_annotations
51+
,package_annotations tt_annotations);
52+
53+
/*
54+
INTERNAL USE ONLY
55+
*/
56+
function parse_package_annotations(a_source clob) return typ_annotated_package;
57+
58+
/*
59+
function: get_package_annotations
60+
61+
get annotations for specified package specification and return its annotated schema
62+
*/
63+
function get_package_annotations(a_owner_name varchar2, a_name varchar2) return typ_annotated_package;
64+
65+
66+
/*
67+
function: get_annotation_param
68+
69+
get annotation parameter on a specified index position
70+
*/
71+
function get_annotation_param(a_param_list tt_annotation_params, a_def_index pls_integer) return varchar2;
72+
73+
end ut_annotations;
74+
/

0 commit comments

Comments
 (0)