< prev index next >
test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java
Print this page
*** 305,315 ****
*/
public Path appRuntimeInstallationDirectory() {
if (PackageType.IMAGE == packageType()) {
return null;
}
! return appInstallationDirectory().resolve("runtime");
}
/**
* Returns path where application launcher will be installed.
* If the command will package Java run-time only, still returns path to
--- 305,315 ----
*/
public Path appRuntimeInstallationDirectory() {
if (PackageType.IMAGE == packageType()) {
return null;
}
! return appInstallationDirectory().resolve(appRuntimePath(packageType()));
}
/**
* Returns path where application launcher will be installed.
* If the command will package Java run-time only, still returns path to
*** 386,406 ****
}
/**
* Returns path to runtime directory relative to image directory.
*
- * Function will always return "runtime".
- *
* @throws IllegalArgumentException if command is configured for platform
* packaging
*/
public Path appRuntimeDirectoryInAppImage() {
final PackageType type = packageType();
if (PackageType.IMAGE != type) {
throw new IllegalArgumentException("Unexpected package type");
}
return Path.of("runtime");
}
public boolean isFakeRuntimeInAppImage(String msg) {
return isFakeRuntime(appImage().resolve(
--- 386,411 ----
}
/**
* Returns path to runtime directory relative to image directory.
*
* @throws IllegalArgumentException if command is configured for platform
* packaging
*/
public Path appRuntimeDirectoryInAppImage() {
final PackageType type = packageType();
if (PackageType.IMAGE != type) {
throw new IllegalArgumentException("Unexpected package type");
}
+ return appRuntimePath(type);
+ }
+
+ private static Path appRuntimePath(PackageType type) {
+ if (PackageType.LINUX.contains(type)) {
+ return Path.of("lib/runtime");
+ }
return Path.of("runtime");
}
public boolean isFakeRuntimeInAppImage(String msg) {
return isFakeRuntime(appImage().resolve(
*** 412,432 ****
}
private static boolean isFakeRuntime(Path runtimeDir, String msg) {
final List<Path> criticalRuntimeFiles;
if (Test.isWindows()) {
! criticalRuntimeFiles = List.of(Path.of("server\\jvm.dll"));
} else if (Test.isLinux()) {
! criticalRuntimeFiles = List.of(Path.of("server/libjvm.so"));
} else if (Test.isOSX()) {
! criticalRuntimeFiles = List.of(Path.of("server/libjvm.dylib"));
} else {
throw new IllegalArgumentException("Unknwon platform");
}
! if (criticalRuntimeFiles.stream().filter(v -> v.toFile().exists())
! .findFirst().orElse(null) == null) {
// Fake runtime
Test.trace(String.format(
"%s because application runtime directory [%s] is incomplete",
msg, runtimeDir));
return true;
--- 417,438 ----
}
private static boolean isFakeRuntime(Path runtimeDir, String msg) {
final List<Path> criticalRuntimeFiles;
if (Test.isWindows()) {
! criticalRuntimeFiles = List.of(Path.of("bin\\server\\jvm.dll"));
} else if (Test.isLinux()) {
! criticalRuntimeFiles = List.of(Path.of("lib/server/libjvm.so"));
} else if (Test.isOSX()) {
! criticalRuntimeFiles = List.of(Path.of("lib/server/libjvm.dylib"));
} else {
throw new IllegalArgumentException("Unknwon platform");
}
! if (criticalRuntimeFiles.stream().filter(
! v -> runtimeDir.resolve(v).toFile().exists()).findFirst().orElse(
! null) == null) {
// Fake runtime
Test.trace(String.format(
"%s because application runtime directory [%s] is incomplete",
msg, runtimeDir));
return true;
< prev index next >