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 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 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_error definition for testing risk level harmless duration short final. private section. methods raise for testing. methods raise_w_location for testing. methods raise_w_node for testing. methods set_location for testing. endclass. class ltcl_error implementation. method raise. data lx type ref to zcx_abapgit_ajson_error. data lv_msg type string. lv_msg = repeat( val = 'a' occ = 50 ) && repeat( val = 'b' occ = 50 ) && '123'. try. zcx_abapgit_ajson_error=>raise( lv_msg ). cl_abap_unit_assert=>fail( ). catch zcx_abapgit_ajson_error into lx. cl_abap_unit_assert=>assert_equals( exp = lv_msg act = lx->get_text( ) ). endtry. endmethod. method raise_w_location. data lx type ref to zcx_abapgit_ajson_error. try. zcx_abapgit_ajson_error=>raise( iv_msg = 'a' iv_location = 'b' ). cl_abap_unit_assert=>fail( ). catch zcx_abapgit_ajson_error into lx. cl_abap_unit_assert=>assert_equals( exp = 'a @b' act = lx->get_text( ) ). endtry. endmethod. method raise_w_node. data lx type ref to zcx_abapgit_ajson_error. data ls_node type zif_abapgit_ajson_types=>ty_node. ls_node-path = '/x/'. ls_node-name = 'y'. try. zcx_abapgit_ajson_error=>raise( iv_msg = 'a' is_node = ls_node ). cl_abap_unit_assert=>fail( ). catch zcx_abapgit_ajson_error into lx. cl_abap_unit_assert=>assert_equals( exp = 'a @/x/y' act = lx->get_text( ) ). endtry. endmethod. method set_location. data lx type ref to zcx_abapgit_ajson_error. try. zcx_abapgit_ajson_error=>raise( iv_msg = 'a' iv_location = 'b' ). cl_abap_unit_assert=>fail( ). catch zcx_abapgit_ajson_error into lx. cl_abap_unit_assert=>assert_equals( exp = lx->location act = 'b' ). lx->set_location( 'c' ). cl_abap_unit_assert=>assert_equals( exp = lx->location act = 'c' ). cl_abap_unit_assert=>assert_equals( exp = 'a @c' act = lx->get_text( ) ). endtry. try. zcx_abapgit_ajson_error=>raise( iv_msg = 'a' ). cl_abap_unit_assert=>fail( ). catch zcx_abapgit_ajson_error into lx. cl_abap_unit_assert=>assert_equals( exp = lx->location act = '' ). lx->set_location( 'c' ). cl_abap_unit_assert=>assert_equals( exp = lx->location act = 'c' ). cl_abap_unit_assert=>assert_equals( exp = 'a @c' act = lx->get_text( ) ). endtry. endmethod. endclass. |