< prev index next >

test/jdk/tools/jlink/plugins/SaveJlinkArgfilesPluginTest.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2022, 2024, 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
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.
--- 1,7 ---
  /*
!  * Copyright (c) 2022, 2026, 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
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 22,11 ***
   */
  
  /*
   * @test
   * @summary Test --save-jlink-argfiles plugin
-  * @requires vm.jvmci
   * @library ../../lib
   * @library /test/lib
   * @modules java.base/jdk.internal.jimage
   *          jdk.jlink/jdk.tools.jlink.internal
   *          jdk.jlink/jdk.tools.jmod
--- 22,10 ---

*** 56,17 ***
  
          String exe = System.getProperty("os.name").startsWith("Windows") ? ".exe" : "";
          Path argfile1 = Path.of("argfile1");
          Path argfile2 = Path.of("argfile2");
  
!         Files.writeString(argfile1, "--add-modules jdk.internal.vm.ci --add-options=-Dfoo=xyzzy");
          Files.writeString(argfile2, "--vendor-version=\"XyzzyVM 3.14.15\" --vendor-bug-url=https://bugs.xyzzy.com/");
  
          var module = "base";
          helper.generateDefaultJModule(module);
          var image = helper.generateDefaultImage(new String[] {
!                 "--add-modules", "jdk.jlink,jdk.jdeps,jdk.internal.opt,jdk.compiler,java.compiler,jdk.zipfs,jdk.internal.vm.ci",
                  "--keep-packaged-modules", "images/base.image/jmods",
                  "--save-jlink-argfiles", argfile1 + File.pathSeparator + argfile2
              }, module)
              .assertSuccess();
          helper.checkImage(image, module, null, null);
--- 55,17 ---
  
          String exe = System.getProperty("os.name").startsWith("Windows") ? ".exe" : "";
          Path argfile1 = Path.of("argfile1");
          Path argfile2 = Path.of("argfile2");
  
!         Files.writeString(argfile1, "--add-modules jdk.internal.ed --add-options=-Dfoo=xyzzy");
          Files.writeString(argfile2, "--vendor-version=\"XyzzyVM 3.14.15\" --vendor-bug-url=https://bugs.xyzzy.com/");
  
          var module = "base";
          helper.generateDefaultJModule(module);
          var image = helper.generateDefaultImage(new String[] {
!                 "--add-modules", "jdk.jlink,jdk.jdeps,jdk.internal.opt,jdk.compiler,java.compiler,jdk.zipfs,jdk.internal.ed",
                  "--keep-packaged-modules", "images/base.image/jmods",
                  "--save-jlink-argfiles", argfile1 + File.pathSeparator + argfile2
              }, module)
              .assertSuccess();
          helper.checkImage(image, module, null, null);

*** 102,9 ***
          oa.stderrShouldMatch("java.vendor.version = XyzzyVM 3.14.15");
          oa.stderrShouldMatch("foo = xyzzy");
  
          // Ensure the saved `--add-modules` option
          // was applied when creating the secondary image.
!         oa = ProcessTools.executeProcess(launcher.toString(), "-d", "jdk.internal.vm.ci");
          oa.shouldHaveExitValue(0);
      }
  }
--- 101,9 ---
          oa.stderrShouldMatch("java.vendor.version = XyzzyVM 3.14.15");
          oa.stderrShouldMatch("foo = xyzzy");
  
          // Ensure the saved `--add-modules` option
          // was applied when creating the secondary image.
!         oa = ProcessTools.executeProcess(launcher.toString(), "-d", "jdk.internal.ed");
          oa.shouldHaveExitValue(0);
      }
  }
< prev index next >