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

Skip to content

Commit 583f8cf

Browse files
authored
Merge branch 'develop' into testing_sonar
2 parents 6f7251d + 8734716 commit 583f8cf

4 files changed

Lines changed: 35 additions & 16 deletions

File tree

source/reporters/ut_coverage_html_reporter.tpb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ create or replace type body ut_coverage_html_reporter is
2121
a_project_name varchar2 := null,
2222
a_schema_names ut_varchar2_list := null,
2323
a_include_object_list ut_varchar2_list := null,
24-
a_exclude_object_list ut_varchar2_list := null
24+
a_exclude_object_list ut_varchar2_list := null,
25+
a_html_report_assets_path varchar2 := null
2526
) return self as result is
2627
begin
2728
self.init($$plsql_unit);
2829
ut_coverage.init(a_schema_names, a_include_object_list, a_exclude_object_list);
2930
self.project_name := a_project_name;
31+
assets_path := nvl(a_html_report_assets_path, ut_coverage_report_html_helper.get_default_html_assets_path());
3032
return;
3133
end;
3234

@@ -41,7 +43,8 @@ create or replace type body ut_coverage_html_reporter is
4143
a_object_type_subexpression positive,
4244
a_file_to_object_type_mapping ut_key_value_pairs,
4345
a_include_object_list ut_varchar2_list := null,
44-
a_exclude_object_list ut_varchar2_list := null
46+
a_exclude_object_list ut_varchar2_list := null,
47+
a_html_report_assets_path varchar2 := null
4548
) return self as result is
4649
l_mappings ut_coverage_file_mappings;
4750
begin
@@ -52,6 +55,7 @@ create or replace type body ut_coverage_html_reporter is
5255
self.init($$plsql_unit);
5356
ut_coverage.init(l_mappings, a_include_object_list, a_exclude_object_list);
5457
self.project_name := a_project_name;
58+
assets_path := nvl(a_html_report_assets_path, ut_coverage_report_html_helper.get_default_html_assets_path());
5559
return;
5660
end;
5761

@@ -61,14 +65,16 @@ create or replace type body ut_coverage_html_reporter is
6165
a_object_owner varchar2 := null,
6266
a_file_paths ut_varchar2_list,
6367
a_include_object_list ut_varchar2_list := null,
64-
a_exclude_object_list ut_varchar2_list := null
68+
a_exclude_object_list ut_varchar2_list := null,
69+
a_html_report_assets_path varchar2 := null
6570
) return self as result is
6671
l_mappings ut_coverage_file_mappings;
6772
begin
6873
l_mappings := ut_coverage.build_file_mappings( a_object_owner, a_file_paths );
6974
self.init($$plsql_unit);
7075
ut_coverage.init(l_mappings, a_include_object_list, a_exclude_object_list);
7176
self.project_name := a_project_name;
77+
assets_path := nvl(a_html_report_assets_path, ut_coverage_report_html_helper.get_default_html_assets_path());
7278
return;
7379
end;
7480

@@ -77,12 +83,14 @@ create or replace type body ut_coverage_html_reporter is
7783
a_project_name varchar2 := null,
7884
a_file_mappings ut_coverage_file_mappings,
7985
a_include_object_list ut_varchar2_list := null,
80-
a_exclude_object_list ut_varchar2_list := null
86+
a_exclude_object_list ut_varchar2_list := null,
87+
a_html_report_assets_path varchar2 := null
8188
) return self as result is
8289
begin
8390
self.init($$plsql_unit);
8491
ut_coverage.init(a_file_mappings, a_include_object_list, a_exclude_object_list);
8592
self.project_name := a_project_name;
93+
assets_path := nvl(a_html_report_assets_path, ut_coverage_report_html_helper.get_default_html_assets_path());
8694
return;
8795
end;
8896

source/reporters/ut_coverage_html_reporter.tps

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ create or replace type ut_coverage_html_reporter under ut_coverage_reporter_base
1616
limitations under the License.
1717
*/
1818
project_name varchar2(4000),
19+
assets_path varchar2(4000),
1920
constructor function ut_coverage_html_reporter(
2021
self in out nocopy ut_coverage_html_reporter,
2122
a_project_name varchar2 := null,
2223
a_schema_names ut_varchar2_list := null,
2324
a_include_object_list ut_varchar2_list := null,
24-
a_exclude_object_list ut_varchar2_list := null
25+
a_exclude_object_list ut_varchar2_list := null,
26+
a_html_report_assets_path varchar2 := null
2527
) return self as result,
2628

2729
constructor function ut_coverage_html_reporter(
@@ -35,7 +37,8 @@ create or replace type ut_coverage_html_reporter under ut_coverage_reporter_base
3537
a_object_type_subexpression positive,
3638
a_file_to_object_type_mapping ut_key_value_pairs,
3739
a_include_object_list ut_varchar2_list := null,
38-
a_exclude_object_list ut_varchar2_list := null
40+
a_exclude_object_list ut_varchar2_list := null,
41+
a_html_report_assets_path varchar2 := null
3942
) return self as result,
4043

