Skip to content

Commit

Permalink
Issue #11 - Update Codebase to ABAP 7.40 SP 02
Browse files Browse the repository at this point in the history
Fixed some first issues (Commit 1 / n)
  • Loading branch information
NeumannJoerg committed Jul 5, 2024
1 parent 10627fb commit 10ccf2e
Show file tree
Hide file tree
Showing 27 changed files with 95 additions and 115 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ CLASS /usi/cl_bal_cd_data_containers IMPLEMENTATION.
WHERE log_object IN i_log_object_range
AND sub_object IN i_sub_object_range.

IF sy-subrc NE 0.
IF sy-subrc <> 0.

Check failure on line 24 in src/#usi#bal_cust_dao/#usi#cl_bal_cd_data_containers.clas.abap

View workflow job for this annotation

GitHub Actions / results

Compare operator "<>" not preferred

preferred_compare_operator
RAISE EXCEPTION TYPE /usi/cx_bal_not_found
EXPORTING
textid = /usi/cx_bal_not_found=>no_db_entries_found.
EXPORTING textid = /usi/cx_bal_not_found=>no_db_entries_found.
ENDIF.
ENDMETHOD.
ENDCLASS.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CLASS lcl_unit_tests IMPLEMENTATION.
METHOD setup.
DATA range_line TYPE /usi/bal_log_object_range_line.

CREATE OBJECT cut TYPE /usi/cl_bal_cd_data_containers.
cut = NEW /usi/cl_bal_cd_data_containers( ).

range_line-sign = 'E'.
range_line-option = 'CP'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CLASS lcl_unit_tests IMPLEMENTATION.
METHOD setup.
DATA range_line TYPE /usi/bal_log_object_range_line.

CREATE OBJECT cut TYPE /usi/cl_bal_cd_log_lv_by_clnt.
cut = NEW /usi/cl_bal_cd_log_lv_by_clnt( ).

range_line-sign = 'E'.
range_line-option = 'CP'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CLASS lcl_unit_tests IMPLEMENTATION.
METHOD setup.
DATA range_line TYPE /usi/bal_log_object_range_line.

CREATE OBJECT cut TYPE /usi/cl_bal_cd_log_lv_by_obj.
cut = NEW /usi/cl_bal_cd_log_lv_by_obj( ).

range_line-sign = 'E'.
range_line-option = 'CP'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CLASS lcl_unit_tests IMPLEMENTATION.
METHOD setup.
DATA range_line TYPE /usi/bal_log_object_range_line.

CREATE OBJECT cut TYPE /usi/cl_bal_cd_log_lv_by_user.
cut = NEW /usi/cl_bal_cd_log_lv_by_user( ).

range_line-sign = 'E'.
range_line-option = 'CP'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CLASS lcl_unit_tests IMPLEMENTATION.
METHOD setup.
DATA range_line TYPE /usi/bal_log_object_range_line.

CREATE OBJECT cut TYPE /usi/cl_bal_cd_retention.
cut = NEW /usi/cl_bal_cd_retention( ).

range_line-sign = 'E'.
range_line-option = 'CP'.
Expand Down
17 changes: 7 additions & 10 deletions src/#usi#bal_cust_dao/#usi#cl_bal_cust_dao_factory.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,31 @@ CLASS /usi/cl_bal_cust_dao_factory DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES /usi/if_bal_cust_dao_factory.

PROTECTED SECTION.

PRIVATE SECTION.

ENDCLASS.


CLASS /usi/cl_bal_cust_dao_factory IMPLEMENTATION.
METHOD /usi/if_bal_cust_dao_factory~get_data_containers.
CREATE OBJECT r_result TYPE /usi/cl_bal_cd_data_containers.
r_result = NEW /usi/cl_bal_cd_data_containers( ).
ENDMETHOD.

METHOD /usi/if_bal_cust_dao_factory~get_exception_mapper.
CREATE OBJECT r_result TYPE /usi/cl_bal_cd_cx_mapper.
r_result = NEW /usi/cl_bal_cd_cx_mapper( ).
ENDMETHOD.

