All files / src/objects/core zcl_abapgit_serialize.clas.testclasses.abap

68.41% Statements 483/706
100% Branches 22/22
45.65% Functions 21/46
68.41% Lines 483/706

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 7071x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x 5x 5x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 5x 5x 1x 1x 3x 3x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 6x 1x 1x 6x 1x 1x   1x 1x   1x 1x   1x 1x 7x 1x 1x   1x 1x   1x 1x   1x 1x 1x 1x 1x 1x 1x 1x   1x 1x   1x 1x   1x 1x   1x 1x 1x 1x 1x   1x 1x 1x 1x 1x   1x 1x   1x 1x   1x 1x   1x 1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 1x 1x 1x 7x 7x 7x 7x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 5x 5x 5x 5x 1x 1x 1x 5x 5x 5x 5x 1x 1x 1x 3x 3x 3x 3x 1x 1x 1x 7x 7x 7x 7x 7x 7x 1x 1x 1x 7x 7x 7x 7x 7x 7x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x                       1x 1x                                                         1x 1x                                                                                       1x 1x                                                                                                             1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x                                     1x 1x                                                                                                     1x  
CLASS ltcl_determine_max_processes DEFINITION DEFERRED.
CLASS zcl_abapgit_serialize DEFINITION LOCAL FRIENDS ltcl_determine_max_processes.
 
CLASS ltd_settings DEFINITION FINAL FOR TESTING
  DURATION SHORT
  RISK LEVEL HARMLESS.
 
  PUBLIC SECTION.
    INTERFACES:
      zif_abapgit_persist_settings.
 
    METHODS:
      set_parallel_proc_disabled
        IMPORTING
          iv_parallel_proc_disabled TYPE abap_bool.
 
  PRIVATE SECTION.
    DATA:
      mv_parallel_proc_disabled TYPE zif_abapgit_definitions=>ty_s_user_settings-parallel_proc_disabled.
 
ENDCLASS.
 
 
CLASS ltd_settings IMPLEMENTATION.
 
  METHOD zif_abapgit_persist_settings~modify.
  ENDMETHOD.
 
  METHOD zif_abapgit_persist_settings~read.
    CREATE OBJECT ro_settings.
    ro_settings->set_parallel_proc_disabled( mv_parallel_proc_disabled ).
  ENDMETHOD.
 
  METHOD set_parallel_proc_disabled.
    mv_parallel_proc_disabled = iv_parallel_proc_disabled.
  ENDMETHOD.
 
ENDCLASS.
 
 
CLASS ltd_function_module DEFINITION FINAL FOR TESTING
  DURATION SHORT
  RISK LEVEL HARMLESS.
 
  PUBLIC SECTION.
    INTERFACES:
      zif_abapgit_function_module.
 
ENDCLASS.
 
 
CLASS ltd_function_module IMPLEMENTATION.
 
  METHOD zif_abapgit_function_module~function_exists.
    rv_exists = abap_true.
  ENDMETHOD.
 
ENDCLASS.
 
 
CLASS ltd_environment DEFINITION FINAL FOR TESTING
  DURATION SHORT
  RISK LEVEL HARMLESS.
 
  PUBLIC SECTION.
    INTERFACES:
      zif_abapgit_environment.
 
    METHODS:
      set_is_merged
        IMPORTING iv_is_merged TYPE abap_bool,
 
      set_free_work_processes
        IMPORTING iv_free_work_processes TYPE i.
 
  PRIVATE SECTION.
    DATA:
      mv_is_merged           TYPE abap_bool,
      mv_free_work_processes TYPE i.
 
ENDCLASS.
 
 
CLASS ltd_environment IMPLEMENTATION.
 
  METHOD zif_abapgit_environment~compare_with_inactive.
  ENDMETHOD.
 
  METHOD zif_abapgit_environment~get_basis_release.
  ENDMETHOD.
 
  METHOD zif_abapgit_environment~get_system_language_filter.
  ENDMETHOD.
 
  METHOD zif_abapgit_environment~is_merged.
    rv_result = mv_is_merged.
  ENDMETHOD.
 
  METHOD zif_abapgit_environment~is_repo_object_changes_allowed.
  ENDMETHOD.
 
  METHOD zif_abapgit_environment~is_restart_required.
  ENDMETHOD.
 
  METHOD zif_abapgit_environment~is_sap_cloud_platform.
  ENDMETHOD.
 
  METHOD zif_abapgit_environment~is_sap_object_allowed.
  ENDMETHOD.
 
  METHOD zif_abapgit_environment~is_variant_maintenance.
  ENDMETHOD.
 
  METHOD zif_abapgit_environment~init_parallel_processing.
    rv_free_work_processes = mv_free_work_processes.
  ENDMETHOD.
 
  METHOD set_is_merged.
    me->mv_is_merged = iv_is_merged.
  ENDMETHOD.
 
  METHOD set_free_work_processes.
    me->mv_free_work_processes = iv_free_work_processes.
  ENDMETHOD.
 
