All files / output zcl_abapgit_feature.clas.testclasses.mjs

74.05% Statements 117/158
78.94% Branches 15/19
46.66% Functions 14/30
74.05% Lines 117/158

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 1581x 1x 1x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x         3x       3x       3x           3x               3x         3x 18x 18x 18x 18x 3x       3x       3x       3x       3x       3x 3x 3x 3x 3x 3x 3x 1x 3x 3x 3x 3x 3x 3x 3x 3x 3x 1x 1x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 1x 1x 1x 1x 3x 1x 1x 1x 1x 3x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 3x 1x 1x
const {zcl_abapgit_feature} = await import("./zcl_abapgit_feature.clas.mjs");
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_feature.clas.testclasses.abap
class ltd_environment {
  static STATIC_SUPER = undefined;
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_FEATURE-LTD_ENVIRONMENT';
  static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_ENVIRONMENT"];
  static ATTRIBUTES = {"MV_IS_MERGED": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "}};
  static METHODS = {"SET_IS_MERGED": {"visibility": "U", "parameters": {"IV_IS_MERGED": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " ", "parm_kind": "I", "type_name": "CharacterType"}}}};
  #mv_is_merged;
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "set_is_merged": this.set_is_merged.bind(this),
    };
    this.#mv_is_merged = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    this.FRIENDS_ACCESS_INSTANCE["mv_is_merged"] = this.#mv_is_merged;
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async zif_abapgit_environment$check_parallel_processing(INPUT) {
    let rv_checked = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    let iv_group = INPUT?.iv_group;
    return rv_checked;
  }
  async zif_abapgit_environment$compare_with_inactive() {
    let rv_result = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    return rv_result;
  }
  async zif_abapgit_environment$get_available_user_sessions() {
    let rv_sessions = new abap.types.Integer({qualifiedName: "I"});
    return rv_sessions;
  }
  async zif_abapgit_environment$get_basis_release() {
    let rs_result = new abap.types.Structure({
    "release": new abap.types.Character(10, {"qualifiedName":"zif_abapgit_environment=>ty_release_sp-release"}),
    "sp": new abap.types.Character(10, {"qualifiedName":"zif_abapgit_environment=>ty_release_sp-sp"})}, "zif_abapgit_environment=>ty_release_sp", undefined, {}, {});
    return rs_result;
  }
  async zif_abapgit_environment$get_system_language_filter() {
    let rt_system_language_filter = abap.types.TableFactory.construct(new abap.types.Structure({
    "sign": new abap.types.Character(1, undefined),
    "option": new abap.types.Character(2, undefined),
    "low": new abap.types.Character(1, {"qualifiedName":"SPRAS","ddicName":"SPRAS","description":"SPRAS"}),
    "high": new abap.types.Character(1, {"qualifiedName":"SPRAS","ddicName":"SPRAS","description":"SPRAS"})}, undefined, undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_environment=>ty_system_language_filter");
    return rt_system_language_filter;
  }
  async zif_abapgit_environment$init_parallel_processing(INPUT) {
    let rv_free_work_processes = new abap.types.Integer({qualifiedName: "I"});
    let iv_group = INPUT?.iv_group;
    return rv_free_work_processes;
  }
  async zif_abapgit_environment$is_merged() {
    let rv_result = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    rv_result.set(this.#mv_is_merged);
    return rv_result;
  }
  async zif_abapgit_environment$is_repo_object_changes_allowed() {
    let rv_result = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    return rv_result;
  }
  async zif_abapgit_environment$is_restart_required() {
    let rv_result = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    return rv_result;
  }
  async zif_abapgit_environment$is_sap_cloud_platform() {
    let rv_result = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    return rv_result;
  }
  async zif_abapgit_environment$is_sap_object_allowed() {
    let rv_allowed = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    return rv_allowed;
  }
  async zif_abapgit_environment$is_variant_maintenance() {
    let rv_is_variant_maintenance = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    return rv_is_variant_maintenance;
  }
  async set_is_merged(INPUT) {
    let iv_is_merged = INPUT?.iv_is_merged;
    if (iv_is_merged?.getQualifiedName === undefined || iv_is_merged.getQualifiedName() !== "ABAP_BOOL") { iv_is_merged = undefined; }
    if (iv_is_merged === undefined) { iv_is_merged = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}).set(INPUT.iv_is_merged); }
    this.#mv_is_merged.set(iv_is_merged);
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_FEATURE-LTD_ENVIRONMENT'] = ltd_environment;
class ltcl_feature {
  static STATIC_SUPER = undefined;
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_FEATURE-LTCL_FEATURE';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {"MO_SETTINGS": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_SETTINGS", RTTIName: "\\CLASS=ZCL_ABAPGIT_SETTINGS"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MO_CUT": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_FEATURE", RTTIName: "\\CLASS=ZCL_ABAPGIT_FEATURE"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MO_ENV": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "LTD_ENVIRONMENT", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_FEATURE\\CLASS=LTD_ENVIRONMENT"});}, "visibility": "I", "is_constant": " ", "is_class": " "}};
  static METHODS = {"SETUP": {"visibility": "I", "parameters": {}},
  "MERGED_FEATURE_DISABLED": {"visibility": "I", "parameters": {}},
  "DEV_FEATURE_DISABLED": {"visibility": "I", "parameters": {}},
  "DEV_FEATURE_ENABLED": {"visibility": "I", "parameters": {}}};
  #mo_settings;
  #mo_cut;
  #mo_env;
  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),
      "merged_feature_disabled": this.#merged_feature_disabled.bind(this),
      "dev_feature_disabled": this.#dev_feature_disabled.bind(this),
      "dev_feature_enabled": this.#dev_feature_enabled.bind(this),
    };
    this.#mo_settings = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_SETTINGS", RTTIName: "\\CLASS=ZCL_ABAPGIT_SETTINGS"});
    this.FRIENDS_ACCESS_INSTANCE["mo_settings"] = this.#mo_settings;
    this.#mo_cut = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_FEATURE", RTTIName: "\\CLASS=ZCL_ABAPGIT_FEATURE"});
    this.FRIENDS_ACCESS_INSTANCE["mo_cut"] = this.#mo_cut;
    this.#mo_env = new abap.types.ABAPObject({qualifiedName: "LTD_ENVIRONMENT", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_FEATURE\\CLASS=LTD_ENVIRONMENT"});
    this.FRIENDS_ACCESS_INSTANCE["mo_env"] = this.#mo_env;
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async #setup() {
    this.#mo_cut.set(await (new abap.Classes['ZCL_ABAPGIT_FEATURE']()).constructor_());
    this.#mo_settings.set((await (await abap.Classes['ZCL_ABAPGIT_PERSIST_FACTORY'].get_settings()).get().zif_abapgit_persist_settings$read()));
    this.#mo_env.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_FEATURE-LTD_ENVIRONMENT']()).constructor_());
    await abap.Classes['ZCL_ABAPGIT_INJECTOR'].set_environment({ii_environment: this.#mo_env});
  }
  async #merged_feature_disabled() {
    await this.#mo_env.get().set_is_merged({iv_is_merged: abap.builtin.abap_true});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await this.#mo_cut.get().is_enabled()), exp: abap.builtin.abap_false});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await this.#mo_cut.get().is_enabled({iv_feature: abap.CharacterFactory.get(4, 'TEST')})), exp: abap.builtin.abap_false});
  }
  async #dev_feature_disabled() {
    await this.#mo_env.get().set_is_merged({iv_is_merged: abap.builtin.abap_false});
    await this.#mo_settings.get().set_experimental_features({iv_features: abap.CharacterFactory.get(1, '')});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await this.#mo_cut.get().is_enabled({iv_feature: abap.CharacterFactory.get(4, 'TEST')})), exp: abap.builtin.abap_false});
  }
  async #dev_feature_enabled() {
    await this.#mo_env.get().set_is_merged({iv_is_merged: abap.builtin.abap_false});
    await this.#mo_settings.get().set_experimental_features({iv_features: abap.CharacterFactory.get(1, 'X')});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await this.#mo_cut.get().is_enabled({iv_feature: abap.CharacterFactory.get(4, 'TEST')})), exp: abap.builtin.abap_true});
    await this.#mo_settings.get().set_experimental_features({iv_features: abap.CharacterFactory.get(4, 'TEST')});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await this.#mo_cut.get().is_enabled({iv_feature: abap.CharacterFactory.get(4, 'TEST')})), exp: abap.builtin.abap_true});
    await this.#mo_settings.get().set_experimental_features({iv_features: abap.CharacterFactory.get(7, 'AFF,LXE')});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await this.#mo_cut.get().is_enabled({iv_feature: abap.CharacterFactory.get(4, 'TEST')})), exp: abap.builtin.abap_false});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await this.#mo_cut.get().is_enabled({iv_feature: abap.CharacterFactory.get(3, 'AFF')})), exp: abap.builtin.abap_true});
    await this.#mo_settings.get().set_experimental_features({iv_features: abap.CharacterFactory.get(19, ' AFF , FLOW   ,LXE ')});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await this.#mo_cut.get().is_enabled({iv_feature: abap.CharacterFactory.get(4, 'TEST')})), exp: abap.builtin.abap_false});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await this.#mo_cut.get().is_enabled({iv_feature: abap.CharacterFactory.get(4, 'FLOW')})), exp: abap.builtin.abap_true});
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_FEATURE-LTCL_FEATURE'] = ltcl_feature;
export {ltd_environment, ltcl_feature};