All files / output zcl_abapgit_injector.clas.testclasses.mjs

24.06% Statements 45/187
100% Branches 4/4
16.66% Functions 3/18
24.06% Lines 45/187

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 1871x 1x 1x 1x 1x 1x 1x 1x 1x 1x             1x       1x                     1x                                                                                   1x                                         1x           1x                                 1x 1x 1x 1x 1x 1x 1x 1x 1x               1x       1x             1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x                   1x       1x         1x       1x             1x 1x 1x
const {zcl_abapgit_injector} = await import("./zcl_abapgit_injector.clas.mjs");
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_injector.clas.testclasses.abap
class ltcl_abapgit_tadir_mock {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_INJECTOR-LTCL_ABAPGIT_TADIR_MOCK';
  static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_TADIR"];
  static ATTRIBUTES = {};
  static METHODS = {};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async zif_abapgit_tadir$get_object_package(INPUT) {
    let rv_devclass = new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"});
    let iv_pgmid = new abap.types.Character(4, {});
    if (INPUT && INPUT.iv_pgmid) {iv_pgmid.set(INPUT.iv_pgmid);}
    if (INPUT === undefined || INPUT.iv_pgmid === undefined) {iv_pgmid = abap.CharacterFactory.get(4, 'R3TR');}
    let iv_object = INPUT?.iv_object;
    if (iv_object === undefined) { iv_object = new abap.types.Character(4, {}).set(INPUT.iv_object); }
    let iv_obj_name = INPUT?.iv_obj_name;
    if (iv_obj_name === undefined) { iv_obj_name = new abap.types.Character(40, {}).set(INPUT.iv_obj_name); }
    return rv_devclass;
  }
  async zif_abapgit_tadir$read(INPUT) {
    let rt_tadir = abap.types.TableFactory.construct(new abap.types.Structure({
    "pgmid": new abap.types.Character(4, {}),
    "object": new abap.types.Character(4, {}),
    "obj_name": new abap.types.Character(40, {}),
    "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}),
    "korrnum": new abap.types.Character(10, {}),
    "delflag": new abap.types.Character(1, {}),
    "genflag": new abap.types.Character(1, {}),
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_TADIR-PATH"}),
    "srcsystem": new abap.types.Character(5, {}),
    "masterlang": new abap.types.Character(1, {})}, "zif_abapgit_definitions=>ty_tadir", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_tadir_tt");
    let iv_package = INPUT?.iv_package;
    if (iv_package?.getQualifiedName === undefined || iv_package.getQualifiedName() !== "DEVCLASS") { iv_package = undefined; }
    if (iv_package === undefined) { iv_package = new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}).set(INPUT.iv_package); }
    let iv_ignore_subpackages = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    if (INPUT && INPUT.iv_ignore_subpackages) {iv_ignore_subpackages.set(INPUT.iv_ignore_subpackages);}
    if (INPUT === undefined || INPUT.iv_ignore_subpackages === undefined) {iv_ignore_subpackages = abap.builtin.abap_false;}
    let iv_only_local_objects = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    if (INPUT && INPUT.iv_only_local_objects) {iv_only_local_objects.set(INPUT.iv_only_local_objects);}
    if (INPUT === undefined || INPUT.iv_only_local_objects === undefined) {iv_only_local_objects = abap.builtin.abap_false;}
    let io_dot = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_DOT_ABAPGIT", RTTIName: "\\CLASS=ZCL_ABAPGIT_DOT_ABAPGIT"});
    if (INPUT && INPUT.io_dot) {io_dot.set(INPUT.io_dot);}
    let ii_log = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_LOG", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_LOG"});
    if (INPUT && INPUT.ii_log) {ii_log.set(INPUT.ii_log);}
    let it_filter = abap.types.TableFactory.construct(new abap.types.Structure({
    "pgmid": new abap.types.Character(4, {}),
    "object": new abap.types.Character(4, {}),
    "obj_name": new abap.types.Character(40, {}),
    "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}),
    "korrnum": new abap.types.Character(10, {}),
    "delflag": new abap.types.Character(1, {}),
    "genflag": new abap.types.Character(1, {}),
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_TADIR-PATH"}),
    "srcsystem": new abap.types.Character(5, {}),
    "masterlang": new abap.types.Character(1, {})}, "zif_abapgit_definitions=>ty_tadir", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_tadir_tt");
    if (INPUT && INPUT.it_filter) {it_filter.set(INPUT.it_filter);}
    let iv_check_exists = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    if (INPUT && INPUT.iv_check_exists) {iv_check_exists.set(INPUT.iv_check_exists);}
    if (INPUT === undefined || INPUT.iv_check_exists === undefined) {iv_check_exists = abap.builtin.abap_true;}
    return rt_tadir;
  }
  async zif_abapgit_tadir$read_single(INPUT) {
    let rs_tadir = new abap.types.Structure({
    "pgmid": new abap.types.Character(4, {}),
    "object": new abap.types.Character(4, {}),
    "obj_name": new abap.types.Character(40, {}),
    "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}),
    "korrnum": new abap.types.Character(10, {}),
    "delflag": new abap.types.Character(1, {}),
    "genflag": new abap.types.Character(1, {}),
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_TADIR-PATH"}),
    "srcsystem": new abap.types.Character(5, {}),
    "masterlang": new abap.types.Character(1, {})}, "zif_abapgit_definitions=>ty_tadir", undefined, {}, {});
    let iv_pgmid = new abap.types.Character(4, {});
    if (INPUT && INPUT.iv_pgmid) {iv_pgmid.set(INPUT.iv_pgmid);}
    if (INPUT === undefined || INPUT.iv_pgmid === undefined) {iv_pgmid = abap.CharacterFactory.get(4, 'R3TR');}
    let iv_object = INPUT?.iv_object;
    if (iv_object === undefined) { iv_object = new abap.types.Character(4, {}).set(INPUT.iv_object); }
    let iv_obj_name = INPUT?.iv_obj_name;
    if (iv_obj_name === undefined) { iv_obj_name = new abap.types.Character(40, {}).set(INPUT.iv_obj_name); }
    return rs_tadir;
  }
  async zif_abapgit_tadir$delete_single(INPUT) {
    let iv_pgmid = INPUT?.iv_pgmid || new abap.types.Character();
    if (INPUT === undefined || INPUT.iv_pgmid === undefined) {iv_pgmid = abap.CharacterFactory.get(4, 'R3TR');}
    let iv_object = INPUT?.iv_object;
    let iv_obj_name = INPUT?.iv_obj_name;
  }
  async zif_abapgit_tadir$insert_single(INPUT) {
    let iv_pgmid = INPUT?.iv_pgmid || new abap.types.Character();
    if (INPUT === undefined || INPUT.iv_pgmid === undefined) {iv_pgmid = abap.CharacterFactory.get(4, 'R3TR');}
    let iv_object = INPUT?.iv_object;
    let iv_obj_name = INPUT?.iv_obj_name;
    let iv_package = INPUT?.iv_package || new abap.types.Character();
    let iv_language = new abap.types.Character(1, {});
    if (INPUT && INPUT.iv_language) {iv_language.set(INPUT.iv_language);}
    let iv_srcsystem = new abap.types.Character(5, {});
    if (INPUT && INPUT.iv_srcsystem) {iv_srcsystem.set(INPUT.iv_srcsystem);}
    let iv_set_genflag = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    if (INPUT && INPUT.iv_set_genflag) {iv_set_genflag.set(INPUT.iv_set_genflag);}
    if (INPUT === undefined || INPUT.iv_set_genflag === undefined) {iv_set_genflag = abap.builtin.abap_false;}
    let iv_set_edtflag = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    if (INPUT && INPUT.iv_set_edtflag) {iv_set_edtflag.set(INPUT.iv_set_edtflag);}
    if (INPUT === undefined || INPUT.iv_set_edtflag === undefined) {iv_set_edtflag = abap.builtin.abap_false;}
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_INJECTOR-LTCL_ABAPGIT_TADIR_MOCK'] = ltcl_abapgit_tadir_mock;
class ltcl_no_dependency_injection {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_INJECTOR-LTCL_NO_DEPENDENCY_INJECTION';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {};
  static METHODS = {"NO_INJECTION": {"visibility": "I", "parameters": {}}};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "no_injection": this.#no_injection.bind(this),
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async #no_injection() {
    let li_tadir = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_TADIR", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_TADIR"});
    let lo_class_descr = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_CLASSDESCR", RTTIName: "\\CLASS=CL_ABAP_CLASSDESCR"});
    li_tadir.set((await abap.Classes['ZCL_ABAPGIT_FACTORY'].get_tadir()));
    await abap.statements.cast(lo_class_descr, (await abap.Classes['CL_ABAP_CLASSDESCR'].describe_by_object_ref({p_object_ref: li_tadir})));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({exp: abap.CharacterFactory.get(24, '\\CLASS=ZCL_ABAPGIT_TADIR'), act: lo_class_descr.get().absolute_name});
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_INJECTOR-LTCL_NO_DEPENDENCY_INJECTION'] = ltcl_no_dependency_injection;
class ltcl_simple_dependency_inject {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_INJECTOR-LTCL_SIMPLE_DEPENDENCY_INJECT';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {};
  static METHODS = {"SETUP": {"visibility": "I", "parameters": {}},
  "TEARDOWN": {"visibility": "I", "parameters": {}},
  "SIMPLE_INJECTION": {"visibility": "I", "parameters": {}}};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "setup": this.#setup.bind(this),
      "teardown": this.#teardown.bind(this),
      "simple_injection": this.#simple_injection.bind(this),
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async #setup() {
    let lo_tadir_mock = new abap.types.ABAPObject({qualifiedName: "LTCL_ABAPGIT_TADIR_MOCK", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_INJECTOR\\CLASS=LTCL_ABAPGIT_TADIR_MOCK"});
    lo_tadir_mock.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_INJECTOR-LTCL_ABAPGIT_TADIR_MOCK']()).constructor_());
    await abap.Classes['ZCL_ABAPGIT_INJECTOR'].set_tadir({ii_tadir: lo_tadir_mock});
  }
  async #teardown() {
    let li_tadir = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_TADIR", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_TADIR"});
    await abap.Classes['ZCL_ABAPGIT_INJECTOR'].set_tadir({ii_tadir: li_tadir});
  }
  async #simple_injection() {
    let li_tadir = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_TADIR", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_TADIR"});
    let lo_class_descr = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_CLASSDESCR", RTTIName: "\\CLASS=CL_ABAP_CLASSDESCR"});
    li_tadir.set((await abap.Classes['ZCL_ABAPGIT_FACTORY'].get_tadir()));
    await abap.statements.cast(lo_class_descr, (await abap.Classes['CL_ABAP_CLASSDESCR'].describe_by_object_ref({p_object_ref: li_tadir})));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({exp: abap.CharacterFactory.get(62, '\\CLASS-POOL=ZCL_ABAPGIT_INJECTOR\\CLASS=LTCL_ABAPGIT_TADIR_MOCK'), act: lo_class_descr.get().absolute_name});
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_INJECTOR-LTCL_SIMPLE_DEPENDENCY_INJECT'] = ltcl_simple_dependency_inject;
export {ltcl_abapgit_tadir_mock, ltcl_no_dependency_injection, ltcl_simple_dependency_inject};