ENDCLASS.
 
 
CLASS ltd_exit DEFINITION FINAL FOR TESTING
  DURATION SHORT
  RISK LEVEL HARMLESS.
  PUBLIC SECTION.
    INTERFACES:
      zif_abapgit_exit.
 
    METHODS:
      set_max_parallel_processes
        IMPORTING
          iv_max_parallel_processes TYPE i.
 
  PRIVATE SECTION.
    DATA:
      mv_max_parallel_processes TYPE i.
 
ENDCLASS.
 
 
CLASS ltd_exit IMPLEMENTATION.
 
  METHOD zif_abapgit_exit~adjust_display_commit_url.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~adjust_display_filename.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~allow_sap_objects.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~change_local_host.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~change_max_parallel_processes.
    IF mv_max_parallel_processes IS NOT INITIAL.
      cv_max_processes = mv_max_parallel_processes.
    ENDIF.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~change_proxy_authentication.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~change_proxy_port.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~change_proxy_url.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~change_rfc_server_group.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~change_supported_data_objects.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~change_supported_object_types.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~change_tadir.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~create_http_client.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~custom_serialize_abap_clif.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~deserialize_postprocess.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~determine_transport_request.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~enhance_repo_toolbar.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~get_ci_tests.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~get_ssl_id.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~http_client.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~on_event.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~pre_calculate_repo_status.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~serialize_postprocess.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~validate_before_push.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~wall_message_list.
  ENDMETHOD.
 
  METHOD zif_abapgit_exit~wall_message_repo.
  ENDMETHOD.
 
  METHOD set_max_parallel_processes.
    mv_max_parallel_processes = iv_max_parallel_processes.
  ENDMETHOD.
 
ENDCLASS.
 
 
CLASS ltcl_determine_max_processes DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
 
  PRIVATE SECTION.
    DATA:
      mo_cut                    TYPE REF TO zcl_abapgit_serialize,
      mv_act_processes          TYPE i,
      mo_settings_double        TYPE REF TO ltd_settings,
      mo_environment_double     TYPE REF TO ltd_environment,
      mo_function_module_double TYPE REF TO ltd_function_module,
      mo_exit                   TYPE REF TO ltd_exit.
 
    METHODS:
      setup,
 
      determine_max_processes_free FOR TESTING RAISING zcx_abapgit_exception,
      det_max_processes_not_free FOR TESTING RAISING zcx_abapgit_exception,
      det_max_proc_amdahls_law FOR TESTING RAISING zcx_abapgit_exception,
      determine_max_processes_no_pp FOR TESTING RAISING zcx_abapgit_exception,
      determine_max_processes_merged FOR TESTING RAISING zcx_abapgit_exception,
      determine_max_processes_exit FOR TESTING RAISING zcx_abapgit_exception,
      force FOR TESTING RAISING zcx_abapgit_exception,
 
      teardown,
 
      given_parallel_proc_disabled
        IMPORTING
          iv_parallel_proc_disabled TYPE abap_bool,
 
      given_is_merged
        IMPORTING
          iv_is_merged TYPE abap_bool,
 
      given_free_work_processes
        IMPORTING
          iv_free_work_processes TYPE i,
 
      when_determine_max_processes
        IMPORTING
          iv_force_sequential TYPE abap_bool OPTIONAL
        RAISING
          zcx_abapgit_exception,
 
      then_we_shd_have_n_processes
        IMPORTING
          iv_exp_processes TYPE i,
 
      given_exit_chg_max_processes
        IMPORTING
          iv_max_processes TYPE i.
 
ENDCLASS.
 
