@@ -2,30 +2,17 @@ create or replace package body coverage_helper is
22
33 g_job_no integer := 0;
44
5- procedure setup_mock_coverage_id is
6- begin
7- null;
8- end;
9-
10- procedure setup_long_name_package is
5+ procedure create_long_name_package is
116 pragma autonomous_transaction;
127 begin
138 execute immediate q'[create or replace package UT3_DEVELOP.DUMMY_COVERAGE_PACKAGE_WITH_AN_AMAZINGLY_LONG_NAME_THAT_YOU_WOULD_NOT_THINK_OF_IN_REAL_LIFE_PROJECT_BECAUSE_ITS_SIMPLY_TOO_LONG is
149 procedure do_stuff(i_input in number);
15-
16- procedure grant_myself;
1710 end;]';
1811 execute immediate q'[create or replace package body UT3_DEVELOP.DUMMY_COVERAGE_PACKAGE_WITH_AN_AMAZINGLY_LONG_NAME_THAT_YOU_WOULD_NOT_THINK_OF_IN_REAL_LIFE_PROJECT_BECAUSE_ITS_SIMPLY_TOO_LONG is
1912 procedure do_stuff(i_input in number) is
2013 begin
2114 if i_input = 2 then dbms_output.put_line('should not get here'); else dbms_output.put_line('should get here'); end if;
2215 end;
23-
24- procedure grant_myself is
25- begin
26- execute immediate 'grant debug,execute on UT3_DEVELOP.DUMMY_COVERAGE_PACKAGE_WITH_AN_AMAZINGLY_LONG_NAME_THAT_YOU_WOULD_NOT_THINK_OF_IN_REAL_LIFE_PROJECT_BECAUSE_ITS_SIMPLY_TOO_LONG to ut3$user#';
27- end;
28-
2916 end;]';
3017
3118 execute immediate q'[create or replace package UT3_DEVELOP.TEST_BLOCK_DUMMY_COVERAGE is
@@ -34,36 +21,18 @@ create or replace package body coverage_helper is
3421
3522 --%test
3623 procedure test_do_stuff;
37-
38- procedure grant_myself;
39-
4024 end;]';
4125 execute immediate q'[create or replace package body UT3_DEVELOP.TEST_BLOCK_DUMMY_COVERAGE is
4226 procedure test_do_stuff is
4327 begin
4428 dummy_coverage_package_with_an_amazingly_long_name_that_you_would_not_think_of_in_real_life_project_because_its_simply_too_long.do_stuff(1);
4529 ut.expect(1).to_equal(1);
4630 end;
47-
48- procedure grant_myself is
49- begin
50- execute immediate 'grant debug,execute on UT3_DEVELOP.TEST_BLOCK_DUMMY_COVERAGE to ut3$user#';
51- end;
5231 end;]';
5332
54-
55- execute immediate 'begin UT3_DEVELOP.DUMMY_COVERAGE_PACKAGE_WITH_AN_AMAZINGLY_LONG_NAME_THAT_YOU_WOULD_NOT_THINK_OF_IN_REAL_LIFE_PROJECT_BECAUSE_ITS_SIMPLY_TOO_LONG.grant_myself(); end;';
56- execute immediate 'begin UT3_DEVELOP.TEST_BLOCK_DUMMY_COVERAGE.grant_myself(); end;';
57-
58- commit;
59- end;
60-
61- procedure mock_coverage_data(a_user in varchar2) is
62- begin
63- null;
6433 end;
6534
66- procedure cleanup_long_name_package is
35+ procedure drop_long_name_package is
6736 pragma autonomous_transaction;
6837 begin
6938 begin
@@ -78,14 +47,15 @@ create or replace package body coverage_helper is
7847 end;
7948 end;
8049
81- procedure create_dummy_coverage_package is
50+
51+
52+
53+ procedure create_dummy_coverage is
8254 pragma autonomous_transaction;
8355 begin
8456 execute immediate 'alter session set plsql_optimize_level=0';
8557 execute immediate q'[create or replace package UT3_DEVELOP.DUMMY_COVERAGE is
8658 procedure do_stuff;
87-
88- procedure grant_myself;
8959 end;]';
9060 execute immediate q'[create or replace package body UT3_DEVELOP.DUMMY_COVERAGE is
9161 procedure do_stuff is
@@ -96,19 +66,7 @@ create or replace package body coverage_helper is
9666 dbms_output.put_line('should get here');
9767 end if;
9868 end;
99-
100- procedure grant_myself is
101- begin
102- execute immediate 'grant debug,execute on UT3_DEVELOP.DUMMY_COVERAGE to ut3$user#';
103- execute immediate 'grant debug,execute on UT3_DEVELOP.DUMMY_COVERAGE to ut3_tester_helper';
104- end;
10569 end;]';
106-
107- end;
108-
109- procedure create_dummy_coverage_test is
110- pragma autonomous_transaction;
111- begin
11270 execute immediate q'[create or replace package UT3_DEVELOP.TEST_DUMMY_COVERAGE is
11371 --%suite(dummy coverage test)
11472 --%suitepath(coverage_testing)
@@ -118,8 +76,6 @@ create or replace package body coverage_helper is
11876
11977 --%test
12078 procedure zero_coverage;
121-
122- procedure grant_myself;
12379 end;]';
12480 execute immediate q'[create or replace package body UT3_DEVELOP.TEST_DUMMY_COVERAGE is
12581 procedure test_do_stuff is
@@ -131,23 +87,11 @@ create or replace package body coverage_helper is
13187 begin
13288 null;
13389 end;
134-
135- procedure grant_myself is
136- begin
137- execute immediate 'grant debug,execute on UT3_DEVELOP.TEST_DUMMY_COVERAGE to ut3$user#';
138- end;
13990 end;]';
14091
14192 end;
142-
143- procedure grant_exec_on_cov is
144- pragma autonomous_transaction;
145- begin
146- execute immediate 'begin UT3_DEVELOP.DUMMY_COVERAGE.grant_myself(); end;';
147- execute immediate 'begin UT3_DEVELOP.TEST_DUMMY_COVERAGE.grant_myself(); end;';
148- end;
149-
150- procedure drop_dummy_coverage_pkg is
93+
94+ procedure drop_dummy_coverage is
15195 pragma autonomous_transaction;
15296 begin
15397 begin execute immediate q'[drop package ut3_develop.test_dummy_coverage]'; exception when others then null; end;
@@ -160,7 +104,6 @@ create or replace package body coverage_helper is
160104 begin
161105 execute immediate q'[create or replace package UT3_DEVELOP.DUMMY_COVERAGE_1 is
162106 procedure do_stuff;
163- procedure grant_myself;
164107 end;]';
165108 execute immediate q'[create or replace package body UT3_DEVELOP.DUMMY_COVERAGE_1 is
166109 procedure do_stuff is
@@ -171,36 +114,21 @@ create or replace package body coverage_helper is
171114 dbms_output.put_line('should get here');
172115 end if;
173116 end;
174-
175- procedure grant_myself is
176- begin
177- execute immediate 'grant debug,execute on UT3_DEVELOP.DUMMY_COVERAGE_1 to ut3$user#';
178- end;
179-
180117 end;]';
181118 execute immediate q'[create or replace package UT3_DEVELOP.TEST_DUMMY_COVERAGE_1 is
182119 --%suite(dummy coverage test 1)
183120 --%suitepath(coverage_testing)
184121
185122 --%test
186123 procedure test_do_stuff;
187-
188- procedure grant_myself;
189124 end;]';
190125 execute immediate q'[create or replace package body UT3_DEVELOP.TEST_DUMMY_COVERAGE_1 is
191126 procedure test_do_stuff is
192127 begin
193128 dummy_coverage_1.do_stuff;
194129 end;
195130
196- procedure grant_myself is
197- begin
198- execute immediate 'grant debug,execute on UT3_DEVELOP.TEST_DUMMY_COVERAGE_1 to ut3$user#';
199- end;
200-
201131 end;]';
202- execute immediate 'begin UT3_DEVELOP.DUMMY_COVERAGE_1.grant_myself(); end;';
203- execute immediate 'begin UT3_DEVELOP.TEST_DUMMY_COVERAGE_1.grant_myself(); end;';
204132 end;
205133
206134 procedure drop_dummy_coverage_test_1 is
@@ -210,39 +138,6 @@ create or replace package body coverage_helper is
210138 begin execute immediate q'[drop package UT3_DEVELOP.TEST_DUMMY_COVERAGE_1]'; exception when others then null; end;
211139 end;
212140
213- procedure mock_block_coverage_data(a_run_id integer,a_user in varchar2) is
214- c_unit_id constant integer := 1;
215- begin
216- insert into dbmspcc_runs ( run_id, run_owner, run_timestamp, run_comment)
217- values(a_run_id, a_user, sysdate, 'unit testing utPLSQL');
218-
219- insert into dbmspcc_units ( run_id, object_id, type, owner, name,last_ddl_time)
220- values(a_run_id, c_unit_id, 'PACKAGE BODY', 'UT3_DEVELOP', 'DUMMY_COVERAGE_PACKAGE_WITH_AN_AMAZINGLY_LONG_NAME_THAT_YOU_WOULD_NOT_THINK_OF_IN_REAL_LIFE_PROJECT_BECAUSE_ITS_SIMPLY_TOO_LONG',sysdate);
221-
222- insert into dbmspcc_blocks ( run_id, object_id, line,block,col,covered,not_feasible)
223- select a_run_id, c_unit_id,4,1,1,1,0 from dual union all
224- select a_run_id, c_unit_id,4,2,2,0,0 from dual union all
225- select a_run_id, c_unit_id,5,3,0,1,0 from dual union all
226- select a_run_id, c_unit_id,7,4,1,1,0 from dual;
227- end;
228-
229- procedure mock_profiler_coverage_data(a_run_id integer,a_user in varchar2) is
230- c_unit_id constant integer := 1;
231- begin
232- insert into ut3_develop.plsql_profiler_runs ( runid, run_owner, run_date, run_comment)
233- values(a_run_id, a_user, sysdate, 'unit testing utPLSQL');
234-
235- insert into ut3_develop.plsql_profiler_units ( runid, unit_number, unit_type, unit_owner, unit_name)
236- values(a_run_id, c_unit_id, 'PACKAGE BODY', 'UT3_DEVELOP', 'DUMMY_COVERAGE_PACKAGE_WITH_AN_AMAZINGLY_LONG_NAME_THAT_YOU_WOULD_NOT_THINK_OF_IN_REAL_LIFE_PROJECT_BECAUSE_ITS_SIMPLY_TOO_LONG');
237-
238- insert into ut3_develop.plsql_profiler_data ( runid, unit_number, line#, total_occur, total_time)
239- select a_run_id, c_unit_id, 4, 1, 1 from dual union all
240- select a_run_id, c_unit_id, 5, 0, 0 from dual union all
241- select a_run_id, c_unit_id, 6, 1, 0 from dual union all
242- select a_run_id, c_unit_id, 7, 1, 1 from dual;
243- end;
244-
245-
246141 procedure set_develop_mode is
247142 begin
248143 ut3_develop.ut_coverage.set_develop_mode(true);
0 commit comments