test/jdk/tools/jpackage/helpers/jdk/jpackage/test/WindowsHelper.java
branchJDK-8200758-branch
changeset 58301 e0efb29609bd
parent 58113 885b0543f6e4
child 58416 f09bf58c1f17
equal deleted inserted replaced
58172:bf06a1d3aef6 58301:e0efb29609bd
    95             Test.assertFileExists(dir.resolve(desktopShortcutPath()), exists);
    95             Test.assertFileExists(dir.resolve(desktopShortcutPath()), exists);
    96         }
    96         }
    97 
    97 
    98         private void verifyStartMenuShortcut() {
    98         private void verifyStartMenuShortcut() {
    99             boolean appInstalled = cmd.launcherInstallationPath().toFile().exists();
    99             boolean appInstalled = cmd.launcherInstallationPath().toFile().exists();
   100             if (cmd.hasArgument("--win-menu") || !cmd.hasArgument("--win-shortcut")) {
   100             if (cmd.hasArgument("--win-menu")) {
   101                 if (isUserLocalInstall(cmd)) {
   101                 if (isUserLocalInstall(cmd)) {
   102                     verifyUserLocalStartMenuShortcut(appInstalled);
   102                     verifyUserLocalStartMenuShortcut(appInstalled);
   103                     verifySystemStartMenuShortcut(false);
   103                     verifySystemStartMenuShortcut(false);
   104                 } else {
   104                 } else {
   105                     verifySystemStartMenuShortcut(appInstalled);
   105                     verifySystemStartMenuShortcut(appInstalled);
   127                     USER_SHELL_FOLDERS_REGKEY, "Programs"));
   127                     USER_SHELL_FOLDERS_REGKEY, "Programs"));
   128             Test.assertFileExists(dir.resolve(startMenuShortcutPath()), exists);
   128             Test.assertFileExists(dir.resolve(startMenuShortcutPath()), exists);
   129         }
   129         }
   130 
   130 
   131         private void verifyFileAssociationsRegistry() {
   131         private void verifyFileAssociationsRegistry() {
   132             Path faFile = cmd.getArgumentValue("--file-associations",
   132             Stream.of(cmd.getAllArgumentValues("--file-associations")).map(
   133                     () -> (Path) null, Path::of);
   133                     Path::of).forEach(this::verifyFileAssociationsRegistry);
   134             if (faFile == null) {
   134         }
   135                 return;
   135 
   136             }
   136         private void verifyFileAssociationsRegistry(Path faFile) {
   137 
       
   138             boolean appInstalled = cmd.launcherInstallationPath().toFile().exists();
   137             boolean appInstalled = cmd.launcherInstallationPath().toFile().exists();
   139             try {
   138             try {
   140                 Test.trace(String.format(
   139                 Test.trace(String.format(
   141                         "Get file association properties from [%s] file",
   140                         "Get file association properties from [%s] file",
   142                         faFile));
   141                         faFile));