From 39c7fafbe8a71eace1a937f403ae6a9817e78f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20G=C4=99bal?= Date: Sun, 5 Mar 2017 23:56:13 +0000 Subject: [PATCH] The ut_coverage_html_reporter now accepts parameter to use different assets then the default. Default assets url were moved from a private constant to a function. --- .../reporters/ut_coverage_html_reporter.tpb | 16 ++++++++++++---- .../reporters/ut_coverage_html_reporter.tps | 13 +++++++++---- .../ut_coverage_report_html_helper.pkb | 19 ++++++++++++------- .../ut_coverage_report_html_helper.pks | 3 ++- 4 files changed, 35 insertions(+), 16 deletions(-) diff --git a/source/reporters/ut_coverage_html_reporter.tpb b/source/reporters/ut_coverage_html_reporter.tpb index 4e136abdf..b1d6a9da2 100644 --- a/source/reporters/ut_coverage_html_reporter.tpb +++ b/source/reporters/ut_coverage_html_reporter.tpb @@ -21,12 +21,14 @@ create or replace type body ut_coverage_html_reporter is a_project_name varchar2 := null, a_schema_names ut_varchar2_list := null, a_include_object_list ut_varchar2_list := null, - a_exclude_object_list ut_varchar2_list := null + a_exclude_object_list ut_varchar2_list := null, + a_html_report_assets_path varchar2 := null ) return self as result is begin self.init($$plsql_unit); ut_coverage.init(a_schema_names, a_include_object_list, a_exclude_object_list); self.project_name := a_project_name; + assets_path := nvl(a_html_report_assets_path, ut_coverage_report_html_helper.get_default_html_assets_path()); return; end; @@ -41,7 +43,8 @@ create or replace type body ut_coverage_html_reporter is a_object_type_subexpression positive, a_file_to_object_type_mapping ut_key_value_pairs, a_include_object_list ut_varchar2_list := null, - a_exclude_object_list ut_varchar2_list := null + a_exclude_object_list ut_varchar2_list := null, + a_html_report_assets_path varchar2 := null ) return self as result is l_mappings ut_coverage_file_mappings; begin @@ -52,6 +55,7 @@ create or replace type body ut_coverage_html_reporter is self.init($$plsql_unit); ut_coverage.init(l_mappings, a_include_object_list, a_exclude_object_list); self.project_name := a_project_name; + assets_path := nvl(a_html_report_assets_path, ut_coverage_report_html_helper.get_default_html_assets_path()); return; end; @@ -61,7 +65,8 @@ create or replace type body ut_coverage_html_reporter is a_object_owner varchar2 := null, a_file_paths ut_varchar2_list, a_include_object_list ut_varchar2_list := null, - a_exclude_object_list ut_varchar2_list := null + a_exclude_object_list ut_varchar2_list := null, + a_html_report_assets_path varchar2 := null ) return self as result is l_mappings ut_coverage_file_mappings; begin @@ -69,6 +74,7 @@ create or replace type body ut_coverage_html_reporter is self.init($$plsql_unit); ut_coverage.init(l_mappings, a_include_object_list, a_exclude_object_list); self.project_name := a_project_name; + assets_path := nvl(a_html_report_assets_path, ut_coverage_report_html_helper.get_default_html_assets_path()); return; end; @@ -77,12 +83,14 @@ create or replace type body ut_coverage_html_reporter is a_project_name varchar2 := null, a_file_mappings ut_coverage_file_mappings, a_include_object_list ut_varchar2_list := null, - a_exclude_object_list ut_varchar2_list := null + a_exclude_object_list ut_varchar2_list := null, + a_html_report_assets_path varchar2 := null ) return self as result is begin self.init($$plsql_unit); ut_coverage.init(a_file_mappings, a_include_object_list, a_exclude_object_list); self.project_name := a_project_name; + assets_path := nvl(a_html_report_assets_path, ut_coverage_report_html_helper.get_default_html_assets_path()); return; end; diff --git a/source/reporters/ut_coverage_html_reporter.tps b/source/reporters/ut_coverage_html_reporter.tps index cc522110b..074417d33 100644 --- a/source/reporters/ut_coverage_html_reporter.tps +++ b/source/reporters/ut_coverage_html_reporter.tps @@ -16,12 +16,14 @@ create or replace type ut_coverage_html_reporter under ut_coverage_reporter_base limitations under the License. */ project_name varchar2(4000), + assets_path varchar2(4000), constructor function ut_coverage_html_reporter( self in out nocopy ut_coverage_html_reporter, a_project_name varchar2 := null, a_schema_names ut_varchar2_list := null, a_include_object_list ut_varchar2_list := null, - a_exclude_object_list ut_varchar2_list := null + a_exclude_object_list ut_varchar2_list := null, + a_html_report_assets_path varchar2 := null ) return self as result, constructor function ut_coverage_html_reporter( @@ -35,7 +37,8 @@ create or replace type ut_coverage_html_reporter under ut_coverage_reporter_base a_object_type_subexpression positive, a_file_to_object_type_mapping ut_key_value_pairs, a_include_object_list ut_varchar2_list := null, - a_exclude_object_list ut_varchar2_list := null + a_exclude_object_list ut_varchar2_list := null, + a_html_report_assets_path varchar2 := null ) return self as result, constructor function ut_coverage_html_reporter( @@ -44,7 +47,8 @@ create or replace type ut_coverage_html_reporter under ut_coverage_reporter_base a_object_owner varchar2 := null, a_file_paths ut_varchar2_list, a_include_object_list ut_varchar2_list := null, - a_exclude_object_list ut_varchar2_list := null + a_exclude_object_list ut_varchar2_list := null, + a_html_report_assets_path varchar2 := null ) return self as result, constructor function ut_coverage_html_reporter( @@ -52,7 +56,8 @@ create or replace type ut_coverage_html_reporter under ut_coverage_reporter_base a_project_name varchar2 := null, a_file_mappings ut_coverage_file_mappings, a_include_object_list ut_varchar2_list := null, - a_exclude_object_list ut_varchar2_list := null + a_exclude_object_list ut_varchar2_list := null, + a_html_report_assets_path varchar2 := null ) return self as result, overriding member procedure after_calling_run(self in out nocopy ut_coverage_html_reporter, a_run in ut_run) diff --git a/source/reporters/ut_coverage_report_html_helper.pkb b/source/reporters/ut_coverage_report_html_helper.pkb index cff067573..e1009f4cf 100644 --- a/source/reporters/ut_coverage_report_html_helper.pkb +++ b/source/reporters/ut_coverage_report_html_helper.pkb @@ -29,7 +29,12 @@ create or replace package body ut_coverage_report_html_helper is gc_ignored constant varchar2(7) := 'never'; gc_covered constant varchar2(7) := 'covered'; - gc_assets_path constant varchar2(200) := 'https://jgebal.github.io/utPLSQL-coverage-html/assets/'; + + function get_default_html_assets_path return varchar2 deterministic is + c_assets_path constant varchar2(200) := 'https://utplsql.github.io/utPLSQL-coverage-html/assets/'; + begin + return c_assets_path; + end; function coverage_css_class(a_covered_pct number) return varchar2 is l_result varchar2(10); @@ -201,7 +206,7 @@ create or replace package body ut_coverage_report_html_helper is /* * public definitions */ - function get_index(a_coverage_data ut_coverage.t_coverage, a_project_name varchar2 := null, a_command_line varchar2 := null) return clob is + 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 l_file_part varchar2(32767); l_result clob; @@ -222,12 +227,12 @@ create or replace package body ut_coverage_report_html_helper is '' || 'Codestin Search App' || '' || - '' || - '' || - '' || - '' || + '' || + '' || + '' || + '' || '' || - '
loading
' || + '
loading
' || '