All files / output cl_function_test_environment.clas.locals.mjs

20.7% Statements 53/256
83.33% Branches 5/6
16% Functions 4/25
20.7% Lines 53/256

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 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 2561x 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 {cx_root} = await import("./cx_root.clas.mjs");
// cl_function_test_environment.clas.locals_imp.abap
class lcl_input_arguments {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-CL_FUNCTION_TEST_ENVIRONMENT-LCL_INPUT_ARGUMENTS';
  static IMPLEMENTED_INTERFACES = ["IF_FTD_INPUT_ARGUMENTS"];
  static ATTRIBUTES = {"MT_IMPORTING": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
  "value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_input_arguments=>ty_name_value", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");}, "visibility": "U", "is_constant": " ", "is_class": " "},
  "MT_TABLES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
  "value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_input_arguments=>ty_name_value", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");}, "visibility": "U", "is_constant": " ", "is_class": " "}};
  static METHODS = {};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
    };
    this.mt_importing = abap.types.TableFactory.construct(new abap.types.Structure({
    "name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
    "value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_input_arguments=>ty_name_value", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");
    this.mt_tables = abap.types.TableFactory.construct(new abap.types.Structure({
    "name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
    "value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_input_arguments=>ty_name_value", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async if_ftd_input_arguments$get_importing_parameter(INPUT) {
    let result = new abap.types.DataReference(new abap.types.Character(4));
    let name = INPUT?.name;
    if (name?.getQualifiedName === undefined || name.getQualifiedName() !== "ABAP_PARMNAME") { name = undefined; }
    if (name === undefined) { name = new abap.types.Character(30, {"qualifiedName":"abap_parmname"}).set(INPUT.name); }
    let ls_row = new abap.types.Structure({
    "name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
    "value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_input_arguments=>ty_name_value", undefined, {}, {});
    abap.statements.readTable(this.mt_importing,{into: ls_row,
      withKey: (i) => {return abap.compare.eq(i.name, name);},
      withKeyValue: [{key: (i) => {return i.name}, value: name}],
      usesTableLine: false,
      withKeySimple: {"name": name}});
    if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
      const unique1280 = await (new abap.Classes['CX_FTD_PARAMETER_NOT_FOUND']()).constructor_();
      unique1280.EXTRA_CX = {"INTERNAL_FILENAME": "cl_function_test_environment.clas.locals_imp.abap","INTERNAL_LINE": 19};
      throw unique1280;
    }
    result.set(ls_row.get().value);
    return result;
  }
  async if_ftd_input_arguments$get_table_parameter(INPUT) {
    let result = new abap.types.DataReference(new abap.types.Character(4));
    let name = INPUT?.name;
    if (name?.getQualifiedName === undefined || name.getQualifiedName() !== "ABAP_PARMNAME") { name = undefined; }
    if (name === undefined) { name = new abap.types.Character(30, {"qualifiedName":"abap_parmname"}).set(INPUT.name); }
    let ls_row = new abap.types.Structure({
    "name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
    "value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_input_arguments=>ty_name_value", undefined, {}, {});
    abap.statements.readTable(this.mt_tables,{into: ls_row,
      withKey: (i) => {return abap.compare.eq(i.name, name);},
      withKeyValue: [{key: (i) => {return i.name}, value: name}],
      usesTableLine: false,
      withKeySimple: {"name": name}});
    if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
      const unique1281 = await (new abap.Classes['CX_FTD_PARAMETER_NOT_FOUND']()).constructor_();
      unique1281.EXTRA_CX = {"INTERNAL_FILENAME": "cl_function_test_environment.clas.locals_imp.abap","INTERNAL_LINE": 28};
      throw unique1281;
    }
    result.set(ls_row.get().value);
    return result;
  }
}
abap.Classes['CLAS-CL_FUNCTION_TEST_ENVIRONMENT-LCL_INPUT_ARGUMENTS'] = lcl_input_arguments;
lcl_input_arguments.ty_name_value = new abap.types.Structure({
"name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
"value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_input_arguments=>ty_name_value", undefined, {}, {});
class lcl_invocation_result {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-CL_FUNCTION_TEST_ENVIRONMENT-LCL_INVOCATION_RESULT';
  static IMPLEMENTED_INTERFACES = ["IF_FTD_INVOCATION_RESULT","IF_FTD_OUTPUT_CONFIGURATION"];
  static ATTRIBUTES = {"MT_EXPORTING": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
  "value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_invocation_result=>ty_name_value", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");}, "visibility": "U", "is_constant": " ", "is_class": " "},
  "MT_TABLES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
  "value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_invocation_result=>ty_name_value", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");}, "visibility": "U", "is_constant": " ", "is_class": " "}};
  static METHODS = {};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
    };
    this.mt_exporting = abap.types.TableFactory.construct(new abap.types.Structure({
    "name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
    "value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_invocation_result=>ty_name_value", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");
    this.mt_tables = abap.types.TableFactory.construct(new abap.types.Structure({
    "name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
    "value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_invocation_result=>ty_name_value", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async if_ftd_invocation_result$get_output_configuration() {
    let result = new abap.types.ABAPObject({qualifiedName: "IF_FTD_OUTPUT_CONFIGURATION", RTTIName: "\\INTERFACE=IF_FTD_OUTPUT_CONFIGURATION"});
    result.set(this.me);
    return result;
  }
  async if_ftd_output_configuration$set_exporting_parameter(INPUT) {
    let self = new abap.types.ABAPObject({qualifiedName: "IF_FTD_OUTPUT_CONFIGURATION", RTTIName: "\\INTERFACE=IF_FTD_OUTPUT_CONFIGURATION"});
    let name = INPUT?.name;
    if (name?.getQualifiedName === undefined || name.getQualifiedName() !== "ABAP_PARMNAME") { name = undefined; }
    if (name === undefined) { name = new abap.types.Character(30, {"qualifiedName":"abap_parmname"}).set(INPUT.name); }
    let value = INPUT?.value;
    let ls_row = new abap.types.Structure({
    "name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
    "value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_invocation_result=>ty_name_value", undefined, {}, {});
    ls_row.get().name.set(name);
    ls_row.get().value.assign(value);
    abap.statements.insertInternal({data: ls_row, table: this.mt_exporting});
    self.set(this.me);
    return self;
  }
  async if_ftd_output_configuration$set_table_parameter(INPUT) {
    let self = new abap.types.ABAPObject({qualifiedName: "IF_FTD_OUTPUT_CONFIGURATION", RTTIName: "\\INTERFACE=IF_FTD_OUTPUT_CONFIGURATION"});
    let name = INPUT?.name;
    if (name?.getQualifiedName === undefined || name.getQualifiedName() !== "ABAP_PARMNAME") { name = undefined; }
    if (name === undefined) { name = new abap.types.Character(30, {"qualifiedName":"abap_parmname"}).set(INPUT.name); }
    let value = INPUT?.value;
    let ls_row = new abap.types.Structure({
    "name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
    "value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_invocation_result=>ty_name_value", undefined, {}, {});
    ls_row.get().name.set(name);
    ls_row.get().value.assign(value);
    abap.statements.insertInternal({data: ls_row, table: this.mt_tables});
    self.set(this.me);
    return self;
  }
}
abap.Classes['CLAS-CL_FUNCTION_TEST_ENVIRONMENT-LCL_INVOCATION_RESULT'] = lcl_invocation_result;
lcl_invocation_result.ty_name_value = new abap.types.Structure({
"name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
"value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_invocation_result=>ty_name_value", undefined, {}, {});
class lcl_invoker {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-CL_FUNCTION_TEST_ENVIRONMENT-LCL_INVOKER';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {};
  static METHODS = {"INVOKE": {"visibility": "U", "parameters": {"FMINPUT": {"type": () => {return new abap.types.Character(4);}, "is_optional": " "}, "ANSWER": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "IF_FTD_INVOCATION_ANSWER", RTTIName: "\\INTERFACE=IF_FTD_INVOCATION_ANSWER"});}, "is_optional": " "}}}};
  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 invoke(INPUT) {
    return lcl_invoker.invoke(INPUT);
  }
  static async invoke(INPUT) {
    let fminput = INPUT?.fminput;
    let answer = INPUT?.answer;
    if (answer?.getQualifiedName === undefined || answer.getQualifiedName() !== "IF_FTD_INVOCATION_ANSWER") { answer = undefined; }
    if (answer === undefined) { answer = new abap.types.ABAPObject({qualifiedName: "IF_FTD_INVOCATION_ANSWER", RTTIName: "\\INTERFACE=IF_FTD_INVOCATION_ANSWER"}).set(INPUT.answer); }
    let lo_result = new abap.types.ABAPObject({qualifiedName: "LCL_INVOCATION_RESULT", RTTIName: "\\CLASS-POOL=CL_FUNCTION_TEST_ENVIRONMENT\\CLASS=LCL_INVOCATION_RESULT"});
    let li_result = new abap.types.ABAPObject({qualifiedName: "IF_FTD_INVOCATION_RESULT", RTTIName: "\\INTERFACE=IF_FTD_INVOCATION_RESULT"});
    let lo_arguments = new abap.types.ABAPObject({qualifiedName: "LCL_INPUT_ARGUMENTS", RTTIName: "\\CLASS-POOL=CL_FUNCTION_TEST_ENVIRONMENT\\CLASS=LCL_INPUT_ARGUMENTS"});
    let li_arguments = new abap.types.ABAPObject({qualifiedName: "IF_FTD_INPUT_ARGUMENTS", RTTIName: "\\INTERFACE=IF_FTD_INPUT_ARGUMENTS"});
    let ls_exporting = new abap.types.Structure({
    "name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
    "value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_invocation_result=>ty_name_value", undefined, {}, {});
    let ls_importing = new abap.types.Structure({
    "name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
    "value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_input_arguments=>ty_name_value", undefined, {}, {});
    let ls_table = new abap.types.Structure({
    "name": new abap.types.Character(30, {"qualifiedName":"abap_parmname"}),
    "value": new abap.types.DataReference(new abap.types.Character(4))}, "lcl_input_arguments=>ty_name_value", undefined, {}, {});
    lo_result.set(await (new abap.Classes['CLAS-CL_FUNCTION_TEST_ENVIRONMENT-LCL_INVOCATION_RESULT']()).constructor_());
    li_result.set(lo_result);
    lo_arguments.set(await (new abap.Classes['CLAS-CL_FUNCTION_TEST_ENVIRONMENT-LCL_INPUT_ARGUMENTS']()).constructor_());
    li_arguments.set(lo_arguments);
    for (const importing in fminput?.exporting || []) {
        ls_importing.get().name.set(importing.toUpperCase());
        ls_importing.get().value.pointer = fminput.exporting[importing];
      abap.statements.insertInternal({data: ls_importing, table: lo_arguments.get().mt_importing});
    }
    for (const table in fminput?.tables || []) {
        ls_table.get().name.set(table.toUpperCase());
        ls_table.get().value.pointer = fminput.tables[table];
      abap.statements.insertInternal({data: ls_table, table: lo_arguments.get().mt_tables});
    }
    await answer.get().if_ftd_invocation_answer$answer({arguments: li_arguments, result: li_result});
    for await (const unique1282 of abap.statements.loop(lo_result.get().mt_exporting)) {
      ls_exporting.set(unique1282);
      fminput.importing[ls_exporting.get().name.get().toLowerCase().trimEnd()].set(ls_exporting.get().value.dereference());
    }
    for await (const unique1283 of abap.statements.loop(lo_result.get().mt_tables)) {
      ls_table.set(unique1283);
      fminput.tables[ls_table.get().name.get().toLowerCase().trimEnd()].set(ls_table.get().value.dereference());
    }
  }
}
abap.Classes['CLAS-CL_FUNCTION_TEST_ENVIRONMENT-LCL_INVOKER'] = lcl_invoker;
class lcl_double {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-CL_FUNCTION_TEST_ENVIRONMENT-LCL_DOUBLE';
  static IMPLEMENTED_INTERFACES = ["IF_FUNCTION_TESTDOUBLE","IF_FTD_INPUT_CONFIG_SETTER","IF_FTD_OUTPUT_CONFIG_SETTER"];
  static ATTRIBUTES = {"MV_NAME": {"type": () => {return new abap.types.Character(30, {"qualifiedName":"SXCO_FM_NAME","ddicName":"SXCO_FM_NAME","description":"Function module name"});}, "visibility": "I", "is_constant": " ", "is_class": " "}};
  static METHODS = {"CONSTRUCTOR": {"visibility": "U", "parameters": {"IV_NAME": {"type": () => {return new abap.types.Character(30, {"qualifiedName":"SXCO_FM_NAME","ddicName":"SXCO_FM_NAME","description":"Function module name"});}, "is_optional": " "}}}};
  #mv_name;
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
    };
    this.#mv_name = new abap.types.Character(30, {"qualifiedName":"SXCO_FM_NAME","ddicName":"SXCO_FM_NAME","description":"Function module name"});
    this.FRIENDS_ACCESS_INSTANCE["mv_name"] = this.#mv_name;
  }
  async constructor_(INPUT) {
    let iv_name = INPUT?.iv_name;
    if (iv_name?.getQualifiedName === undefined || iv_name.getQualifiedName() !== "SXCO_FM_NAME") { iv_name = undefined; }
    if (iv_name === undefined) { iv_name = new abap.types.Character(30, {"qualifiedName":"SXCO_FM_NAME","ddicName":"SXCO_FM_NAME","description":"Function module name"}).set(INPUT.iv_name); }
    abap.statements.assert(abap.compare.initial(iv_name) === false);
    this.#mv_name.set(iv_name);
    return this;
  }
  async if_function_testdouble$configure_call() {
    let input_configuration_setter = new abap.types.ABAPObject({qualifiedName: "IF_FTD_INPUT_CONFIG_SETTER", RTTIName: "\\INTERFACE=IF_FTD_INPUT_CONFIG_SETTER"});
    input_configuration_setter.set(this.me);
    return input_configuration_setter;
  }
  async if_ftd_input_config_setter$ignore_all_parameters() {
    let output_configuration_setter = new abap.types.ABAPObject({qualifiedName: "IF_FTD_OUTPUT_CONFIG_SETTER", RTTIName: "\\INTERFACE=IF_FTD_OUTPUT_CONFIG_SETTER"});
    output_configuration_setter.set(this.me);
    return output_configuration_setter;
  }
  async if_ftd_output_config_setter$then_answer(INPUT) {
    let self = new abap.types.ABAPObject({qualifiedName: "IF_FTD_OUTPUT_CONFIG_SETTER", RTTIName: "\\INTERFACE=IF_FTD_OUTPUT_CONFIG_SETTER"});
    let answer = INPUT?.answer;
    if (answer?.getQualifiedName === undefined || answer.getQualifiedName() !== "IF_FTD_INVOCATION_ANSWER") { answer = undefined; }
    if (answer === undefined) { answer = new abap.types.ABAPObject({qualifiedName: "IF_FTD_INVOCATION_ANSWER", RTTIName: "\\INTERFACE=IF_FTD_INVOCATION_ANSWER"}).set(INPUT.answer); }
    let name = new abap.types.Character(30, {"qualifiedName":"SXCO_FM_NAME","ddicName":"SXCO_FM_NAME","description":"Function module name"});
    name.set(this.#mv_name);
    abap.FunctionModules[name.get().trimEnd()] = (INPUT) => lcl_invoker.invoke({fminput: INPUT, answer});
    return self;
  }
}
abap.Classes['CLAS-CL_FUNCTION_TEST_ENVIRONMENT-LCL_DOUBLE'] = lcl_double;
export {lcl_input_arguments, lcl_invocation_result, lcl_invoker, lcl_double};