METHOD /usi/if_bal_cust_dao_factory~get_log_level_by_log_object.
CREATE OBJECT r_result TYPE /usi/cl_bal_cd_log_lv_by_obj.
r_result = NEW /usi/cl_bal_cd_log_lv_by_obj( ).
ENDMETHOD.

METHOD /usi/if_bal_cust_dao_factory~get_log_level_by_client.
CREATE OBJECT r_result TYPE /usi/cl_bal_cd_log_lv_by_clnt.
r_result = NEW /usi/cl_bal_cd_log_lv_by_clnt( ).
ENDMETHOD.

METHOD /usi/if_bal_cust_dao_factory~get_log_level_by_user.
CREATE OBJECT r_result TYPE /usi/cl_bal_cd_log_lv_by_user.
r_result = NEW /usi/cl_bal_cd_log_lv_by_user( ).
ENDMETHOD.

METHOD /usi/if_bal_cust_dao_factory~get_retention_parameters.
CREATE OBJECT r_result TYPE /usi/cl_bal_cd_retention.
r_result = NEW /usi/cl_bal_cd_retention( ).
ENDMETHOD.
ENDCLASS.
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,31 @@ ENDCLASS.

CLASS lcl_unit_tests IMPLEMENTATION.
METHOD setup.
CREATE OBJECT cut.
cut = NEW #( ).
ENDMETHOD.

METHOD test_exception_mapper_dao.
DATA actual_result TYPE REF TO /usi/if_bal_cd_cx_mapper.
actual_result = cut->/usi/if_bal_cust_dao_factory~get_exception_mapper( ).
DATA(actual_result) = cut->/usi/if_bal_cust_dao_factory~get_exception_mapper( ).
cl_aunit_assert=>assert_bound( actual_result ).
ENDMETHOD.

METHOD test_regular_log_level_dao.
DATA actual_result TYPE REF TO /usi/if_bal_cd_log_lv_by_obj.
actual_result = cut->/usi/if_bal_cust_dao_factory~get_log_level_by_log_object( ).
DATA(actual_result) = cut->/usi/if_bal_cust_dao_factory~get_log_level_by_log_object( ).
cl_aunit_assert=>assert_bound( actual_result ).
ENDMETHOD.

METHOD test_increased_log_level_dao.
DATA actual_result TYPE REF TO /usi/if_bal_cd_log_lv_by_user.
actual_result = cut->/usi/if_bal_cust_dao_factory~get_log_level_by_user( ).
DATA(actual_result) = cut->/usi/if_bal_cust_dao_factory~get_log_level_by_user( ).
cl_aunit_assert=>assert_bound( actual_result ).
ENDMETHOD.

METHOD test_message_context_data_dao.
DATA actual_result TYPE REF TO /usi/if_bal_cd_data_containers.
actual_result = cut->/usi/if_bal_cust_dao_factory~get_data_containers( ).
DATA(actual_result) = cut->/usi/if_bal_cust_dao_factory~get_data_containers( ).
cl_aunit_assert=>assert_bound( actual_result ).
ENDMETHOD.

METHOD test_retention_parameter_dao.
DATA actual_result TYPE REF TO /usi/if_bal_cd_retention.
actual_result = cut->/usi/if_bal_cust_dao_factory~get_retention_parameters( ).
DATA(actual_result) = cut->/usi/if_bal_cust_dao_factory~get_retention_parameters( ).
cl_aunit_assert=>assert_bound( actual_result ).
ENDMETHOD.
ENDCLASS.
2 changes: 1 addition & 1 deletion src/#usi#bal_cust_dao/#usi#if_bal_cd_cx_mapper.intf.abap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ INTERFACE /usi/if_bal_cd_cx_mapper PUBLIC.
exception_class TYPE /usi/bal_exception_classname,
mapper_class TYPE /usi/bal_exception_mapper,
END OF ty_record,
ty_records TYPE STANDARD TABLE OF ty_record WITH NON-UNIQUE DEFAULT KEY.
ty_records TYPE STANDARD TABLE OF ty_record WITH EMPTY KEY.