CLASS ltcl_determine_max_processes IMPLEMENTATION.
 
  METHOD setup.
 
    CREATE OBJECT mo_settings_double.
    zcl_abapgit_persist_injector=>set_settings( mo_settings_double ).
 
    CREATE OBJECT mo_environment_double.
    zcl_abapgit_injector=>set_environment( mo_environment_double ).
 
    CREATE OBJECT mo_function_module_double.
    zcl_abapgit_injector=>set_function_module( mo_function_module_double ).
 
    CREATE OBJECT mo_exit.
    zcl_abapgit_injector=>set_exit( mo_exit ).
 
    TRY.
        CREATE OBJECT mo_cut.
      CATCH zcx_abapgit_exception.
        cl_abap_unit_assert=>fail( 'Error creating serializer' ).
    ENDTRY.
 
  ENDMETHOD.
 
 
  METHOD teardown.
 
    CLEAR: mo_cut->gv_max_processes.
 
  ENDMETHOD.
 
 
  METHOD determine_max_processes_free.
 
    given_parallel_proc_disabled( abap_false ).
    given_is_merged( abap_false ).
    given_free_work_processes( 10 ).
 
    when_determine_max_processes( ).
 
    then_we_shd_have_n_processes( 9 ).
 
  ENDMETHOD.
 
 
  METHOD det_max_processes_not_free.
 
    given_parallel_proc_disabled( abap_false ).
    given_is_merged( abap_false ).
    given_free_work_processes( 0 ).
 
    when_determine_max_processes( ).
 
    then_we_shd_have_n_processes( 1 ).
 
  ENDMETHOD.
 
 
  METHOD det_max_proc_amdahls_law.
 
    given_parallel_proc_disabled( abap_false ).
    given_is_merged( abap_false ).
    given_free_work_processes( 50 ).
 
    when_determine_max_processes( ).
 
    then_we_shd_have_n_processes( 32 ).
 
  ENDMETHOD.
 
 
  METHOD determine_max_processes_no_pp.
 
    given_parallel_proc_disabled( abap_true ).
    given_is_merged( abap_false ).
 
    when_determine_max_processes( ).
 
    then_we_shd_have_n_processes( 1 ).
 
  ENDMETHOD.
 
 
  METHOD determine_max_processes_merged.
 
    given_parallel_proc_disabled( abap_false ).
    given_is_merged( abap_true ).
 
    when_determine_max_processes( ).
 
    then_we_shd_have_n_processes( 1 ).
 
  ENDMETHOD.
 
 
  METHOD determine_max_processes_exit.
 
    given_exit_chg_max_processes( 7 ).
    when_determine_max_processes( ).
    then_we_shd_have_n_processes( 7 ).
 
  ENDMETHOD.
 
 
  METHOD force.
 
    when_determine_max_processes( abap_true ).
 
    then_we_shd_have_n_processes( 1 ).
 
  ENDMETHOD.
 
 
  METHOD given_parallel_proc_disabled.
 
    mo_settings_double->set_parallel_proc_disabled( iv_parallel_proc_disabled ).
 
  ENDMETHOD.
 
 
  METHOD given_is_merged.
 
    mo_environment_double->set_is_merged( iv_is_merged ).
 
  ENDMETHOD.
 
 
  METHOD given_free_work_processes.
 
    mo_environment_double->set_free_work_processes( iv_free_work_processes ).
 
  ENDMETHOD.
 
 
  METHOD when_determine_max_processes.
 
    mv_act_processes = mo_cut->determine_max_processes(
                           iv_force_sequential = iv_force_sequential
                           iv_package          = 'ZDUMMY' ).
 
  ENDMETHOD.
 
 
  METHOD then_we_shd_have_n_processes.
 
    cl_abap_unit_assert=>assert_equals(
      act = mv_act_processes
      exp = iv_exp_processes ).
 
  ENDMETHOD.
 
 
  METHOD given_exit_chg_max_processes.
 
    mo_exit->set_max_parallel_processes( iv_max_processes ).
 
  ENDMETHOD.
 
ENDCLASS.
 
CLASS ltcl_serialize DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
 
  PRIVATE SECTION.
    DATA:
      mo_dot TYPE REF TO zcl_abapgit_dot_abapgit,
      mo_cut TYPE REF TO zcl_abapgit_serialize.
 
    METHODS:
      setup,
      test FOR TESTING RAISING zcx_abapgit_exception,
      unsupported FOR TESTING RAISING zcx_abapgit_exception,
      ignored FOR TESTING RAISING zcx_abapgit_exception.
 
