DCLS: Fix activation error + TADIR handling + late deserialization #2051 (#2085)

* DCLS: Fix activation and move to late deser.

* DCLS: improve tadir handling + activation
This commit is contained in:
Christian Günter 2018-11-11 06:32:56 +01:00 committed by Lars Hvam
parent 2a08aca65a
commit dc173ad906
3 changed files with 97 additions and 5 deletions

View File

@ -67,6 +67,8 @@ CLASS ZCL_ABAPGIT_OBJECT_DCLS IMPLEMENTATION.
<lg_field> = mo_files->read_string( 'asdcls' ).
TRY.
tadir_insert( iv_package ).
CALL METHOD ('CL_ACM_DCL_HANDLER_FACTORY')=>('CREATE')
RECEIVING
ro_handler = lo_dcl.
@ -74,13 +76,11 @@ CLASS ZCL_ABAPGIT_OBJECT_DCLS IMPLEMENTATION.
CALL METHOD lo_dcl->('SAVE')
EXPORTING
iv_dclname = ms_item-obj_name
iv_put_state = 'A'
iv_put_state = 'I'
is_dclsrc = <lg_data>
iv_devclass = iv_package
iv_access_mode = 'INSERT'.
tadir_insert( iv_package ).
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise( iv_text = lx_error->get_text( )
ix_previous = lx_error ).
@ -118,8 +118,8 @@ CLASS ZCL_ABAPGIT_OBJECT_DCLS IMPLEMENTATION.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-ddic = abap_true.
rs_metadata-delete_tadir = abap_true.
rs_metadata-late_deser = abap_true.
ENDMETHOD.

View File

@ -819,12 +819,18 @@ CLASS ZCL_ABAPGIT_OBJECTS IMPLEMENTATION.
APPEND <ls_result> TO rt_results.
ENDLOOP.
* DDLS has to be handled before DCLS
LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'DDLS'.
APPEND <ls_result> TO rt_results.
ENDLOOP.
LOOP AT it_results ASSIGNING <ls_result>
WHERE obj_type <> 'IASP'
AND obj_type <> 'PROG'
AND obj_type <> 'XSLT'
AND obj_type <> 'PINF'
AND obj_type <> 'ENHS'.
AND obj_type <> 'ENHS'
AND obj_type <> 'DDLS'.
APPEND <ls_result> TO rt_results.
ENDLOOP.

View File

@ -731,3 +731,89 @@ CLASS ltcl_adjust_namespaces IMPLEMENTATION.
ENDMETHOD.
ENDCLASS.
CLASS ltcl_prio_deserialization DEFINITION FINAL FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS:
setup,
ddls_before_dcls FOR TESTING RAISING cx_static_check,
given
IMPORTING
iv_object_type TYPE trobjtype,
when_deser_is_priorized,
then
IMPORTING
iv_exp_object_type TYPE trobjtype.
DATA:
mo_objects TYPE REF TO zcl_abapgit_objects,
mt_input TYPE zif_abapgit_definitions=>ty_results_tt,
mt_output TYPE zif_abapgit_definitions=>ty_results_tt,
mv_exp_output_tabix TYPE i.
ENDCLASS.
CLASS zcl_abapgit_objects DEFINITION LOCAL FRIENDS ltcl_prio_deserialization.
CLASS ltcl_prio_deserialization IMPLEMENTATION.
METHOD setup.
CREATE OBJECT mo_objects.
mv_exp_output_tabix = 0.
ENDMETHOD.
METHOD ddls_before_dcls.
given( 'DCLS' ).
given( 'DDLS' ).
given( 'DCLS' ).
given( 'DDLS' ).
when_deser_is_priorized( ).
then( 'DDLS' ).
then( 'DDLS' ).
then( 'DCLS' ).
then( 'DCLS' ).
ENDMETHOD.
METHOD given.
DATA: ls_input LIKE LINE OF mt_input.
ls_input-obj_type = iv_object_type.
INSERT ls_input INTO TABLE mt_input.
ENDMETHOD.
METHOD when_deser_is_priorized.
mt_output = mo_objects->prioritize_deser( mt_input ).
ENDMETHOD.
METHOD then.
DATA: ls_output LIKE LINE OF mt_output.
mv_exp_output_tabix = mv_exp_output_tabix + 1.
READ TABLE mt_output INTO ls_output INDEX mv_exp_output_tabix.
cl_abap_unit_assert=>assert_equals(
exp = iv_exp_object_type
act = ls_output-obj_type ).
ENDMETHOD.
ENDCLASS.