"! Read table /usi/bal_cx_map (Exception Mapper Classes)
"!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ INTERFACE /usi/if_bal_cd_data_containers PUBLIC.
sub_object TYPE balsubobj,
min_log_level TYPE /usi/bal_log_level,
END OF ty_record,
ty_records TYPE STANDARD TABLE OF ty_record WITH NON-UNIQUE DEFAULT KEY.
ty_records TYPE STANDARD TABLE OF ty_record WITH EMPTY KEY.

"! Read table /usi/bal_lv_data (Minimum Log-Level for Data-Container-Classes)
"!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ INTERFACE /usi/if_bal_cd_log_lv_by_clnt PUBLIC.
log_level TYPE /usi/bal_log_level,
auto_save TYPE /usi/bal_auto_save_immediately,
END OF ty_record,
ty_records TYPE STANDARD TABLE OF ty_record WITH NON-UNIQUE DEFAULT KEY.
ty_records TYPE STANDARD TABLE OF ty_record WITH EMPTY KEY.

"! Read table /usi/bal_lv_clnt (Increased Log-Level by Client)
"!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ INTERFACE /usi/if_bal_cd_log_lv_by_obj PUBLIC.
log_level TYPE /usi/bal_log_level,
auto_save_package_size TYPE /usi/bal_auto_save_pckg_size,
END OF ty_record,
ty_records TYPE STANDARD TABLE OF ty_record WITH NON-UNIQUE DEFAULT KEY.
ty_records TYPE STANDARD TABLE OF ty_record WITH EMPTY KEY.

"! Read table /usi/bal_lv_lobj (Product-specific Log-Level)
"!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ INTERFACE /usi/if_bal_cd_log_lv_by_user PUBLIC.
log_level TYPE /usi/bal_log_level,
auto_save TYPE /usi/bal_auto_save_immediately,
END OF ty_record,
ty_records TYPE STANDARD TABLE OF ty_record WITH NON-UNIQUE DEFAULT KEY.
ty_records TYPE STANDARD TABLE OF ty_record WITH EMPTY KEY.

"! Read table /usi/bal_lv_user (Increased Log-Level by User)
"!
Expand Down
2 changes: 1 addition & 1 deletion src/#usi#bal_cust_dao/#usi#if_bal_cd_retention.intf.abap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ INTERFACE /usi/if_bal_cd_retention PUBLIC.
INCLUDE TYPE /usi/bal_retention_parameters AS retention_parameters.
TYPES END OF ty_record.

TYPES ty_records TYPE STANDARD TABLE OF ty_record WITH NON-UNIQUE DEFAULT KEY.
TYPES ty_records TYPE STANDARD TABLE OF ty_record WITH EMPTY KEY.

"! <h1>Read table /usi/bal_lv_rtim (Retention time per Log-Level)</h1>
"!
Expand Down
23 changes: 11 additions & 12 deletions src/#usi#bal_cust_evaluation/#usi#cl_bal_ce_cx_mapper.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ CLASS /usi/cl_bal_ce_cx_mapper IMPLEMENTATION.
INSERT customizing_entry INTO TABLE customizing_entries.
ENDMETHOD.


METHOD get_validated_customizing.
CONSTANTS: mapper_interface_name TYPE seoclsname VALUE '/USI/IF_BAL_EXCEPTION_MAPPER',
exception_root_class TYPE seoclsname VALUE 'CX_ROOT'.
Expand All @@ -136,24 +135,24 @@ CLASS /usi/cl_bal_ce_cx_mapper IMPLEMENTATION.

LOOP AT raw_customizing_table ASSIGNING <raw_customizing_entry>.
TRY.
CREATE OBJECT mapper_description
EXPORTING
i_object_type_name = <raw_customizing_entry>-mapper_class.
mapper_description = NEW #( i_object_type_name = <raw_customizing_entry>-mapper_class ).

CREATE OBJECT exception_description
EXPORTING
i_object_type_name = <raw_customizing_entry>-exception_class.
exception_description = NEW #( i_object_type_name = <raw_customizing_entry>-exception_class ).
CATCH /usi/cx_bal_root.
CONTINUE.
ENDTRY.

