All files / output zcl_abapgit_apack_reader.clas.testclasses.mjs

64% Statements 80/125
72.72% Branches 8/11
77.77% Functions 7/9
64% Lines 80/125

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 1251x 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 1x 1x 1x 1x
const {zcl_abapgit_apack_reader} = await import("./zcl_abapgit_apack_reader.clas.mjs");
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_apack_reader.clas.testclasses.abap
class ltcl_apack_manifest_reader {
  static STATIC_SUPER = undefined;
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_APACK_READER-LTCL_APACK_MANIFEST_READER';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {"MO_MANIFEST_READER": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_APACK_READER", RTTIName: "\\CLASS=ZCL_ABAPGIT_APACK_READER"});}, "visibility": "I", "is_constant": " ", "is_class": " "}};
  static METHODS = {"SETUP": {"visibility": "I", "parameters": {}},
  "MANIFEST_DESCRIPTOR": {"visibility": "I", "parameters": {}},
  "VERIFY_OWN_DESCRIPTOR": {"visibility": "I", "parameters": {"IS_MANIFEST_DESCRIPTOR": {"type": () => {return new abap.types.Structure({
  "group_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DESCRIPTOR_WO_DEPENDENCIES-GROUP_ID"}),
  "artifact_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DESCRIPTOR_WO_DEPENDENCIES-ARTIFACT_ID"}),
  "version": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DESCRIPTOR_WO_DEPENDENCIES-VERSION"}),
  "sem_version": new abap.types.Structure({
  "major": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-MAJOR"}),
  "minor": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-MINOR"}),
  "patch": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PATCH"}),
  "prerelase": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PRERELASE"}),
  "prerelase_patch": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PRERELASE_PATCH"})}, "zif_abapgit_definitions=>ty_version", undefined, {}, {}),
  "repository_type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_REPOSITORY_TYPE"}),
  "git_url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DESCRIPTOR_WO_DEPENDENCIES-GIT_URL"}),
  "dependencies": abap.types.TableFactory.construct(new abap.types.Structure({
  "group_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DEPENDENCY-GROUP_ID"}),
  "artifact_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DEPENDENCY-ARTIFACT_ID"}),
  "version": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DEPENDENCY-VERSION"}),
  "sem_version": new abap.types.Structure({
  "major": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-MAJOR"}),
  "minor": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-MINOR"}),
  "patch": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PATCH"}),
  "prerelase": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PRERELASE"}),
  "prerelase_patch": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PRERELASE_PATCH"})}, "zif_abapgit_definitions=>ty_version", undefined, {}, {}),
  "git_url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DEPENDENCY-GIT_URL"}),
  "target_package": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"})}, "zif_abapgit_apack_definitions=>ty_dependency", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_apack_definitions=>ty_dependencies")}, "zif_abapgit_apack_definitions=>ty_descriptor", undefined, {}, {});}, "is_optional": " ", "parm_kind": "I", "type_name": "StructureType"}}}};
  #mo_manifest_reader;
  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),
      "manifest_descriptor": this.#manifest_descriptor.bind(this),
      "verify_own_descriptor": this.#verify_own_descriptor.bind(this),
    };
    this.#mo_manifest_reader = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_APACK_READER", RTTIName: "\\CLASS=ZCL_ABAPGIT_APACK_READER"});
    this.FRIENDS_ACCESS_INSTANCE["mo_manifest_reader"] = this.#mo_manifest_reader;
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async #manifest_descriptor() {
    await this.#verify_own_descriptor({is_manifest_descriptor: (await this.#mo_manifest_reader.get().get_manifest_descriptor())});
  }
  async #setup() {
    let ls_apack_manifest_descriptor = new abap.types.Structure({
    "group_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DESCRIPTOR_WO_DEPENDENCIES-GROUP_ID"}),
    "artifact_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DESCRIPTOR_WO_DEPENDENCIES-ARTIFACT_ID"}),
    "version": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DESCRIPTOR_WO_DEPENDENCIES-VERSION"}),
    "sem_version": new abap.types.Structure({
    "major": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-MAJOR"}),
    "minor": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-MINOR"}),
    "patch": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PATCH"}),
    "prerelase": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PRERELASE"}),
    "prerelase_patch": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PRERELASE_PATCH"})}, "zif_abapgit_definitions=>ty_version", undefined, {}, {}),
    "repository_type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_REPOSITORY_TYPE"}),
    "git_url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DESCRIPTOR_WO_DEPENDENCIES-GIT_URL"}),
    "dependencies": abap.types.TableFactory.construct(new abap.types.Structure({
    "group_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DEPENDENCY-GROUP_ID"}),
    "artifact_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DEPENDENCY-ARTIFACT_ID"}),
    "version": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DEPENDENCY-VERSION"}),
    "sem_version": new abap.types.Structure({
    "major": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-MAJOR"}),
    "minor": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-MINOR"}),
    "patch": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PATCH"}),
    "prerelase": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PRERELASE"}),
    "prerelase_patch": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PRERELASE_PATCH"})}, "zif_abapgit_definitions=>ty_version", undefined, {}, {}),
    "git_url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DEPENDENCY-GIT_URL"}),
    "target_package": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"})}, "zif_abapgit_apack_definitions=>ty_dependency", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_apack_definitions=>ty_dependencies")}, "zif_abapgit_apack_definitions=>ty_descriptor", undefined, {}, {});
    ls_apack_manifest_descriptor.get().group_id.set(abap.CharacterFactory.get(18, 'github.com/abapGit'));
    ls_apack_manifest_descriptor.get().artifact_id.set(abap.CharacterFactory.get(7, 'abapGit'));
    ls_apack_manifest_descriptor.get().version.set(abap.CharacterFactory.get(4, '1.42'));
    ls_apack_manifest_descriptor.get().git_url.set(abap.CharacterFactory.get(38, 'https://github.com/abapGit/abapGit.git'));
    this.#mo_manifest_reader.set((await abap.Classes['ZCL_ABAPGIT_APACK_READER'].create_instance({iv_package_name: abap.CharacterFactory.get(4, '$TMP')})));
    await this.#mo_manifest_reader.get().set_manifest_descriptor({is_manifest_descriptor: ls_apack_manifest_descriptor});
  }
  async #verify_own_descriptor(INPUT) {
    let is_manifest_descriptor = INPUT?.is_manifest_descriptor;
    if (is_manifest_descriptor?.getQualifiedName === undefined || is_manifest_descriptor.getQualifiedName() !== "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DESCRIPTOR") { is_manifest_descriptor = undefined; }
    if (is_manifest_descriptor === undefined) { is_manifest_descriptor = new abap.types.Structure({
    "group_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DESCRIPTOR_WO_DEPENDENCIES-GROUP_ID"}),
    "artifact_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DESCRIPTOR_WO_DEPENDENCIES-ARTIFACT_ID"}),
    "version": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DESCRIPTOR_WO_DEPENDENCIES-VERSION"}),
    "sem_version": new abap.types.Structure({
    "major": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-MAJOR"}),
    "minor": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-MINOR"}),
    "patch": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PATCH"}),
    "prerelase": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PRERELASE"}),
    "prerelase_patch": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PRERELASE_PATCH"})}, "zif_abapgit_definitions=>ty_version", undefined, {}, {}),
    "repository_type": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_REPOSITORY_TYPE"}),
    "git_url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DESCRIPTOR_WO_DEPENDENCIES-GIT_URL"}),
    "dependencies": abap.types.TableFactory.construct(new abap.types.Structure({
    "group_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DEPENDENCY-GROUP_ID"}),
    "artifact_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DEPENDENCY-ARTIFACT_ID"}),
    "version": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DEPENDENCY-VERSION"}),
    "sem_version": new abap.types.Structure({
    "major": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-MAJOR"}),
    "minor": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-MINOR"}),
    "patch": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PATCH"}),
    "prerelase": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PRERELASE"}),
    "prerelase_patch": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_VERSION-PRERELASE_PATCH"})}, "zif_abapgit_definitions=>ty_version", undefined, {}, {}),
    "git_url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_APACK_DEFINITIONS=>TY_DEPENDENCY-GIT_URL"}),
    "target_package": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"})}, "zif_abapgit_apack_definitions=>ty_dependency", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_apack_definitions=>ty_dependencies")}, "zif_abapgit_apack_definitions=>ty_descriptor", undefined, {}, {}).set(INPUT.is_manifest_descriptor); }
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_not_initial({act: is_manifest_descriptor});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({exp: abap.CharacterFactory.get(18, 'github.com/abapGit'), act: is_manifest_descriptor.get().group_id});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({exp: abap.CharacterFactory.get(7, 'abapGit'), act: is_manifest_descriptor.get().artifact_id});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({exp: abap.CharacterFactory.get(4, '1.42'), act: is_manifest_descriptor.get().version});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_initial({act: is_manifest_descriptor.get().repository_type});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({exp: abap.CharacterFactory.get(38, 'https://github.com/abapGit/abapGit.git'), act: is_manifest_descriptor.get().git_url});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_initial({act: is_manifest_descriptor.get().dependencies});
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_APACK_READER-LTCL_APACK_MANIFEST_READER'] = ltcl_apack_manifest_reader;
export {ltcl_apack_manifest_reader};