All files / output zcl_abapgit_item_graph.clas.testclasses.mjs

100% Statements 76/76
83.33% Branches 5/6
100% Functions 4/4
100% Lines 76/76

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 761x 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
const {zcl_abapgit_item_graph} = await import("./zcl_abapgit_item_graph.clas.mjs");
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_item_graph.clas.testclasses.abap
class ltcl_test {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_ITEM_GRAPH-LTCL_TEST';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {};
  static METHODS = {"BASIC": {"visibility": "I", "parameters": {}}};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "basic": this.#basic.bind(this),
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async #basic() {
    let lo_graph = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_ITEM_GRAPH", RTTIName: "\\CLASS=ZCL_ABAPGIT_ITEM_GRAPH"});
    let li_log = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_LOG", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_LOG"});
    let lt_items = abap.types.TableFactory.construct(new abap.types.Structure({
    "obj_type": new abap.types.Character(4, {}),
    "obj_name": new abap.types.Character(40, {}),
    "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}),
    "srcsystem": new abap.types.Character(5, {}),
    "origlang": new abap.types.Character(1, {}),
    "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_items_tt");
    let ls_item1 = new abap.types.Structure({
    "obj_type": new abap.types.Character(4, {}),
    "obj_name": new abap.types.Character(40, {}),
    "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}),
    "srcsystem": new abap.types.Character(5, {}),
    "origlang": new abap.types.Character(1, {}),
    "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {});
    let ls_item2 = new abap.types.Structure({
    "obj_type": new abap.types.Character(4, {}),
    "obj_name": new abap.types.Character(40, {}),
    "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}),
    "srcsystem": new abap.types.Character(5, {}),
    "origlang": new abap.types.Character(1, {}),
    "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {});
    let ls_next = new abap.types.Structure({
    "obj_type": new abap.types.Character(4, {}),
    "obj_name": new abap.types.Character(40, {}),
    "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}),
    "srcsystem": new abap.types.Character(5, {}),
    "origlang": new abap.types.Character(1, {}),
    "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {});
    li_log.set(await (new abap.Classes['ZCL_ABAPGIT_LOG']()).constructor_());
    ls_item1.get().obj_type.set(abap.CharacterFactory.get(4, 'TYPE'));
    ls_item1.get().obj_type.set(abap.CharacterFactory.get(4, '1111'));
    abap.statements.append({source: ls_item1, target: lt_items});
    ls_item2.get().obj_type.set(abap.CharacterFactory.get(4, 'TYPE'));
    ls_item2.get().obj_type.set(abap.CharacterFactory.get(4, '2222'));
    abap.statements.append({source: ls_item2, target: lt_items});
    lo_graph.set(await (new abap.Classes['ZCL_ABAPGIT_ITEM_GRAPH']()).constructor_({it_items: lt_items}));
    await lo_graph.get().add_edge({is_from: ls_item1, is_to: ls_item2});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await lo_graph.get().has_vertices()), exp: abap.builtin.abap_true});
    ls_next.set((await lo_graph.get().get_next({ii_log: li_log})));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: ls_next.get().obj_name, exp: ls_item1.get().obj_name});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await lo_graph.get().has_vertices()), exp: abap.builtin.abap_true});
    ls_next.set((await lo_graph.get().get_next({ii_log: li_log})));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: ls_next.get().obj_name, exp: ls_item2.get().obj_name});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await lo_graph.get().has_vertices()), exp: abap.builtin.abap_false});
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_ITEM_GRAPH-LTCL_TEST'] = ltcl_test;
export {ltcl_test};