4144
constructor function ut_coverage_html_reporter(
@@ -44,15 +47,17 @@ create or replace type ut_coverage_html_reporter under ut_coverage_reporter_base
4447
a_object_owner varchar2 := null,
4548
a_file_paths ut_varchar2_list,
4649
a_include_object_list ut_varchar2_list := null,
47-
a_exclude_object_list ut_varchar2_list := null
50+
a_exclude_object_list ut_varchar2_list := null,
51+
a_html_report_assets_path varchar2 := null
4852
) return self as result,
4953

5054
constructor function ut_coverage_html_reporter(
5155
self in out nocopy ut_coverage_html_reporter,
5256
a_project_name varchar2 := null,
5357
a_file_mappings ut_coverage_file_mappings,
5458
a_include_object_list ut_varchar2_list := null,
55-
a_exclude_object_list ut_varchar2_list := null
59+
a_exclude_object_list ut_varchar2_list := null,
60+
a_html_report_assets_path varchar2 := null
5661
) return self as result,
5762

5863
overriding member procedure after_calling_run(self in out nocopy ut_coverage_html_reporter, a_run in ut_run)

source/reporters/ut_coverage_report_html_helper.pkb

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ create or replace package body ut_coverage_report_html_helper is
2929
gc_ignored constant varchar2(7) := 'never';
3030
gc_covered constant varchar2(7) := 'covered';
3131

32-
gc_assets_path constant varchar2(200) := 'https://jgebal.github.io/utPLSQL-coverage-html/assets/';
32+
33+
function get_default_html_assets_path return varchar2 deterministic is
34+
c_assets_path constant varchar2(200) := 'https://utplsql.github.io/utPLSQL-coverage-html/assets/';
35+
begin
36+
return c_assets_path;
37+
end;
3338

3439
function coverage_css_class(a_covered_pct number) return varchar2 is
3540
l_result varchar2(10);
@@ -201,7 +206,7 @@ create or replace package body ut_coverage_report_html_helper is
201206
/*
202207
* public definitions
203208
*/
204-
function get_index(a_coverage_data ut_coverage.t_coverage, a_project_name varchar2 := null, a_command_line varchar2 := null) return clob is
209+
function get_index(a_coverage_data ut_coverage.t_coverage, a_assets_path varchar2, a_project_name varchar2 := null, a_command_line varchar2 := null) return clob is
205210

206211
l_file_part varchar2(32767);
207212
l_result clob;
@@ -222,12 +227,12 @@ create or replace package body ut_coverage_report_html_helper is
222227
'<!DOCTYPE html><html xmlns=''http://www.w3.org/1999/xhtml''><head>' ||
223228
'<title>'||l_title||'</title>' ||
224229
'<meta http-equiv="content-type" content="text/html; charset=utf-8" />' ||
225-
'<script src='''||gc_assets_path||'application.js'' type=''text/javascript''></script>' ||
226-
'<link href='''||gc_assets_path||'application.css'' media=''screen, projection, print'' rel=''stylesheet'' type=''text/css''>' ||
227-
'<link rel="shortcut icon" type="image/png" href="'||gc_assets_path||'favicon_'||coverage_css_class(l_coverage_pct)||'.png" />' ||
228-
'<link rel="icon" type="image/png" href="'||gc_assets_path||'favicon_'||coverage_css_class(l_coverage_pct)||'.png" />' ||
230+
'<script src='''||a_assets_path||'application.js'' type=''text/javascript''></script>' ||
231+
'<link href='''||a_assets_path||'application.css'' media=''screen, projection, print'' rel=''stylesheet'' type=''text/css''>' ||
232+
'<link rel="shortcut icon" type="image/png" href="'||a_assets_path||'favicon_'||coverage_css_class(l_coverage_pct)||'.png" />' ||
233+
'<link rel="icon" type="image/png" href="'||a_assets_path||'favicon_'||coverage_css_class(l_coverage_pct)||'.png" />' ||
229234
'</head>' ||
230-
'<body><div id="loading"><img src="'||gc_assets_path||'loading.gif" alt="loading"/></div>' ||
235+
'<body><div id="loading"><img src="'||a_assets_path||'loading.gif" alt="loading"/></div>' ||
231236
'<div id="wrapper" style="display:none;">' ||
232237
'<div class="timestamp">Generated <abbr class="timeago" title="'||l_time_str||'">'||l_time_str||'</abbr></div>' ||
233238
'<ul class="group_tabs"></ul>' ||

source/reporters/ut_coverage_report_html_helper.pks

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ create or replace package ut_coverage_report_html_helper authid current_user is
1515
See the License for the specific language governing permissions and
1616
limitations under the License.
1717
*/
18+
function get_default_html_assets_path return varchar2 deterministic;
1819

19-
function get_index(a_coverage_data ut_coverage.t_coverage, a_project_name varchar2 := null, a_command_line varchar2 := null) return clob;
20+
function get_index(a_coverage_data ut_coverage.t_coverage, a_assets_path varchar2, a_project_name varchar2 := null, a_command_line varchar2 := null) return clob;
2021

2122
end;
2223
/

0 commit comments

Comments
 (0)