anchor.diff:  CLASS ltcl_persistence_settings IMPLEMENTATION.
     METHOD setup.
       CREATE OBJECT mo_persistence_settings.
  +    CREATE OBJECT mo_settings.
  +    clear_settings_database( ).
  +
       "These tests may fail if you are locking the entries (e.g. the ZABAPGIT transaction is open)
     ENDMETHOD.
   
     METHOD modify_settings_proxy_url.
       DATA lv_proxy_url TYPE string.
  -    TRY.
  -        CREATE OBJECT mo_settings.
  -        mo_settings->set_proxy_url( 'http://proxy' ).
  -
  -        mo_persistence_settings->modify( mo_settings ).
  -
  -        lv_proxy_url = lcl_app=>db( )->read(
  -          iv_type  = 'SETTINGS'
  -          iv_value = 'PROXY_URL' ).
  -
  -        cl_abap_unit_assert=>assert_equals(
  -          act = lv_proxy_url
  -          exp = 'http://proxy' ).
  -      CATCH cx_root.
  -        cl_abap_unit_assert=>fail( 'Unexpected exception' ).
  -    ENDTRY.
  +
  +    mo_settings->set_proxy_url( 'http://proxy' ).
  +
  +    mo_persistence_settings->modify( mo_settings ).
  +
  +    lv_proxy_url = lcl_app=>db( )->read(
  +      iv_type  = 'SETTINGS'
  +      iv_value = 'PROXY_URL' ).
  +
  +    cl_abap_unit_assert=>assert_equals(
  +      act = lv_proxy_url
  +      exp = 'http://proxy' ).
     ENDMETHOD.
   
     METHOD modify_settings_proxy_port.
       DATA lv_proxy_port TYPE string.
  +    mo_settings->set_proxy_port( '8080' ).
  +
  +    mo_persistence_settings->modify( mo_settings ).
  +
  +    lv_proxy_port = lcl_app=>db( )->read(
  +      iv_type  = 'SETTINGS'
  +      iv_value = 'PROXY_PORT' ).
  +
  +    cl_abap_unit_assert=>assert_equals(
  +      act = lv_proxy_port
  +      exp = '8080' ).
  +  ENDMETHOD.
  +
  +  METHOD read_proxy_settings.
  +    lcl_app=>db( )->modify(
  +      iv_type       = 'SETTINGS'
  +      iv_value      = 'PROXY_URL'
  +      iv_data       = 'A_URL' ).
  +
  +    lcl_app=>db( )->modify(
  +      iv_type       = 'SETTINGS'
  +      iv_value      = 'PROXY_PORT'
  +      iv_data       = '1000' ).
  +
  +    mo_settings = mo_persistence_settings->read( ).
  +
  +    cl_abap_unit_assert=>assert_equals(
  +      act = mo_settings->get_proxy_url( )
  +      exp = 'A_URL' ).
  +    cl_abap_unit_assert=>assert_equals(
  +      act = mo_settings->get_proxy_port( )
  +      exp = '1000' ).
  +  ENDMETHOD.
  +
  +  METHOD read_not_found_port.
  +    mo_settings = mo_persistence_settings->read( ).
  +
  +    cl_abap_unit_assert=>assert_equals(
  +      act = mo_settings->get_proxy_port( )
  +      exp = '' ).
  +  ENDMETHOD.
  +
  +  METHOD read_not_found_url.
  +
  +    mo_settings = mo_persistence_settings->read( ).
  +
  +    cl_abap_unit_assert=>assert_equals(
  +      act = mo_settings->get_proxy_url( )
  +      exp = '' ).
  +  ENDMETHOD.
  +
  +  METHOD modify_run_critical_tests.
  +    DATA lv_run_critical_tests TYPE abap_bool.
  +    mo_settings->set_run_critical_tests( abap_true ).
  +
  +    mo_persistence_settings->modify( mo_settings ).
  +
  +    lv_run_critical_tests = lcl_app=>db( )->read(
  +      iv_type  = 'SETTINGS'
  +      iv_value = 'CRIT_TESTS' ).
  +
  +    cl_abap_unit_assert=>assert_equals(
  +      act = lv_run_critical_tests
  +      exp = abap_true ).
  +  ENDMETHOD.
  +
  +  METHOD read_run_critical_tests.
  +    lcl_app=>db( )->modify(
  +      iv_type       = 'SETTINGS'
  +      iv_value      = 'CRIT_TESTS'
  +      iv_data       = 'X' ).
  +    mo_settings = mo_persistence_settings->read( ).
  +
  +    cl_abap_unit_assert=>assert_equals(
  +      act = mo_settings->get_run_critical_tests( )
  +      exp = abap_true ).
  +  ENDMETHOD.
  +  METHOD read_not_found_critical_tests.
  +    mo_settings = mo_persistence_settings->read( ).
  +
  +    cl_abap_unit_assert=>assert_equals(
  +      act = mo_settings->get_run_critical_tests( )
  +      exp = abap_false ).
  +  ENDMETHOD.
  +
  +
  +  METHOD clear_settings_database.
  +
       TRY.
  -        CREATE OBJECT mo_settings.
  -        mo_settings->set_proxy_port( '8080' ).
  -
  -        mo_persistence_settings->modify( mo_settings ).
  -
  -        lv_proxy_port = lcl_app=>db( )->read(
  -          iv_type  = 'SETTINGS'
  -          iv_value = 'PROXY_PORT' ).
  -
  -        cl_abap_unit_assert=>assert_equals(
  -          act = lv_proxy_port
  -          exp = '8080' ).
  -      CATCH cx_root.
  -        cl_abap_unit_assert=>fail( 'Unexpected exception' ).
  +        lcl_app=>db( )->delete(
  +          iv_type       = 'SETTINGS'
  +          iv_value      = 'PROXY_URL' ).
  +      CATCH cx_static_check.
  +        "If entry didn't exist, that's okay
       ENDTRY.
  -  ENDMETHOD.
  -
  -  METHOD read_settings.
       TRY.
  -        lcl_app=>db( )->modify(
  +        lcl_app=>db( )->delete(
             iv_type       = 'SETTINGS'
  -          iv_value      = 'PROXY_URL'
  -          iv_data       = 'A_URL' ).
  -
  -        lcl_app=>db( )->modify(
  +          iv_value      = 'PROXY_PORT' ).
  +      CATCH cx_static_check.
  +        "If entry didn't exist, that's okay
  +    ENDTRY.
  +    TRY.
  +        lcl_app=>db( )->delete(
             iv_type       = 'SETTINGS'
  -          iv_value      = 'PROXY_PORT'
  -          iv_data       = '1000' ).
  -
  -        mo_settings = mo_persistence_settings->read( ).
  -
  -        cl_abap_unit_assert=>assert_equals(
  -          act = mo_settings->get_proxy_url( )
  -          exp = 'A_URL' ).
  -        cl_abap_unit_assert=>assert_equals(
  -          act = mo_settings->get_proxy_port( )
  -          exp = '1000' ).
  -      CATCH cx_root.
  -        cl_abap_unit_assert=>fail( 'Unexpected exception' ).
  +          iv_value      = 'CRIT_TESTS' ).
  +      CATCH cx_static_check.
  +        "If entry didn't exist, that's okay
       ENDTRY.
  -  ENDMETHOD.
  -
  -  METHOD read_not_found_port.
  -    TRY.
  -        lcl_app=>db( )->modify(
  -          iv_type       = 'SETTINGS'
  -          iv_value      = 'PROXY_URL'
  -          iv_data       = 'A_URL' ).
  -        lcl_app=>db( )->modify(
  -          iv_type       = 'SETTINGS'
  -          iv_value      = 'PROXY_PORT'
  -          iv_data       = '' ).
  -
  -        mo_settings = mo_persistence_settings->read( ).
  -
  -        cl_abap_unit_assert=>assert_equals(
  -          act = mo_settings->get_proxy_port( )
  -          exp = '' ).
  -      CATCH cx_root.
  -        cl_abap_unit_assert=>fail( 'Unexpected exception' ).
  -    ENDTRY.
  -  ENDMETHOD.
  -
  -  METHOD read_not_found_url.
  -    TRY.
  -        lcl_app=>db( )->modify(
  -           iv_type       = 'SETTINGS'
  -           iv_value      = 'PROXY_PORT'
  -           iv_data       = '1000' ).
  -        lcl_app=>db( )->modify(
  -          iv_type       = 'SETTINGS'
  -          iv_value      = 'PROXY_URL'
  -          iv_data       = '' ).
  -        mo_settings = mo_persistence_settings->read( ).
  -
  -        cl_abap_unit_assert=>assert_equals(
  -          act = mo_settings->get_proxy_url( )
  -          exp = '' ).
  -      CATCH cx_root.
  -        cl_abap_unit_assert=>fail( 'Unexpected exception' ).
  -    ENDTRY.
  +
     ENDMETHOD.
   
   ENDCLASS.
