All files / src/aunit zcl_abapgit_aunit_factory.clas.abap

100% Statements 28/28
100% Branches 0/0
100% Functions 0/0
100% Lines 28/28

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 291x 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 zcl_abapgit_aunit_factory DEFINITION PUBLIC.
  PUBLIC SECTION.
    "! Classic runner if available, otherwise the modern one.
    "! Raises an exception if neither is supported in the release
    CLASS-METHODS get_runner
      IMPORTING
        !ii_repo         TYPE REF TO zif_abapgit_repo
      RETURNING
        VALUE(ri_runner) TYPE REF TO zif_abapgit_aunit_runner
      RAISING
        zcx_abapgit_exception.
ENDCLASS.
 
CLASS zcl_abapgit_aunit_factory IMPLEMENTATION.
 
  METHOD get_runner.
    TRY.
        CREATE OBJECT ri_runner TYPE zcl_abapgit_aunit_classic
          EXPORTING
            ii_repo = ii_repo.
      CATCH zcx_abapgit_exception.
        CREATE OBJECT ri_runner TYPE zcl_abapgit_aunit_modern
          EXPORTING
            ii_repo = ii_repo.
    ENDTRY.
  ENDMETHOD.
 
ENDCLASS.