From ebac7eec8e5923c66a80cbd66e79c354f30a07a3 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Fri, 17 Mar 2023 07:55:55 +0000 Subject: [PATCH] 8304063: tools/jpackage/share/AppLauncherEnvTest.java fails when checking LD_LIBRARY_PATH Reviewed-by: asemenyuk, almatvee --- test/jdk/tools/jpackage/share/AppLauncherEnvTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/jdk/tools/jpackage/share/AppLauncherEnvTest.java b/test/jdk/tools/jpackage/share/AppLauncherEnvTest.java index 6e7d35d37b7..cc52b285fbe 100644 --- a/test/jdk/tools/jpackage/share/AppLauncherEnvTest.java +++ b/test/jdk/tools/jpackage/share/AppLauncherEnvTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ import java.nio.file.Path; import java.util.List; import java.util.Optional; import java.util.function.BiFunction; +import java.util.stream.Stream; import jdk.jpackage.test.JPackageCommand; import jdk.jpackage.test.Annotations.Test; import jdk.jpackage.test.Executor; @@ -83,8 +84,10 @@ public class AppLauncherEnvTest { final String expectedEnvVarValue = Optional.ofNullable(System.getenv( envVarName)).orElse("") + File.pathSeparator + appDir; - TKit.assertEquals(expectedEnvVarValue, actualEnvVarValue, String.format( - "Check value of %s env variable", envVarName)); + TKit.assertTextStream(expectedEnvVarValue) + .predicate(TKit.isLinux() ? String::endsWith : String::equals) + .label(String.format("value of %s env variable", envVarName)) + .apply(Stream.of(actualEnvVarValue)); final String javaLibraryPath = getValue.apply(2, "java.library.path"); TKit.assertTrue(