test/gc/arguments/TestSurvivorAlignmentInBytesOption.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 8059557_open Sdiff test/gc/arguments

test/gc/arguments/TestSurvivorAlignmentInBytesOption.java

Print this page




  28  * @test
  29  * @bug 8031323
  30  * @summary Verify SurvivorAlignmentInBytes option processing.
  31  * @library /testlibrary
  32  * @requires vm.opt.SurvivorAlignmentInBytes == null
  33  *           & vm.opt.ObjectAlignmentInBytes == null
  34  *           & vm.opt.UnlockExperimentalVMOptions == null
  35  *           & (vm.opt.IgnoreUnrecognizedVMOptions == null
  36  *              | vm.opt.IgnoreUnrecognizedVMOptions == "false")
  37  * @modules java.base/sun.misc
  38  *          java.management
  39  * @run main TestSurvivorAlignmentInBytesOption
  40  */
  41 public class TestSurvivorAlignmentInBytesOption {
  42     public static void main(String args[]) throws Throwable {
  43         String optionName = "SurvivorAlignmentInBytes";
  44         String unlockExperimentalVMOpts = "UnlockExperimentalVMOptions";
  45         String optionIsExperimental
  46                 = CommandLineOptionTest.getExperimentalOptionErrorMessage(
  47                 optionName);
  48         String valueIsTooSmall= ".*SurvivorAlignmentInBytes=.*must be greater"
  49                 + " than ObjectAlignmentInBytes.*";
  50         String mustBePowerOf2 = ".*SurvivorAlignmentInBytes=.*must be "
  51                 + "power of 2.*";
  52 
  53         // Verify that without -XX:+UnlockExperimentalVMOptions usage of
  54         // SurvivorAlignmentInBytes option will cause JVM startup failure
  55         // with the warning message saying that that option is experimental.
  56         String shouldFailMessage = String.format("JVM option '%s' is "
  57                 + "experimental.%nJVM startup should fail without "
  58                 + "-XX:+UnlockExperimentalVMOptions option", optionName);
  59         CommandLineOptionTest.verifyJVMStartup(
  60                 new String[]{optionIsExperimental}, null,
  61                 shouldFailMessage, shouldFailMessage,
  62                 ExitCode.FAIL, false,
  63                 "-XX:-UnlockExperimentalVMOptions",
  64                 CommandLineOptionTest.prepareBooleanFlag(
  65                         unlockExperimentalVMOpts, false),
  66                 CommandLineOptionTest.prepareNumericFlag(optionName, 64));
  67 
  68         // Verify that with -XX:+UnlockExperimentalVMOptions passed to JVM
  69         // usage of SurvivorAlignmentInBytes option won't cause JVM startup
  70         // failure.




  28  * @test
  29  * @bug 8031323
  30  * @summary Verify SurvivorAlignmentInBytes option processing.
  31  * @library /testlibrary
  32  * @requires vm.opt.SurvivorAlignmentInBytes == null
  33  *           & vm.opt.ObjectAlignmentInBytes == null
  34  *           & vm.opt.UnlockExperimentalVMOptions == null
  35  *           & (vm.opt.IgnoreUnrecognizedVMOptions == null
  36  *              | vm.opt.IgnoreUnrecognizedVMOptions == "false")
  37  * @modules java.base/sun.misc
  38  *          java.management
  39  * @run main TestSurvivorAlignmentInBytesOption
  40  */
  41 public class TestSurvivorAlignmentInBytesOption {
  42     public static void main(String args[]) throws Throwable {
  43         String optionName = "SurvivorAlignmentInBytes";
  44         String unlockExperimentalVMOpts = "UnlockExperimentalVMOptions";
  45         String optionIsExperimental
  46                 = CommandLineOptionTest.getExperimentalOptionErrorMessage(
  47                 optionName);
  48         String valueIsTooSmall= ".*SurvivorAlignmentInBytes.*must be greater"
  49                 + " than or equal to ObjectAlignmentInBytes.*";
  50         String mustBePowerOf2 = ".*SurvivorAlignmentInBytes.*must be "
  51                 + "power of 2.*";
  52 
  53         // Verify that without -XX:+UnlockExperimentalVMOptions usage of
  54         // SurvivorAlignmentInBytes option will cause JVM startup failure
  55         // with the warning message saying that that option is experimental.
  56         String shouldFailMessage = String.format("JVM option '%s' is "
  57                 + "experimental.%nJVM startup should fail without "
  58                 + "-XX:+UnlockExperimentalVMOptions option", optionName);
  59         CommandLineOptionTest.verifyJVMStartup(
  60                 new String[]{optionIsExperimental}, null,
  61                 shouldFailMessage, shouldFailMessage,
  62                 ExitCode.FAIL, false,
  63                 "-XX:-UnlockExperimentalVMOptions",
  64                 CommandLineOptionTest.prepareBooleanFlag(
  65                         unlockExperimentalVMOpts, false),
  66                 CommandLineOptionTest.prepareNumericFlag(optionName, 64));
  67 
  68         // Verify that with -XX:+UnlockExperimentalVMOptions passed to JVM
  69         // usage of SurvivorAlignmentInBytes option won't cause JVM startup
  70         // failure.


test/gc/arguments/TestSurvivorAlignmentInBytesOption.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File