CHECK mapper_description->is_instantiatable( ) EQ abap_true
AND mapper_description->is_implementing( mapper_interface_name ) EQ abap_true.
IF NOT ( mapper_description->is_instantiatable( ) = abap_true
AND mapper_description->is_implementing( mapper_interface_name ) = abap_true ).
CONTINUE.
ENDIF.

CHECK exception_description->is_interface( ) EQ abap_true
OR exception_description->is_inheriting_from( exception_root_class ) EQ abap_true.
IF NOT ( exception_description->is_interface( ) = abap_true
OR exception_description->is_inheriting_from( exception_root_class ) = abap_true ).
CONTINUE.
ENDIF.

IF exception_description->is_interface( ) EQ abap_true.
IF exception_description->is_interface( ) = abap_true.
result_line-exception_class_type = class_type-interface.
ELSE.
result_line-exception_class_type = class_type-class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,15 @@ ENDCLASS.

CLASS lcl_unit_tests IMPLEMENTATION.
METHOD setup.
CREATE OBJECT test_double_cust_dao.
test_double_cust_dao = NEW #( ).
reset_cut( cl_aunit_assert=>class ).
ENDMETHOD.

METHOD reset_cut.
DATA exception TYPE REF TO /usi/cx_bal_root.

TRY.
CREATE OBJECT cut TYPE /usi/cl_bal_ce_cx_mapper
EXPORTING
i_customizing_dao = test_double_cust_dao.
cut = NEW /usi/cl_bal_ce_cx_mapper( i_customizing_dao = test_double_cust_dao ).
CATCH /usi/cx_bal_root INTO exception.
/usi/cl_bal_aunit_exception=>abort_on_unexpected_exception( i_exception = exception
i_quit = i_quit ).
Expand Down Expand Up @@ -198,15 +197,13 @@ CLASS lcl_unit_tests IMPLEMENTATION.
fallback = cut->get_fallback_mapper_classname( ).

TRY.
CREATE OBJECT object_description
EXPORTING
i_object_type_name = fallback.
object_description = NEW #( i_object_type_name = fallback ).
CATCH /usi/cx_bal_root INTO unexpected_exception.
/usi/cl_bal_aunit_exception=>fail_on_unexpected_exception( unexpected_exception ).
ENDTRY.

IF object_description->is_implementing( mapper_interface_name ) NE abap_true
OR object_description->is_instantiatable( ) NE abap_true.
IF object_description->is_implementing( mapper_interface_name ) <> abap_true

Check failure on line 205 in src/#usi#bal_cust_evaluation/#usi#cl_bal_ce_cx_mapper.clas.testclasses.abap

View workflow job for this annotation

GitHub Actions / results

Remove double space

double_space

Check failure on line 205 in src/#usi#bal_cust_evaluation/#usi#cl_bal_ce_cx_mapper.clas.testclasses.abap

View workflow job for this annotation

GitHub Actions / results

Compare operator "<>" not preferred

preferred_compare_operator
OR object_description->is_instantiatable( ) <> abap_true.

Check failure on line 206 in src/#usi#bal_cust_evaluation/#usi#cl_bal_ce_cx_mapper.clas.testclasses.abap

View workflow job for this annotation

GitHub Actions / results

Fix in-statement indentation

in_statement_indentation

Check failure on line 206 in src/#usi#bal_cust_evaluation/#usi#cl_bal_ce_cx_mapper.clas.testclasses.abap

View workflow job for this annotation

GitHub Actions / results

Compare operator "<>" not preferred

preferred_compare_operator
cl_aunit_assert=>fail( 'Invalid fallback for mapper class!' ).
ENDIF.
ENDMETHOD.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ CLASS /usi/cl_bal_ce_data_containers IMPLEMENTATION.
FIELD-SYMBOLS <customizing_record> TYPE /usi/if_bal_cd_data_containers=>ty_record.

" Read database
CREATE OBJECT log_object_range_helper.
log_object_range_helper = NEW #( ).
log_object_range_helper->insert_line( i_log_object ).
log_object_range_helper->insert_line( space ).

CREATE OBJECT sub_object_range_helper.
sub_object_range_helper = NEW #( ).
sub_object_range_helper->insert_line( i_sub_object ).
sub_object_range_helper->insert_line( space ).