ENDCLASS.
 
 
CLASS ltcl_serialize IMPLEMENTATION.
 
  METHOD setup.

    mo_dot = zcl_abapgit_dot_abapgit=>build_default( ).

    TRY.
        CREATE OBJECT mo_cut
          EXPORTING
            io_dot_abapgit = mo_dot.
      CATCH zcx_abapgit_exception.
        cl_abap_unit_assert=>fail( 'Error creating serializer' ).
    ENDTRY.
  ENDMETHOD.
 
  METHOD test.

    DATA: lt_tadir      TYPE zif_abapgit_definitions=>ty_tadir_tt,
          lt_sequential TYPE zif_abapgit_definitions=>ty_files_item_tt,
          lt_parallel   TYPE zif_abapgit_definitions=>ty_files_item_tt.

    FIELD-SYMBOLS: <ls_tadir> LIKE LINE OF lt_tadir.


    APPEND INITIAL LINE TO lt_tadir ASSIGNING <ls_tadir>.
    <ls_tadir>-object   = 'PROG'.
    <ls_tadir>-obj_name = 'RSABAPPROGRAM'.
    <ls_tadir>-devclass = 'PACKAGE'.
    <ls_tadir>-path     = 'foobar'.
    <ls_tadir>-masterlang = sy-langu.

    lt_sequential = mo_cut->serialize(
      it_tadir            = lt_tadir
      iv_force_sequential = abap_true ).

    lt_parallel = mo_cut->serialize(
      it_tadir            = lt_tadir
      iv_force_sequential = abap_false ).

    cl_abap_unit_assert=>assert_equals(
      act = lt_sequential
      exp = lt_parallel ).

  ENDMETHOD.
 
  METHOD unsupported.

    DATA: lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt,
          ls_msg   TYPE zif_abapgit_log=>ty_log_out,
          lt_msg   TYPE zif_abapgit_log=>ty_log_outs,
          li_log1  TYPE REF TO zif_abapgit_log,
          li_log2  TYPE REF TO zif_abapgit_log.

    FIELD-SYMBOLS: <ls_tadir> LIKE LINE OF lt_tadir.


    APPEND INITIAL LINE TO lt_tadir ASSIGNING <ls_tadir>.
    <ls_tadir>-object   = 'ABCD'.
    <ls_tadir>-obj_name = 'OBJECT'.

    CREATE OBJECT li_log1 TYPE zcl_abapgit_log.
    mo_cut->serialize(
      it_tadir            = lt_tadir
      ii_log              = li_log1
      iv_force_sequential = abap_true ).

    CREATE OBJECT li_log2 TYPE zcl_abapgit_log.
    mo_cut->serialize(
      it_tadir            = lt_tadir
      ii_log              = li_log2
      iv_force_sequential = abap_false ).

    lt_msg = li_log1->get_messages( ).
    READ TABLE lt_msg INTO ls_msg INDEX 1.
    cl_abap_unit_assert=>assert_subrc( ).

    cl_abap_unit_assert=>assert_char_cp(
      act = ls_msg-text
      exp = '*Object type ABCD not supported*' ).

    lt_msg = li_log2->get_messages( ).
    READ TABLE lt_msg INTO ls_msg INDEX 1.
    cl_abap_unit_assert=>assert_subrc( ).

    cl_abap_unit_assert=>assert_char_cp(
      act = ls_msg-text
      exp = '*Object type ABCD not supported*' ).

  ENDMETHOD.
 
  METHOD ignored.

    DATA: lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt,
          ls_msg   TYPE zif_abapgit_log=>ty_log_out,
          lt_msg   TYPE zif_abapgit_log=>ty_log_outs,
          li_log1  TYPE REF TO zif_abapgit_log,
          li_log2  TYPE REF TO zif_abapgit_log.

    FIELD-SYMBOLS: <ls_tadir> LIKE LINE OF lt_tadir.

    mo_dot->add_ignore(
      iv_path     = '/src/'
      iv_filename = 'zcl_test_ignore.clas.*' ).

    APPEND INITIAL LINE TO lt_tadir ASSIGNING <ls_tadir>.
    <ls_tadir>-object   = 'CLAS'.
    <ls_tadir>-obj_name = 'ZCL_TEST'.
    <ls_tadir>-devclass = '$ZTEST'.

    APPEND INITIAL LINE TO lt_tadir ASSIGNING <ls_tadir>.
    <ls_tadir>-object   = 'CLAS'.
    <ls_tadir>-obj_name = 'ZCL_TEST_IGNORE'.
    <ls_tadir>-devclass = '$ZTEST'.

    CREATE OBJECT li_log1 TYPE zcl_abapgit_log.
    mo_cut->serialize(
      iv_package          = '$ZTEST'
      it_tadir            = lt_tadir
      ii_log              = li_log1
      iv_force_sequential = abap_true ).

    CREATE OBJECT li_log2 TYPE zcl_abapgit_log.
    mo_cut->serialize(
      iv_package          = '$ZTEST'
      it_tadir            = lt_tadir
      ii_log              = li_log2
      iv_force_sequential = abap_false ).

    lt_msg = li_log1->get_messages( ).
    READ TABLE lt_msg INTO ls_msg INDEX 1.
    cl_abap_unit_assert=>assert_subrc( ).

    cl_abap_unit_assert=>assert_char_cp(
      act = ls_msg-text
      exp = '*Object CLAS ZCL_TEST_IGNORE ignored*' ).

    lt_msg = li_log2->get_messages( ).
    READ TABLE lt_msg INTO ls_msg INDEX 1.
    cl_abap_unit_assert=>assert_subrc( ).

    cl_abap_unit_assert=>assert_char_cp(
      act = ls_msg-text
      exp = '*Object CLAS ZCL_TEST_IGNORE ignored*' ).

  ENDMETHOD.
 
