mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 18:06:45 +00:00
Resolve Merge Conflicts
This commit is contained in:
commit
d3a91fa39c
17 changed files with 93197 additions and 4417 deletions
|
@ -481,6 +481,54 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"11.0.23.20.9" : {
|
||||
"alpine-linux" : {
|
||||
"x64" : {
|
||||
"Extended" : {
|
||||
"sha256" : "9d61fefb4f1a8368f8e7eec17893934b438b67f360cb8b7ef727ab459695d14e",
|
||||
"name" : "Alibaba_Dragonwell_Extended_11.0.23.20.9_x64_alpine-linux.tar.gz",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell11/releases/download/dragonwell-extended-11.0.23.20_jdk-11.0.23-ga/Alibaba_Dragonwell_Extended_11.0.23.20.9_x64_alpine-linux.tar.gz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"linux" : {
|
||||
"aarch64" : {
|
||||
"Extended" : {
|
||||
"sha256" : "2f399231644fe1e3f1b4b5298e85f21f4863017767e9e5afb00ee46e2d7780d9",
|
||||
"name" : "Alibaba_Dragonwell_Extended_11.0.23.20.9_aarch64_linux.tar.gz",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell11/releases/download/dragonwell-extended-11.0.23.20_jdk-11.0.23-ga/Alibaba_Dragonwell_Extended_11.0.23.20.9_aarch64_linux.tar.gz"
|
||||
}
|
||||
},
|
||||
"x64" : {
|
||||
"Extended" : {
|
||||
"sha256" : "662dfdc584e21bcfb7ed87942b5bb4e71a7b7467d4c82211a3615d0834d1c833",
|
||||
"name" : "Alibaba_Dragonwell_Extended_11.0.23.20.9_x64_linux.tar.gz",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell11/releases/download/dragonwell-extended-11.0.23.20_jdk-11.0.23-ga/Alibaba_Dragonwell_Extended_11.0.23.20.9_x64_linux.tar.gz"
|
||||
}
|
||||
},
|
||||
"riscv" : {
|
||||
"Extended" : {
|
||||
"sha256" : "f3488461cbfd95e6c08ad2dc01c51950b9c629c46eea6305002311b263ce2ad9",
|
||||
"name" : "Alibaba_Dragonwell_Extended_11.0.23.20.9_riscv64_linux.tar.gz",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell11/releases/download/dragonwell-extended-11.0.23.20_jdk-11.0.23-ga/Alibaba_Dragonwell_Extended_11.0.23.20.9_riscv64_linux.tar.gz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"windows" : {
|
||||
"x64" : {
|
||||
"Extended" : {
|
||||
"sha256" : "ba8dba2b7f2279f87220f396afcce49cb26482705deb5144c6e22a90ba443f9d",
|
||||
"name" : "Alibaba_Dragonwell_Extended_11.0.23.20.9_x64_windows.zip",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell11/releases/download/dragonwell-extended-11.0.23.20_jdk-11.0.23-ga/Alibaba_Dragonwell_Extended_11.0.23.20.9_x64_windows.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"17":{
|
||||
|
@ -1134,5 +1182,143 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"21" : {
|
||||
"21.0.3.0.3.9" : {
|
||||
"alpine-linux" : {
|
||||
"x64" : {
|
||||
"Standard" : {
|
||||
"sha256" : "c3c5d193a0a6aee8757fd3036dc13b7921a4306b089bf8759ba6b822d1e8416e",
|
||||
"name" : "Alibaba_Dragonwell_Standard_21.0.3.0.3.9_x64_alpine-linux.tar.gz",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.3.0.3%2B9_jdk-21.0.3-ga/Alibaba_Dragonwell_Standard_21.0.3.0.3.9_x64_alpine-linux.tar.gz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"linux" : {
|
||||
"aarch64" : {
|
||||
"Standard" : {
|
||||
"sha256" : "3cc309627ad2a9515ca50cdeff9eff118f14326b37eaa536b758570082aeb242",
|
||||
"name" : "Alibaba_Dragonwell_Standard_21.0.3.0.3.9_aarch64_linux.tar.gz",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.3.0.3%2B9_jdk-21.0.3-ga/Alibaba_Dragonwell_Standard_21.0.3.0.3.9_aarch64_linux.tar.gz"
|
||||
}
|
||||
},
|
||||
"x64" : {
|
||||
"Standard" : {
|
||||
"sha256" : "1c0508db048c0b50e2d61b2cc5a5390d3b9bcafec6e185d2cb53dde1fc530203",
|
||||
"name" : "Alibaba_Dragonwell_Standard_21.0.3.0.3.9_x64_linux.tar.gz",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.3.0.3%2B9_jdk-21.0.3-ga/Alibaba_Dragonwell_Standard_21.0.3.0.3.9_x64_linux.tar.gz"
|
||||
}
|
||||
},
|
||||
"riscv" : {
|
||||
"Standard" : {
|
||||
"sha256" : "e374698f8ee9c66b8d4a59ba50d0511aa654b55514732bc787e29c9afaddf846",
|
||||
"name" : "Alibaba_Dragonwell_Standard_21.0.3.0.3.9_riscv64_linux.tar.gz",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.3.0.3%2B9_jdk-21.0.3-ga/Alibaba_Dragonwell_Standard_21.0.3.0.3.9_riscv64_linux.tar.gz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"windows" : {
|
||||
"x64" : {
|
||||
"Standard" : {
|
||||
"sha256" : "0b75fc888cb2a9c7e050132fd020c30cbe65f3179feb36812a7c6be3c76ad277",
|
||||
"name" : "Alibaba_Dragonwell_Standard_21.0.3.0.3.9_x64_windows.zip",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.3.0.3%2B9_jdk-21.0.3-ga/Alibaba_Dragonwell_Standard_21.0.3.0.3.9_x64_windows.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"21.0.2.0.2.13" : {
|
||||
"alpine-linux" : {
|
||||
"x64" : {
|
||||
"Standard" : {
|
||||
"sha256" : "71a391987fdd569385c0afe1aaf16dbd48d127e14306793ef9ac0e0986b9632c",
|
||||
"name" : "Alibaba_Dragonwell_Standard_21.0.2.0.2.13_x64_alpine-linux.tar.gz",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.2.0.2%2B13_jdk-21.0.2-ga/Alibaba_Dragonwell_Standard_21.0.2.0.2.13_x64_alpine-linux.tar.gz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"linux" : {
|
||||
"aarch64" : {
|
||||
"Standard" : {
|
||||
"sha256" : "307321a399c206f8d56e0ce5c65921f9448ec9882dfb81ffc5e841b8fb5f8ed8",
|
||||
"name" : "Alibaba_Dragonwell_Standard_21.0.2.0.2.13_aarch64_linux.tar.gz",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.2.0.2%2B13_jdk-21.0.2-ga/Alibaba_Dragonwell_Standard_21.0.2.0.2.13_aarch64_linux.tar.gz"
|
||||
}
|
||||
},
|
||||
"x64" : {
|
||||
"Standard" : {
|
||||
"sha256" : "24198f0d436bb913b152181e07205647b05da01c196f5c10a96e9a998b10381a",
|
||||
"name" : "Alibaba_Dragonwell_Standard_21.0.2.0.2.13_x64_linux.tar.gz",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.2.0.2%2B13_jdk-21.0.2-ga/Alibaba_Dragonwell_Standard_21.0.2.0.2.13_x64_linux.tar.gz"
|
||||
}
|
||||
},
|
||||
"riscv" : {
|
||||
"Standard" : {
|
||||
"sha256" : "970a49103b8971952e46c81be844bc3776caca04da8456337f12e3a7d2a18011",
|
||||
"name" : "Alibaba_Dragonwell_Standard_21.0.2.0.2.13_riscv64_linux.tar.gz",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.2.0.2%2B13_jdk-21.0.2-ga/Alibaba_Dragonwell_Standard_21.0.2.0.2.13_riscv64_linux.tar.gz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"windows" : {
|
||||
"x64" : {
|
||||
"Standard" : {
|
||||
"sha256" : "b77de54be5ef1595fc568f6f18fbd4b61d64d99a0c9c5ef78a84018b4f82032b",
|
||||
"name" : "Alibaba_Dragonwell_Standard_21.0.2.0.2.13_x64_windows.zip",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.2.0.2%2B13_jdk-21.0.2-ga/Alibaba_Dragonwell_Standard_21.0.2.0.2.13_x64_windows.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"21.0.1.0.1.12" : {
|
||||
"alpine-linux" : {
|
||||
"x64" : {
|
||||
"Standard" : {
|
||||
"sha256" : "b9cea58bffe555484b831ff6d7cdb277c07e86a76d32b373ec35fa21ecb5fdc9",
|
||||
"name" : "Alibaba_Dragonwell_Standard_21.0.1.0.1.12_x64_alpine-linux.tar.gz",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.1.0.1%2B12_jdk-21.0.1-ga/Alibaba_Dragonwell_Standard_21.0.1.0.1.12_x64_alpine-linux.tar.gz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"linux" : {
|
||||
"aarch64" : {
|
||||
"Standard" : {
|
||||
"sha256" : "d36cef494ccc1939c6b5da04133cfdbe0b03956fd04147aef46014536bc5a37b",
|
||||
"name" : "Alibaba_Dragonwell_Standard_21.0.1.0.1.12_aarch64_linux.tar.gz",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.1.0.1%2B12_jdk-21.0.1-ga/Alibaba_Dragonwell_Standard_21.0.1.0.1.12_aarch64_linux.tar.gz"
|
||||
}
|
||||
},
|
||||
"x64" : {
|
||||
"Standard" : {
|
||||
"sha256" : "dfb8d325a98b8f577d72fd639cc54feee325eec8ebba497868184c8405a1cf41",
|
||||
"name" : "Alibaba_Dragonwell_Standard_21.0.1.0.1.12_x64_linux.tar.gz",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.1.0.1%2B12_jdk-21.0.1-ga/Alibaba_Dragonwell_Standard_21.0.1.0.1.12_x64_linux.tar.gz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"windows" : {
|
||||
"x64" : {
|
||||
"Standard" : {
|
||||
"sha256" : "b8ab99ed9060341f75edb8cc238830fbfd608e51536e43f34bd45c3e968ebab5",
|
||||
"name" : "Alibaba_Dragonwell_Standard_21.0.1.0.1.12_x64_windows.zip",
|
||||
"content_type" : "application/zip",
|
||||
"download_url" : "https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.1.0.1%2B12_jdk-21.0.1-ga/Alibaba_Dragonwell_Standard_21.0.1.0.1.12_x64_windows.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
87242
__tests__/data/sapmachine.json
Normal file
87242
__tests__/data/sapmachine.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -41,15 +41,16 @@ describe('getAvailableVersions', () => {
|
|||
describe('getAvailableVersions', () => {
|
||||
it.each([
|
||||
['8', 'x86', 'linux', 0],
|
||||
['8', 'aarch64', 'linux', 24],
|
||||
['8.6.6', 'x64', 'linux', 27],
|
||||
['8', 'aarch64', 'linux', 28],
|
||||
['8.6.6', 'x64', 'linux', 31],
|
||||
['8', 'x86', 'anolis', 0],
|
||||
['8', 'x86', 'windows', 0],
|
||||
['8', 'x86', 'mac', 0],
|
||||
['11', 'x64', 'linux', 27],
|
||||
['11', 'aarch64', 'linux', 24],
|
||||
['17', 'riscv', 'linux', 0],
|
||||
['16.0.1', 'x64', 'linux', 27]
|
||||
['11', 'x64', 'linux', 31],
|
||||
['11', 'aarch64', 'linux', 28],
|
||||
['17', 'riscv', 'linux', 3],
|
||||
['16.0.1', 'x64', 'linux', 31],
|
||||
['21', 'x64', 'linux', 31]
|
||||
])(
|
||||
'should get right number of available versions from JSON',
|
||||
async (
|
||||
|
@ -103,25 +104,31 @@ describe('getAvailableVersions', () => {
|
|||
'11',
|
||||
'linux',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell11/releases/download/dragonwell-extended-11.0.17.13_jdk-11.0.17-ga/Alibaba_Dragonwell_Extended_11.0.17.13.8_x64_linux.tar.gz'
|
||||
'https://github.com/dragonwell-project/dragonwell11/releases/download/dragonwell-extended-11.0.23.20_jdk-11.0.23-ga/Alibaba_Dragonwell_Extended_11.0.23.20.9_x64_linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'11',
|
||||
'linux',
|
||||
'aarch64',
|
||||
'https://github.com/alibaba/dragonwell11/releases/download/dragonwell-extended-11.0.17.13_jdk-11.0.17-ga/Alibaba_Dragonwell_Extended_11.0.17.13.8_aarch64_linux.tar.gz'
|
||||
'https://github.com/dragonwell-project/dragonwell11/releases/download/dragonwell-extended-11.0.23.20_jdk-11.0.23-ga/Alibaba_Dragonwell_Extended_11.0.23.20.9_aarch64_linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'11',
|
||||
'linux',
|
||||
'riscv',
|
||||
'https://github.com/dragonwell-project/dragonwell11/releases/download/dragonwell-extended-11.0.23.20_jdk-11.0.23-ga/Alibaba_Dragonwell_Extended_11.0.23.20.9_riscv64_linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'11',
|
||||
'windows',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell11/releases/download/dragonwell-extended-11.0.17.13_jdk-11.0.17-ga/Alibaba_Dragonwell_Extended_11.0.17.13.8_x64_windows.zip'
|
||||
'https://github.com/dragonwell-project/dragonwell11/releases/download/dragonwell-extended-11.0.23.20_jdk-11.0.23-ga/Alibaba_Dragonwell_Extended_11.0.23.20.9_x64_windows.zip'
|
||||
],
|
||||
[
|
||||
'11',
|
||||
'alpine-linux',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell11/releases/download/dragonwell-extended-11.0.17.13_jdk-11.0.17-ga/Alibaba_Dragonwell_Extended_11.0.17.13.8_x64_alpine-linux.tar.gz'
|
||||
'https://github.com/dragonwell-project/dragonwell11/releases/download/dragonwell-extended-11.0.23.20_jdk-11.0.23-ga/Alibaba_Dragonwell_Extended_11.0.23.20.9_x64_alpine-linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'11.0.17',
|
||||
|
@ -158,6 +165,30 @@ describe('getAvailableVersions', () => {
|
|||
'linux',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.4.0.4%2B8_jdk-17.0.4-ga/Alibaba_Dragonwell_Standard_17.0.4.0.4%2B8_x64_linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'17.0.4+8',
|
||||
'linux',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.4.0.4%2B8_jdk-17.0.4-ga/Alibaba_Dragonwell_Standard_17.0.4.0.4%2B8_x64_linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'21',
|
||||
'linux',
|
||||
'aarch64',
|
||||
'https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.3.0.3%2B9_jdk-21.0.3-ga/Alibaba_Dragonwell_Standard_21.0.3.0.3.9_aarch64_linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'21.0.3+9',
|
||||
'linux',
|
||||
'riscv',
|
||||
'https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.3.0.3%2B9_jdk-21.0.3-ga/Alibaba_Dragonwell_Standard_21.0.3.0.3.9_riscv64_linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'21.0.1+12',
|
||||
'linux',
|
||||
'x64',
|
||||
'https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.1.0.1%2B12_jdk-21.0.1-ga/Alibaba_Dragonwell_Standard_21.0.1.0.1.12_x64_linux.tar.gz'
|
||||
]
|
||||
])(
|
||||
'should return proper link according to the specified java-version, platform and arch',
|
||||
|
|
294
__tests__/distributors/sapmachine-installer.test.ts
Normal file
294
__tests__/distributors/sapmachine-installer.test.ts
Normal file
|
@ -0,0 +1,294 @@
|
|||
import {HttpClient} from '@actions/http-client';
|
||||
import {SapMachineDistribution} from '../../src/distributions/sapmachine/installer';
|
||||
import * as utils from '../../src/util';
|
||||
|
||||
import manifestData from '../data/sapmachine.json';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
spyHttpClient.mockReturnValue({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: manifestData
|
||||
});
|
||||
|
||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
||||
utils,
|
||||
'getDownloadArchiveExtension'
|
||||
);
|
||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks();
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
const mockPlatform = (
|
||||
distribution: SapMachineDistribution,
|
||||
platform: string
|
||||
) => {
|
||||
distribution['getPlatformOption'] = () => platform;
|
||||
const mockedExtension = platform == 'windows' ? 'zip' : 'tar.gz';
|
||||
spyUtilGetDownloadArchiveExtension.mockReturnValue(mockedExtension);
|
||||
};
|
||||
|
||||
describe('shouldFallbackToBackupUrl', () => {
|
||||
it('should return correct release when the primary URL is not available', async () => {
|
||||
spyHttpClient.mockReturnValueOnce({
|
||||
statusCode: 404,
|
||||
headers: {},
|
||||
result: ''
|
||||
});
|
||||
spyHttpClient.mockReturnValueOnce({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: manifestData
|
||||
});
|
||||
|
||||
const version = '17';
|
||||
const distribution = new SapMachineDistribution({
|
||||
version: version,
|
||||
architecture: 'x64',
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
|
||||
mockPlatform(distribution, 'linux');
|
||||
|
||||
const availableVersion = await distribution['findPackageForDownload'](
|
||||
version
|
||||
);
|
||||
expect(availableVersion).not.toBeNull();
|
||||
expect(availableVersion.url).toBe(
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_linux-x64_bin.tar.gz'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
it.each([
|
||||
['11', 'x64', 'linux', 71],
|
||||
['11', 'aarch64', 'linux', 54],
|
||||
['17', 'riscv', 'linux', 0],
|
||||
['16.0.1', 'x64', 'linux', 71],
|
||||
['23-ea', 'x64', 'linux', 798],
|
||||
['23-ea', 'aarch64', 'windows', 0],
|
||||
['23-ea', 'x64', 'windows', 750]
|
||||
])(
|
||||
'should get right number of available versions from JSON',
|
||||
async (
|
||||
jdkVersion: string,
|
||||
arch: string,
|
||||
platform: string,
|
||||
len: number
|
||||
) => {
|
||||
const distribution = new SapMachineDistribution({
|
||||
version: jdkVersion,
|
||||
architecture: arch,
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
mockPlatform(distribution, platform);
|
||||
|
||||
const availableVersions = await distribution['getAvailableVersions']();
|
||||
expect(availableVersions).not.toBeNull();
|
||||
expect(availableVersions.length).toBe(len);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe('findPackageForDownload', () => {
|
||||
it.each([
|
||||
[
|
||||
'11',
|
||||
'linux',
|
||||
'x64',
|
||||
'jdk',
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.22/sapmachine-jdk-11.0.22_linux-x64_bin.tar.gz'
|
||||
],
|
||||
[
|
||||
'11',
|
||||
'linux',
|
||||
'aarch64',
|
||||
'jdk',
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.22/sapmachine-jdk-11.0.22_linux-aarch64_bin.tar.gz'
|
||||
],
|
||||
[
|
||||
'11',
|
||||
'windows',
|
||||
'x64',
|
||||
'jdk',
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.22/sapmachine-jdk-11.0.22_windows-x64_bin.zip'
|
||||
],
|
||||
[
|
||||
'11.0.17',
|
||||
'linux',
|
||||
'x64',
|
||||
'jdk',
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.17/sapmachine-jdk-11.0.17_linux-x64_bin.tar.gz'
|
||||
],
|
||||
[
|
||||
'17',
|
||||
'linux',
|
||||
'x64',
|
||||
'jdk',
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_linux-x64_bin.tar.gz'
|
||||
],
|
||||
[
|
||||
'17',
|
||||
'linux',
|
||||
'aarch64',
|
||||
'jdk',
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_linux-aarch64_bin.tar.gz'
|
||||
],
|
||||
[
|
||||
'17',
|
||||
'windows',
|
||||
'x64',
|
||||
'jdk',
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_windows-x64_bin.zip'
|
||||
],
|
||||
[
|
||||
'17.0.4',
|
||||
'linux',
|
||||
'x64',
|
||||
'jdk',
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.4.1/sapmachine-jdk-17.0.4.1_linux-x64_bin.tar.gz'
|
||||
],
|
||||
[
|
||||
'17',
|
||||
'linux',
|
||||
'x64',
|
||||
'jre',
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jre-17.0.10_linux-x64_bin.tar.gz'
|
||||
],
|
||||
[
|
||||
'17',
|
||||
'linux',
|
||||
'aarch64',
|
||||
'jre',
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jre-17.0.10_linux-aarch64_bin.tar.gz'
|
||||
],
|
||||
[
|
||||
'17',
|
||||
'windows',
|
||||
'x64',
|
||||
'jre',
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jre-17.0.10_windows-x64_bin.zip'
|
||||
],
|
||||
[
|
||||
'17.0.4',
|
||||
'linux',
|
||||
'x64',
|
||||
'jre',
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.4.1/sapmachine-jre-17.0.4.1_linux-x64_bin.tar.gz'
|
||||
],
|
||||
[
|
||||
'23-ea',
|
||||
'linux',
|
||||
'x64',
|
||||
'jdk',
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-23%2B15/sapmachine-jdk-23-ea.15_linux-x64_bin.tar.gz',
|
||||
'23'
|
||||
],
|
||||
[
|
||||
'21.0.2+2-ea',
|
||||
'linux',
|
||||
'x64',
|
||||
'jdk',
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-21.0.2%2B2/sapmachine-jdk-21.0.2-ea.2_linux-x64_bin.tar.gz',
|
||||
'21.0.2+2'
|
||||
],
|
||||
[
|
||||
'17',
|
||||
'linux-musl',
|
||||
'x64',
|
||||
'jdk',
|
||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_linux-x64-musl_bin.tar.gz'
|
||||
]
|
||||
])(
|
||||
'should return proper link according to the specified java-version, platform and arch',
|
||||
async (
|
||||
version: string,
|
||||
platform: string,
|
||||
arch: string,
|
||||
packageType: string,
|
||||
expectedLink: string,
|
||||
normalizedVersion: string = version
|
||||
) => {
|
||||
const distribution = new SapMachineDistribution({
|
||||
version: version,
|
||||
architecture: arch,
|
||||
packageType: packageType,
|
||||
checkLatest: false
|
||||
});
|
||||
mockPlatform(distribution, platform);
|
||||
|
||||
const availableVersion = await distribution['findPackageForDownload'](
|
||||
normalizedVersion
|
||||
);
|
||||
expect(availableVersion).not.toBeNull();
|
||||
expect(availableVersion.url).toBe(expectedLink);
|
||||
}
|
||||
);
|
||||
|
||||
it.each([
|
||||
['8', 'linux', 'x64'],
|
||||
['8', 'macos', 'aarch64'],
|
||||
['23', 'macos', 'aarch64'],
|
||||
['17', 'linux', 'riscv'],
|
||||
['23', 'linux', 'x64'],
|
||||
['25-ea', 'linux', 'x64', '25'],
|
||||
['8-ea', 'linux', 'x64', '8'],
|
||||
['21.0.3+7', 'linux', 'x64', '21.0.3+7'],
|
||||
['21.0.3+8-ea', 'linux', 'x64', '21.0.3+8'],
|
||||
['17', 'linux-muse', 'aarch64']
|
||||
])(
|
||||
'should throw when required version of JDK can not be found in the JSON',
|
||||
async (
|
||||
version: string,
|
||||
platform: string,
|
||||
arch: string,
|
||||
normalizedVersion: string = version
|
||||
) => {
|
||||
const distribution = new SapMachineDistribution({
|
||||
version: version,
|
||||
architecture: arch,
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
mockPlatform(distribution, platform);
|
||||
|
||||
await expect(
|
||||
distribution['findPackageForDownload'](normalizedVersion)
|
||||
).rejects.toThrow(
|
||||
`Couldn't find any satisfied version for the specified java-version: "${normalizedVersion}" and architecture: "${arch}".`
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
it('should throw when required package type is not supported', async () => {
|
||||
const jdkVersion = '17';
|
||||
const arch = 'x64';
|
||||
const platform = 'linux';
|
||||
const distribution = new SapMachineDistribution({
|
||||
version: jdkVersion,
|
||||
architecture: arch,
|
||||
packageType: 'jdk+fx',
|
||||
checkLatest: false
|
||||
});
|
||||
mockPlatform(distribution, platform);
|
||||
await expect(
|
||||
distribution['findPackageForDownload'](jdkVersion)
|
||||
).rejects.toThrow(
|
||||
'SapMachine provides only the `jdk` and `jre` package type'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
|
@ -207,7 +207,7 @@ describe('findPackageForDownload', () => {
|
|||
});
|
||||
distribution['getAvailableVersions'] = async () => [];
|
||||
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
|
||||
`Unsupported architecture for IBM Semeru: ${arch}, the following are supported: x64, x86, ppc64le, ppc64, s390x, aarch64`
|
||||
`Unsupported architecture for IBM Semeru: ${arch} for your current OS version, the following are supported: x64, x86, ppc64le, ppc64, s390x, aarch64`
|
||||
);
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue