Skip to content

Commit

Permalink
8343396: Use OperatingSystem, Architecture, and OSVersion in jpackage…
Browse files Browse the repository at this point in the history
… tests

Reviewed-by: rriggs, almatvee
  • Loading branch information
Alexey Semenyuk committed Nov 7, 2024
1 parent 61dfa75 commit 76fec3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,14 @@
import java.util.stream.Collectors;
import static java.util.stream.Collectors.toSet;
import java.util.stream.Stream;
import jdk.internal.util.OperatingSystem;
import jdk.jpackage.test.Functional.ExceptionBox;
import jdk.jpackage.test.Functional.ThrowingConsumer;
import jdk.jpackage.test.Functional.ThrowingRunnable;
import jdk.jpackage.test.Functional.ThrowingSupplier;

public final class TKit {

private static final String OS = System.getProperty("os.name").toLowerCase();

public static final Path TEST_SRC_ROOT = Functional.identity(() -> {
Path root = Path.of(System.getProperty("test.src"));

Expand Down Expand Up @@ -176,15 +175,15 @@ static String getCurrentDefaultAppName() {
}

public static boolean isWindows() {
return (OS.contains("win"));
return OperatingSystem.isWindows();
}

public static boolean isOSX() {
return (OS.contains("mac"));
return OperatingSystem.isMacOS();
}

public static boolean isLinux() {
return ((OS.contains("nix") || OS.contains("nux")));
return OperatingSystem.isLinux();
}

public static boolean isLinuxAPT() {
Expand Down
3 changes: 2 additions & 1 deletion test/jdk/tools/jpackage/macosx/HostArchPkgTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
import jdk.internal.util.Architecture;
import jdk.jpackage.test.JPackageCommand;
import jdk.jpackage.test.PackageTest;
import jdk.jpackage.test.PackageType;
Expand Down Expand Up @@ -73,7 +74,7 @@ private static void verifyHostArch(JPackageCommand cmd) throws Exception {
"/installer-gui-script/options/@hostArchitectures",
doc, XPathConstants.STRING);

if ("aarch64".equals(System.getProperty("os.arch"))) {
if (Architecture.isAARCH64()) {
TKit.assertEquals(v, "arm64",
"Check value of \"hostArchitectures\" attribute");
} else {
Expand Down

0 comments on commit 76fec3d

Please sign in to comment.