setup-java/__tests__/distributors
Guillaume Smet 6657b99340
feat: Add set-default option (#1017)
* Add set-default option

This option allows to install an additional JDK without making it the
default one.

I have wanted this for quite a long time as I'm running custom GitHub
Actions with Java, which might require a specific JDK and I don't want
to pollute the JDK that is used by the overall workflow calling the
action.
And I'm apparently not alone as there was a preexisting issue.

Fixes #560

* Dedupe setJavaDefault and document multi-version/toolchain behavior

- Refactor setJavaDefault to delegate shared output/env logic to
  setJavaEnvironment, avoiding duplication between the two.
- Document that set-default applies to all JDKs in a multiline
  java-version, and that installed JDKs remain registered in Maven
  toolchains regardless of set-default.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: fix Prettier formatting in base-installer test

Resolves the failing 'Basic validation / build' format-check on
__tests__/distributors/base-installer.test.ts (line exceeded print width).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Bruno Borges <brborges@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-07 12:38:57 -04:00
..
adopt-installer.test.ts Make the Adoptopenjdk package type look at the Temurin repo first for latest assets (#522) 2026-06-12 16:30:59 +01:00
base-installer.test.ts feat: Add set-default option (#1017) 2026-07-07 12:38:57 -04:00
corretto-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
dragonwell-installer.test.ts Spelling (#713) 2026-06-22 10:57:54 -04:00
graalvm-installer.test.ts dist: Address Copilot review suggestions from PR #1042 (GraalVM Community) (#1059) 2026-06-23 13:37:44 -04:00
jetbrains-installer.test.ts Updated jetbrains test: https.request() now catches errors. This fixes leaking tests as well (#1070) 2026-07-02 15:01:00 -04:00
kona-installer.test.ts dist: Support Tencent Kona JDK (#672) 2026-07-07 11:00:40 -04:00
liberica-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
liberica-linux-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
liberica-windows-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
local-installer.test.ts Spelling (#713) 2026-06-22 10:57:54 -04:00
microsoft-installer.test.ts feat: Add verify-signature plumbing and Temurin+Microsoft verification support (#1060) 2026-06-29 13:19:49 +01:00
oracle-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
sapmachine-installer.test.ts Spelling (#713) 2026-06-22 10:57:54 -04:00
semeru-installer.test.ts Implement pagination with link headers for Adoptium based apis (#1014) 2026-06-12 11:50:16 +01:00
temurin-installer.test.ts feat: Add verify-signature plumbing and Temurin+Microsoft verification support (#1060) 2026-06-29 13:19:49 +01:00
zulu-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
zulu-linux-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00
zulu-windows-installer.test.ts Refactor error handling and improve test logging for installers (#989) 2026-04-13 12:44:45 -05:00