mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
Update Java.Tests.ps1
This commit is contained in:
@@ -38,17 +38,15 @@ Describe "Java" {
|
||||
}
|
||||
|
||||
It "Version is valid" -TestCases $_ {
|
||||
$javaRootPath = (Get-CommandResult "/usr/libexec/java_home -v${Version}").Output
|
||||
$javaRootPath = "/Library/Java/JavaVirtualMachines/adoptopenjdk-${Title}.jdk//Contents/Home"
|
||||
$javaBinPath = Join-Path $javaRootPath "/bin/java"
|
||||
Validate-JavaVersion -JavaCommand "$javaBinPath -version" -ExpectedVersion $Version
|
||||
}
|
||||
|
||||
It "<EnvVariable>" -TestCases $_ {
|
||||
$envVariablePath = Get-EnvironmentVariable $EnvVariable
|
||||
$commandResult = Get-CommandResult "/usr/libexec/java_home -v${Version}"
|
||||
$commandResult.ExitCode | Should -Be 0
|
||||
$commandResult.Output | Should -Not -BeNullOrEmpty
|
||||
$commandResult.Output | Should -Be $envVariablePath
|
||||
$javaBinPath = Join-Path $envVariablePath "/bin/java"
|
||||
Validate-JavaVersion -JavaCommand "$javaBinPath -version" -ExpectedVersion $Version
|
||||
}
|
||||
|
||||
if ($_.Title -eq "Default") {
|
||||
|
||||
Reference in New Issue
Block a user