Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,32 @@
*/
package io.trino.tests.product.launcher.env.jdk;

import com.google.inject.Inject;
import io.trino.testing.containers.TestContainers;
import io.trino.tests.product.launcher.env.EnvironmentOptions;

public class Zulu19JdkProvider
public abstract class AdoptiumApiResolvingJdkProvider
extends TarDownloadingJdkProvider
{
private static final String VERSION = "19.0.2";

@Inject
public Zulu19JdkProvider(EnvironmentOptions environmentOptions)
public AdoptiumApiResolvingJdkProvider(EnvironmentOptions environmentOptions)
{
super(environmentOptions);
}

protected abstract String getReleaseName();

@Override
protected String getDownloadUri(TestContainers.DockerArchitecture architecture)
public String getDescription()
{
return switch (architecture) {
case AMD64 -> "https://cdn.azul.com/zulu/bin/zulu19.32.13-ca-jdk%s-linux_x64.tar.gz".formatted(VERSION);
case ARM64 -> "https://cdn.azul.com/zulu/bin/zulu19.32.13-ca-jdk%s-linux_aarch64.tar.gz".formatted(VERSION);
default -> throw new IllegalArgumentException("Architecture %s is not supported for Zulu 19 distribution".formatted(architecture));
};
return "Temurin " + getReleaseName();
}

@Override
public String getDescription()
protected String getDownloadUri(TestContainers.DockerArchitecture architecture)
{
return "Zulu " + VERSION;
return switch (architecture) {
case AMD64 -> "https://api.adoptium.net/v3/binary/version/%s/linux/%s/jdk/hotspot/normal/eclipse?project=jdk".formatted(getReleaseName(), "x64");
case ARM64 -> "https://api.adoptium.net/v3/binary/version/%s/linux/%s/jdk/hotspot/normal/eclipse?project=jdk".formatted(getReleaseName(), "aarch64");
default -> throw new UnsupportedOperationException("Fetching Temurin JDK for arch " + architecture + " is not supported");
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,20 @@
package io.trino.tests.product.launcher.env.jdk;

import com.google.inject.Inject;
import io.trino.testing.containers.TestContainers;
import io.trino.tests.product.launcher.env.EnvironmentOptions;

public class Temurin19JdkProvider
extends TarDownloadingJdkProvider
extends AdoptiumApiResolvingJdkProvider
{
private static final String VERSION = "19.0.2-7";

@Inject
public Temurin19JdkProvider(EnvironmentOptions environmentOptions)
{
super(environmentOptions);
}

@Override
protected String getDownloadUri(TestContainers.DockerArchitecture architecture)
{
return switch (architecture) {
case AMD64 -> "https://github.com/adoptium/temurin19-binaries/releases/download/jdk-%s/OpenJDK19U-jdk_x64_linux_hotspot_19.0.2_7.tar.gz".formatted(VERSION.replace("-", "%2B"));
case ARM64 -> "https://github.com/adoptium/temurin19-binaries/releases/download/jdk-%s/OpenJDK19U-jdk_aarch64_linux_hotspot_19.0.2_7.tar.gz".formatted(VERSION.replace("-", "%2B"));
default -> throw new IllegalArgumentException("Architecture %s is not supported for Temurin 19 distribution".formatted(architecture));
};
}

@Override
public String getDescription()
protected String getReleaseName()
{
return "Temurin " + VERSION;
return "jdk-19.0.2+7";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,20 @@
package io.trino.tests.product.launcher.env.jdk;

import com.google.inject.Inject;
import io.trino.testing.containers.TestContainers.DockerArchitecture;
import io.trino.tests.product.launcher.env.EnvironmentOptions;

public class Temurin20JdkProvider
extends TarDownloadingJdkProvider
extends AdoptiumApiResolvingJdkProvider
{
private static final String VERSION = "20.0.1-9";

@Inject
public Temurin20JdkProvider(EnvironmentOptions environmentOptions)
{
super(environmentOptions);
}

@Override
protected String getDownloadUri(DockerArchitecture architecture)
{
return switch (architecture) {
case AMD64 -> "https://github.com/adoptium/temurin20-binaries/releases/download/jdk-%s/OpenJDK20U-jdk_x64_linux_hotspot_20.0.1_9.tar.gz".formatted(VERSION.replace("-", "%2B"));
case ARM64 -> "https://github.com/adoptium/temurin20-binaries/releases/download/jdk-%s/OpenJDK20U-jdk_aarch64_linux_hotspot_20.0.1_9.tar.gz".formatted(VERSION.replace("-", "%2B"));
default -> throw new IllegalArgumentException("Architecture %s is not supported for Temurin 20 distribution".formatted(architecture));
};
}

@Override
public String getDescription()
protected String getReleaseName()
{
return "Temurin " + VERSION;
return "jdk-20.0.2+9";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.tests.product.launcher.env.jdk;

import com.google.inject.Inject;
import io.trino.tests.product.launcher.env.EnvironmentOptions;

public class Temurin21JdkProvider
extends AdoptiumApiResolvingJdkProvider
{
@Inject
public Temurin21JdkProvider(EnvironmentOptions environmentOptions)
{
super(environmentOptions);
}

@Override
protected String getReleaseName()
{
return "jdk-21.0.1+12";
}
}

This file was deleted.

This file was deleted.

This file was deleted.