8304063: tools/jpackage/share/AppLauncherEnvTest.java fails when checking LD_LIBRARY_PATH

Reviewed-by: asemenyuk, almatvee
This commit is contained in:
Matthias Baesken 2023-03-17 07:55:55 +00:00
parent 36995c5a75
commit ebac7eec8e

View File

@ -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(