Skip to content
Permalink
Browse files
8253379: [windows] Several jpackage tests failed with error code 1638
Reviewed-by: asemenyuk, almatvee, kizune
  • Loading branch information
Andy Herrick committed Oct 9, 2020
1 parent 52e45a3 commit be26972432e227682cf3a054f4fd12b5e6b4d36c
Showing 2 changed files with 19 additions and 6 deletions.
@@ -698,7 +698,18 @@ public static void assertPathExists(Path path, boolean exists) {
}
}

public static void assertDirectoryExists(Path path) {
public static void assertPathNotEmptyDirectory(Path path) {
if (Files.isDirectory(path)) {
ThrowingRunnable.toRunnable(() -> {
try (var files = Files.list(path)) {
TKit.assertFalse(files.findFirst().isEmpty(), String.format
("Check [%s] is not an empty directory", path));
}
}).run();
}
}

public static void assertDirectoryExists(Path path) {
assertPathExists(path, true);
assertTrue(path.toFile().isDirectory(), String.format(
"Check [%s] is a directory", path));
@@ -110,10 +110,12 @@ static PackageHandlers createMsiPackageHandlers() {

static PackageHandlers createExePackageHandlers() {
PackageHandlers exe = new PackageHandlers();
exe.installHandler = cmd -> {
cmd.verifyIsOfType(PackageType.WIN_EXE);
new Executor().setExecutable(cmd.outputBundle()).execute();
};
// can't have install handler without also having uninstall handler
// so following is commented out for now
// exe.installHandler = cmd -> {
// cmd.verifyIsOfType(PackageType.WIN_EXE);
// new Executor().setExecutable(cmd.outputBundle()).execute();
// };

return exe;
}
@@ -208,7 +210,7 @@ private void verifyStartMenuShortcut(Path shortcutsRoot, boolean exists) {
Path shortcutPath = shortcutsRoot.resolve(startMenuShortcutPath());
verifyShortcut(shortcutPath, exists);
if (!exists) {
TKit.assertPathExists(shortcutPath.getParent(), false);
TKit.assertPathNotEmptyDirectory(shortcutPath.getParent());
}
}

1 comment on commit be26972

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on be26972 Oct 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.