ENDCLASS.
 
CLASS ltcl_i18n DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
 
  PRIVATE SECTION.
    CONSTANTS:
      c_english TYPE sy-langu VALUE 'E',
      c_german  TYPE sy-langu VALUE 'D'.
 
    DATA:
      mo_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit,
      mo_cut         TYPE REF TO zcl_abapgit_serialize.
 
    METHODS:
      setup,
      test FOR TESTING RAISING zcx_abapgit_exception.
 
 
ENDCLASS.
 
 
CLASS ltcl_i18n IMPLEMENTATION.
 
  METHOD setup.
    DATA ls_data TYPE zif_abapgit_dot_abapgit=>ty_dot_abapgit.

    " Main language: English, Translations: German
    ls_data-master_language = c_english.
    " ls_data-i18n_languages needs to be initial to get classic I18N data

    TRY.
        CREATE OBJECT mo_dot_abapgit
          EXPORTING
            is_data = ls_data.

        CREATE OBJECT mo_cut
          EXPORTING
            io_dot_abapgit = mo_dot_abapgit.
      CATCH zcx_abapgit_exception.
        cl_abap_unit_assert=>fail( 'Error creating serializer' ).
    ENDTRY.
  ENDMETHOD.
 
  METHOD test.

    DATA: lt_tadir      TYPE zif_abapgit_definitions=>ty_tadir_tt,
          lt_result     TYPE zif_abapgit_definitions=>ty_files_item_tt,
          lv_xml        TYPE string,
          lo_input      TYPE REF TO zcl_abapgit_xml_input,
          ls_dd02v      TYPE dd02v,
          lt_i18n_langs TYPE TABLE OF langu.

    FIELD-SYMBOLS: <ls_tadir>      LIKE LINE OF lt_tadir,
                   <ls_result>     LIKE LINE OF lt_result,
                   <ls_i18n_langs> LIKE LINE OF lt_i18n_langs.

    " Assumption: Table T100 has at least English and German description
    APPEND INITIAL LINE TO lt_tadir ASSIGNING <ls_tadir>.
    <ls_tadir>-object   = 'TABL'.
    <ls_tadir>-obj_name = 'T100'.
    <ls_tadir>-devclass = 'PACKAGE'.
    <ls_tadir>-path     = 'foobar'.

    lt_result = mo_cut->serialize( lt_tadir ).

    cl_abap_unit_assert=>assert_equals(
      act = lines( lt_result )
      exp = 1 ).

    READ TABLE lt_result ASSIGNING <ls_result> INDEX 1.
    ASSERT sy-subrc = 0.

    lv_xml = zcl_abapgit_convert=>xstring_to_string_utf8( <ls_result>-file-data ).

    CREATE OBJECT lo_input
      EXPORTING
        iv_xml = lv_xml.

    lo_input->zif_abapgit_xml_input~read( EXPORTING iv_name = 'DD02V'
                                          CHANGING  cg_data = ls_dd02v ).

    cl_abap_unit_assert=>assert_equals(
      act = ls_dd02v-ddlanguage
      exp = c_english ).

    lo_input->zif_abapgit_xml_input~read( EXPORTING iv_name = 'I18N_LANGS'
                                          CHANGING  cg_data = lt_i18n_langs ).

    cl_abap_unit_assert=>assert_not_initial( lt_i18n_langs ).

    READ TABLE lt_i18n_langs ASSIGNING <ls_i18n_langs> WITH KEY table_line = c_german.
    cl_abap_unit_assert=>assert_subrc( ).

  ENDMETHOD.
ENDCLASS.