positive.code: 
    METHOD get_proxy_port.
      rv_port = mv_proxy_port.
    ENDMETHOD.
  
  ENDCLASS.
  
negative.code:       CATCH lcx_not_found.
          ro_settings->set_proxy_port( '' ).
      ENDTRY.
      TRY.
          lv_critical_tests_as_boolean = lv_critical_tests_as_string = lcl_app=>db( )->read(
              iv_type  = 'SETTINGS'
              iv_value = 'CRIT_TESTS'
            ).
          ro_settings->set_run_critical_tests( lv_critical_tests_as_boolean ).
        CATCH lcx_not_found.
          ro_settings->set_run_critical_tests( abap_false ).
      ENDTRY.
    ENDMETHOD.
  
  ENDCLASS.
  
  CLASS ltcl_persistence_settings DEFINITION FINAL FOR TESTING
    DURATION SHORT
    RISK LEVEL DANGEROUS.
  
    PRIVATE SECTION.
      METHODS:
        setup,
        clear_settings_database,
        "Proxy
        modify_settings_proxy_url     FOR TESTING RAISING cx_static_check,
        modify_settings_proxy_port    FOR TESTING RAISING cx_static_check,
        read_proxy_settings           FOR TESTING RAISING cx_static_check,
        read_not_found_url            FOR TESTING RAISING cx_static_check,
        read_not_found_port           FOR TESTING RAISING cx_static_check,
        "Run critical tests
        modify_run_critical_tests     FOR TESTING RAISING cx_static_check,
        read_run_critical_tests       FOR TESTING RAISING cx_static_check,
        read_not_found_critical_tests FOR TESTING RAISING cx_static_check.
      DATA:
        mo_persistence_settings TYPE REF TO lcl_persistence_settings,
        mo_settings             TYPE REF TO lcl_settings.
  