mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-02 21:08:01 +08:00
Improve error information - follow up Part 3 (#2837)
* Improve tooltip of "Goto source" link * add another test
This commit is contained in:
parent
77d3ff885f
commit
c008788b9b
|
@ -91,6 +91,11 @@ CLASS zcl_abapgit_gui_chunk_lib DEFINITION
|
||||||
iv_msgno TYPE scx_t100key-msgno
|
iv_msgno TYPE scx_t100key-msgno
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(rv_text) TYPE string.
|
VALUE(rv_text) TYPE string.
|
||||||
|
CLASS-METHODS normalize_program_name
|
||||||
|
IMPORTING
|
||||||
|
iv_program_name TYPE syrepid
|
||||||
|
RETURNING
|
||||||
|
VALUE(rv_normalized_program_name) TYPE string.
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
@ -98,6 +103,15 @@ ENDCLASS.
|
||||||
CLASS zcl_abapgit_gui_chunk_lib IMPLEMENTATION.
|
CLASS zcl_abapgit_gui_chunk_lib IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD normalize_program_name.
|
||||||
|
|
||||||
|
rv_normalized_program_name = substring_before(
|
||||||
|
val = iv_program_name
|
||||||
|
regex = `(=+CP)?$` ).
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD render_branch_span.
|
METHOD render_branch_span.
|
||||||
|
|
||||||
DATA: lv_text TYPE string,
|
DATA: lv_text TYPE string,
|
||||||
|
@ -230,11 +244,13 @@ CLASS zcl_abapgit_gui_chunk_lib IMPLEMENTATION.
|
||||||
IMPORTING
|
IMPORTING
|
||||||
program_name = lv_program_name ).
|
program_name = lv_program_name ).
|
||||||
|
|
||||||
|
lv_title = normalize_program_name( lv_program_name ).
|
||||||
|
|
||||||
ro_html->add_a(
|
ro_html->add_a(
|
||||||
iv_txt = `Goto source`
|
iv_txt = `Goto source`
|
||||||
iv_act = zif_abapgit_definitions=>c_action-goto_source
|
iv_act = zif_abapgit_definitions=>c_action-goto_source
|
||||||
iv_typ = zif_abapgit_html=>c_action_type-sapevent
|
iv_typ = zif_abapgit_html=>c_action_type-sapevent
|
||||||
iv_title = |{ lv_program_name }|
|
iv_title = lv_title
|
||||||
iv_id = `a_goto_source` ).
|
iv_id = `a_goto_source` ).
|
||||||
|
|
||||||
ro_html->add_a(
|
ro_html->add_a(
|
||||||
|
|
49
src/ui/zcl_abapgit_gui_chunk_lib.clas.testclasses.abap
Normal file
49
src/ui/zcl_abapgit_gui_chunk_lib.clas.testclasses.abap
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
*"* use this source file for your ABAP unit test classes
|
||||||
|
CLASS ltcl_normalize_program_name DEFINITION FINAL FOR TESTING
|
||||||
|
DURATION SHORT
|
||||||
|
RISK LEVEL HARMLESS.
|
||||||
|
|
||||||
|
PRIVATE SECTION.
|
||||||
|
DATA:
|
||||||
|
mo_chunk_lib TYPE REF TO zcl_abapgit_gui_chunk_lib.
|
||||||
|
|
||||||
|
METHODS:
|
||||||
|
setup,
|
||||||
|
class FOR TESTING RAISING cx_static_check,
|
||||||
|
program FOR TESTING RAISING cx_static_check.
|
||||||
|
|
||||||
|
ENDCLASS.
|
||||||
|
|
||||||
|
CLASS zcl_abapgit_gui_chunk_lib DEFINITION LOCAL FRIENDS ltcl_normalize_program_name.
|
||||||
|
|
||||||
|
CLASS ltcl_normalize_program_name IMPLEMENTATION.
|
||||||
|
|
||||||
|
METHOD setup.
|
||||||
|
|
||||||
|
CREATE OBJECT mo_chunk_lib.
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD class.
|
||||||
|
|
||||||
|
cl_abap_unit_assert=>assert_equals(
|
||||||
|
act = mo_chunk_lib->normalize_program_name( 'ZCL_ABAPGIT_FRONTEND_SERVICES=CP' )
|
||||||
|
exp = `ZCL_ABAPGIT_FRONTEND_SERVICES` ).
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD program.
|
||||||
|
|
||||||
|
cl_abap_unit_assert=>assert_equals(
|
||||||
|
act = mo_chunk_lib->normalize_program_name( 'ZABAPGIT_FULL' )
|
||||||
|
exp = `ZABAPGIT_FULL` ).
|
||||||
|
|
||||||
|
cl_abap_unit_assert=>assert_equals(
|
||||||
|
act = mo_chunk_lib->normalize_program_name( 'ZSOME_PROG_ENDING_WITH_CP' )
|
||||||
|
exp = `ZSOME_PROG_ENDING_WITH_CP` ).
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
ENDCLASS.
|
|
@ -10,6 +10,7 @@
|
||||||
<CLSCCINCL>X</CLSCCINCL>
|
<CLSCCINCL>X</CLSCCINCL>
|
||||||
<FIXPT>X</FIXPT>
|
<FIXPT>X</FIXPT>
|
||||||
<UNICODE>X</UNICODE>
|
<UNICODE>X</UNICODE>
|
||||||
|
<WITH_UNIT_TESTS>X</WITH_UNIT_TESTS>
|
||||||
</VSEOCLASS>
|
</VSEOCLASS>
|
||||||
</asx:values>
|
</asx:values>
|
||||||
</asx:abap>
|
</asx:abap>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user