Expand All @@ -48,29 +48,29 @@ CLASS /usi/cl_bal_ce_data_containers IMPLEMENTATION.

" Delete rules of lower priority (Priority: log_object > sub_object)
SORT customizing_records
BY classname ASCENDING
log_object DESCENDING
sub_object DESCENDING.
BY classname ASCENDING
log_object DESCENDING
sub_object DESCENDING.

DELETE ADJACENT DUPLICATES
FROM customizing_records
COMPARING classname.
FROM customizing_records
COMPARING classname.

" Process rules of highest priority
LOOP AT customizing_records ASSIGNING <customizing_record>.
TRY.
required_log_level = /usi/cl_bal_enum_log_level=>get_by_value( <customizing_record>-min_log_level ).

CREATE OBJECT object_description
EXPORTING
i_object_type_name = <customizing_record>-classname.
object_description = NEW #( i_object_type_name = <customizing_record>-classname ).
CATCH /usi/cx_bal_root.
CONTINUE.
ENDTRY.

CHECK required_log_level->is_higher_than( i_log_level ) EQ abap_false
AND object_description->is_instantiatable( ) EQ abap_true
AND object_description->is_implementing( data_container_interface ) EQ abap_true.
IF required_log_level->is_higher_than( i_log_level ) = abap_true

Check failure on line 69 in src/#usi#bal_cust_evaluation/#usi#cl_bal_ce_data_containers.clas.abap

View workflow job for this annotation

GitHub Actions / results

Remove double space

double_space
OR object_description->is_instantiatable( ) = abap_false

Check failure on line 70 in src/#usi#bal_cust_evaluation/#usi#cl_bal_ce_data_containers.clas.abap

View workflow job for this annotation

GitHub Actions / results

Fix in-statement indentation

in_statement_indentation
OR object_description->is_implementing( data_container_interface ) = abap_false.
CONTINUE.
ENDIF.

INSERT <customizing_record>-classname INTO TABLE r_result.
ENDLOOP.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,16 @@ CLASS lcl_unit_tests DEFINITION FINAL FOR TESTING.
ENDCLASS.

CLASS lcl_unit_tests IMPLEMENTATION.

METHOD setup.
CREATE OBJECT test_double_cust_dao.
test_double_cust_dao = NEW #( ).
reset_cut( ).
ENDMETHOD.

METHOD reset_cut.
DATA exception TYPE REF TO /usi/cx_bal_root.

TRY.
CREATE OBJECT cut TYPE /usi/cl_bal_ce_data_containers
EXPORTING
i_customizing_dao = test_double_cust_dao.
cut = NEW /usi/cl_bal_ce_data_containers( i_customizing_dao = test_double_cust_dao ).
CATCH /usi/cx_bal_root INTO exception.
/usi/cl_bal_aunit_exception=>abort_on_unexpected_exception( exception ).
ENDTRY.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,18 @@ CLASS /usi/cl_bal_ce_log_lv_by_clnt IMPLEMENTATION.
customizing_dao = i_customizing_dao.
ENDMETHOD.


METHOD get_customizing_record.
DATA: customizing_entries TYPE /usi/if_bal_cd_log_lv_by_clnt=>ty_records,
log_object_range_helper TYPE REF TO /usi/cl_bal_log_object_range,
sub_object_range_helper TYPE REF TO /usi/cl_bal_sub_object_range,
endda_range TYPE /usi/bal_date_range,
endda_range_line TYPE /usi/bal_date_range_line.

FIELD-SYMBOLS <customizing_entry> TYPE /usi/if_bal_cd_log_lv_by_clnt=>ty_record.

CREATE OBJECT log_object_range_helper.
log_object_range_helper = NEW #( ).
log_object_range_helper->insert_line( i_log_object ).
log_object_range_helper->insert_line( space ).

CREATE OBJECT sub_object_range_helper.
sub_object_range_helper = NEW #( ).
sub_object_range_helper->insert_line( i_sub_object ).
sub_object_range_helper->insert_line( space ).

Expand Down
Loading

0 comments on commit 10ccf2e

Please sign in to comment.