Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8269486: CallerAccessTest fails for non server variant
Reviewed-by: dholmes, stuefe, mchung, jvernee
  • Loading branch information
mychris authored and Mandy Chung committed Jun 30, 2021
1 parent be0ac92 commit 1da5d4bb780fc3ab02aa6cddc243fbf1b079851a
Showing with 4 additions and 7 deletions.
  1. +4 −7 test/jdk/java/lang/reflect/exeCallerAccessTest/CallerAccessTest.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021, 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
@@ -37,7 +37,6 @@
import java.io.File;
import java.util.Map;
import jdk.test.lib.Platform;
import jdk.test.lib.Utils;
import jdk.test.lib.process.OutputAnalyzer;

import java.io.IOException;
@@ -50,17 +49,15 @@ public static void main(String[] args) throws IOException {
ProcessBuilder pb = new ProcessBuilder(launcher.toString());
Map<String, String> env = pb.environment();

String libName = Platform.isWindows() ? "bin" : "lib";
Path libPath = Paths.get(Utils.TEST_JDK).resolve(libName);
String libDir = libPath.toAbsolutePath().toString();
String serverDir = libPath.resolve("server").toAbsolutePath().toString();
String libDir = Platform.libDir().toString();
String vmDir = Platform.jvmLibDir().toString();

// set up shared library path
String sharedLibraryPathEnvName = Platform.sharedLibraryPathVariableName();
env.compute(sharedLibraryPathEnvName,
(k, v) -> (v == null) ? libDir : v + File.pathSeparator + libDir);
env.compute(sharedLibraryPathEnvName,
(k, v) -> (v == null) ? serverDir : v + File.pathSeparator + serverDir);
(k, v) -> (v == null) ? vmDir : v + File.pathSeparator + vmDir);

System.out.println("Launching: " + launcher + " shared library path: " +
env.get(sharedLibraryPathEnvName));

1 comment on commit 1da5d4b

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 1da5d4b Jun 30, 2021

Please sign in to comment.