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 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 1x 4x 4x 4x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 4x 4x 4x 4x 4x 4x 4x 4x 1x 1x 1x 1x 1x 1x 1x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 1x 1x 1x 1x 4x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 4x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 4x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 4x 4x 4x 4x 3x 3x 4x 1x 1x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 1x 1x | const {zcl_abapgit_gui_page_diff_base} = await import("./zcl_abapgit_gui_page_diff_base.clas.mjs"); const {zcl_abapgit_gui_page_patch} = await import("./zcl_abapgit_gui_page_patch.clas.mjs"); const {cx_root} = await import("./cx_root.clas.mjs"); // zcl_abapgit_gui_page_patch.clas.testclasses.abap class ltcl_get_patch_data { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_GUI_PAGE_PATCH-LTCL_GET_PATCH_DATA'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {}; static METHODS = {"GET_PATCH_DATA_ADD": {"visibility": "I", "parameters": {}}, "GET_PATCH_DATA_REMOVE": {"visibility": "I", "parameters": {}}, "INVALID_PATCH_MISSING_FILE": {"visibility": "I", "parameters": {}}, "INVALID_PATCH_MISSING_INDEX": {"visibility": "I", "parameters": {}}}; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "get_patch_data_add": this.#get_patch_data_add.bind(this), "get_patch_data_remove": this.#get_patch_data_remove.bind(this), "invalid_patch_missing_file": this.#invalid_patch_missing_file.bind(this), "invalid_patch_missing_index": this.#invalid_patch_missing_index.bind(this), }; } async constructor_(INPUT) { if (super.constructor_) { await super.constructor_(INPUT); } return this; } async #get_patch_data_add() { let lv_file_name = new abap.types.String({qualifiedName: "STRING"}); let lv_line_index = new abap.types.String({qualifiedName: "STRING"}); await abap.Classes['ZCL_ABAPGIT_GUI_PAGE_PATCH'].get_patch_data({iv_patch: new abap.types.String().set(`patch_line_zcl_test_git_add_p.clas.abap_0_19`), ev_filename: lv_file_name, ev_line_index: lv_line_index}); await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({exp: new abap.types.String().set(`zcl_test_git_add_p.clas.abap`), act: lv_file_name}); await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({exp: new abap.types.String().set(`19`), act: lv_line_index}); } async #get_patch_data_remove() { let lv_file_name = new abap.types.String({qualifiedName: "STRING"}); let lv_line_index = new abap.types.String({qualifiedName: "STRING"}); await abap.Classes['ZCL_ABAPGIT_GUI_PAGE_PATCH'].get_patch_data({iv_patch: new abap.types.String().set(`patch_line_ztest_patch.prog.abap_0_39`), ev_filename: lv_file_name, ev_line_index: lv_line_index}); await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({exp: new abap.types.String().set(`ztest_patch.prog.abap`), act: lv_file_name}); await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({exp: new abap.types.String().set(`39`), act: lv_line_index}); } async #invalid_patch_missing_file() { let lv_file_name = new abap.types.String({qualifiedName: "STRING"}); let lv_line_index = new abap.types.String({qualifiedName: "STRING"}); let lx_error = new abap.types.ABAPObject({qualifiedName: "ZCX_ABAPGIT_EXCEPTION", RTTIName: "\\CLASS=ZCX_ABAPGIT_EXCEPTION"}); try { await abap.Classes['ZCL_ABAPGIT_GUI_PAGE_PATCH'].get_patch_data({iv_patch: new abap.types.String().set(`patch_39`), ev_filename: lv_file_name, ev_line_index: lv_line_index}); await abap.Classes['CL_ABAP_UNIT_ASSERT'].fail(); } catch (e) { if ((abap.Classes['ZCX_ABAPGIT_EXCEPTION'] && e instanceof abap.Classes['ZCX_ABAPGIT_EXCEPTION'])) { lx_error.set(e); await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({exp: new abap.types.String().set(`Invalid patch`), act: (await lx_error.get().if_message$get_text())}); } else { throw e; } } } async #invalid_patch_missing_index() { let lv_file_name = new abap.types.String({qualifiedName: "STRING"}); let lv_line_index = new abap.types.String({qualifiedName: "STRING"}); let lx_error = new abap.types.ABAPObject({qualifiedName: "ZCX_ABAPGIT_EXCEPTION", RTTIName: "\\CLASS=ZCX_ABAPGIT_EXCEPTION"}); try { await abap.Classes['ZCL_ABAPGIT_GUI_PAGE_PATCH'].get_patch_data({iv_patch: new abap.types.String().set(`patch_ztest_patch.prog.abap`), ev_filename: lv_file_name, ev_line_index: lv_line_index}); await abap.Classes['CL_ABAP_UNIT_ASSERT'].fail(); } catch (e) { if ((abap.Classes['ZCX_ABAPGIT_EXCEPTION'] && e instanceof abap.Classes['ZCX_ABAPGIT_EXCEPTION'])) { lx_error.set(e); await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({exp: new abap.types.String().set(`Invalid patch`), act: (await lx_error.get().if_message$get_text())}); } else { throw e; } } } } abap.Classes['CLAS-ZCL_ABAPGIT_GUI_PAGE_PATCH-LTCL_GET_PATCH_DATA'] = ltcl_get_patch_data; class ltcl_is_patch_line_possible { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_GUI_PAGE_PATCH-LTCL_IS_PATCH_LINE_POSSIBLE'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {"MV_IS_PATCH_LINE_POSSIBLE": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MS_DIFF_LINE": {"type": () => {return new abap.types.Structure({ "patch_flag": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "new_num": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-new_num"}), "new": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-NEW"}), "result": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-result"}), "old_num": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-old_num"}), "old": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-OLD"}), "short": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "beacon": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-BEACON"})}, "zif_abapgit_definitions=>ty_diff", undefined, {}, {});}, "visibility": "I", "is_constant": " ", "is_class": " "}}; static METHODS = {"INITIAL_DIFF_LINE": {"visibility": "I", "parameters": {}}, "FOR_UPDATE_PATCH_SHD_BE_POSSBL": {"visibility": "I", "parameters": {}}, "FOR_INSERT_PATCH_SHD_BE_POSSBL": {"visibility": "I", "parameters": {}}, "FOR_DELETE_PATCH_SHD_BE_POSSBL": {"visibility": "I", "parameters": {}}, "GIVEN_DIFF_LINE": {"visibility": "I", "parameters": {"IS_DIFF_LINE": {"type": () => {return new abap.types.Structure({ "patch_flag": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "new_num": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-new_num"}), "new": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-NEW"}), "result": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-result"}), "old_num": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-old_num"}), "old": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-OLD"}), "short": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "beacon": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-BEACON"})}, "zif_abapgit_definitions=>ty_diff", undefined, {}, {});}, "is_optional": " "}}}, "WHEN_IS_PATCH_LINE_POSSIBLE": {"visibility": "I", "parameters": {}}, "THEN_PATCH_SHD_BE_POSSIBLE": {"visibility": "I", "parameters": {}}, "THEN_PATCH_SHD_NOT_BE_POSSIBLE": {"visibility": "I", "parameters": {}}}; #mv_is_patch_line_possible; #ms_diff_line; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "initial_diff_line": this.#initial_diff_line.bind(this), "for_update_patch_shd_be_possbl": this.#for_update_patch_shd_be_possbl.bind(this), "for_insert_patch_shd_be_possbl": this.#for_insert_patch_shd_be_possbl.bind(this), "for_delete_patch_shd_be_possbl": this.#for_delete_patch_shd_be_possbl.bind(this), "given_diff_line": this.#given_diff_line.bind(this), "when_is_patch_line_possible": this.#when_is_patch_line_possible.bind(this), "then_patch_shd_be_possible": this.#then_patch_shd_be_possible.bind(this), "then_patch_shd_not_be_possible": this.#then_patch_shd_not_be_possible.bind(this), }; this.#mv_is_patch_line_possible = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); this.FRIENDS_ACCESS_INSTANCE["mv_is_patch_line_possible"] = this.#mv_is_patch_line_possible; this.#ms_diff_line = new abap.types.Structure({ "patch_flag": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "new_num": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-new_num"}), "new": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-NEW"}), "result": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-result"}), "old_num": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-old_num"}), "old": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-OLD"}), "short": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "beacon": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-BEACON"})}, "zif_abapgit_definitions=>ty_diff", undefined, {}, {}); this.FRIENDS_ACCESS_INSTANCE["ms_diff_line"] = this.#ms_diff_line; } async constructor_(INPUT) { if (super.constructor_) { await super.constructor_(INPUT); } return this; } async #initial_diff_line() { await this.#given_diff_line(); await this.#when_is_patch_line_possible(); await this.#then_patch_shd_not_be_possible(); } async #for_update_patch_shd_be_possbl() { let ls_diff_line = new abap.types.Structure({ "patch_flag": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "new_num": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-new_num"}), "new": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-NEW"}), "result": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-result"}), "old_num": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-old_num"}), "old": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-OLD"}), "short": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "beacon": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-BEACON"})}, "zif_abapgit_definitions=>ty_diff", undefined, {}, {}); ls_diff_line.get().result.set(abap.Classes['ZIF_ABAPGIT_DEFINITIONS'].zif_abapgit_definitions$c_diff.get().update); await this.#given_diff_line({is_diff_line: ls_diff_line}); await this.#when_is_patch_line_possible(); await this.#then_patch_shd_be_possible(); } async #for_insert_patch_shd_be_possbl() { let ls_diff_line = new abap.types.Structure({ "patch_flag": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "new_num": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-new_num"}), "new": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-NEW"}), "result": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-result"}), "old_num": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-old_num"}), "old": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-OLD"}), "short": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "beacon": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-BEACON"})}, "zif_abapgit_definitions=>ty_diff", undefined, {}, {}); ls_diff_line.get().result.set(abap.Classes['ZIF_ABAPGIT_DEFINITIONS'].zif_abapgit_definitions$c_diff.get().insert); await this.#given_diff_line({is_diff_line: ls_diff_line}); await this.#when_is_patch_line_possible(); await this.#then_patch_shd_be_possible(); } async #for_delete_patch_shd_be_possbl() { let ls_diff_line = new abap.types.Structure({ "patch_flag": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "new_num": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-new_num"}), "new": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-NEW"}), "result": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-result"}), "old_num": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-old_num"}), "old": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-OLD"}), "short": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "beacon": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-BEACON"})}, "zif_abapgit_definitions=>ty_diff", undefined, {}, {}); ls_diff_line.get().result.set(abap.Classes['ZIF_ABAPGIT_DEFINITIONS'].zif_abapgit_definitions$c_diff.get().delete); await this.#given_diff_line({is_diff_line: ls_diff_line}); await this.#when_is_patch_line_possible(); await this.#then_patch_shd_be_possible(); } async #when_is_patch_line_possible() { this.#mv_is_patch_line_possible.set((await abap.Classes['ZCL_ABAPGIT_GUI_PAGE_PATCH'].is_patch_line_possible({is_diff_line: this.#ms_diff_line}))); } async #then_patch_shd_be_possible() { await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_not_initial({act: this.#mv_is_patch_line_possible, msg: new abap.types.String().set(`Patch should be possible`)}); } async #then_patch_shd_not_be_possible() { await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_initial({act: this.#mv_is_patch_line_possible, msg: new abap.types.String().set(`Patch should not be possible`)}); } async #given_diff_line(INPUT) { let is_diff_line = new abap.types.Structure({ "patch_flag": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "new_num": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-new_num"}), "new": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-NEW"}), "result": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-result"}), "old_num": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_definitions=>ty_diff-old_num"}), "old": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-OLD"}), "short": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "beacon": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_DIFF-BEACON"})}, "zif_abapgit_definitions=>ty_diff", undefined, {}, {}); if (INPUT && INPUT.is_diff_line) {is_diff_line.set(INPUT.is_diff_line);} this.#ms_diff_line.set(is_diff_line); } } abap.Classes['CLAS-ZCL_ABAPGIT_GUI_PAGE_PATCH-LTCL_IS_PATCH_LINE_POSSIBLE'] = ltcl_is_patch_line_possible; export {ltcl_get_patch_data, ltcl_is_patch_line_possible}; |