< prev index next >

test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java

Print this page




  27  * @bug 8068579
  28  * @key gc
  29  * @library /test/lib
  30  * @requires vm.gc=="null"
  31  * @modules java.base/jdk.internal.misc
  32  *          java.management
  33  * @run driver TestDisableDefaultGC
  34  */
  35 
  36 import jdk.test.lib.process.ProcessTools;
  37 import jdk.test.lib.process.OutputAnalyzer;
  38 
  39 public class TestDisableDefaultGC {
  40     public static void main(String[] args) throws Exception {
  41         // Start VM, disabling all possible default GCs
  42         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:-UseSerialGC",
  43                                                                   "-XX:-UseParallelGC",
  44                                                                   "-XX:-UseG1GC",
  45                                                                   "-XX:-UseConcMarkSweepGC",
  46                                                                   "-XX:+UnlockExperimentalVMOptions",

  47                                                                   "-XX:-UseZGC",
  48                                                                   "-version");
  49         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  50         output.shouldMatch("Garbage collector not selected");
  51         output.shouldHaveExitValue(1);
  52     }
  53 }


  27  * @bug 8068579
  28  * @key gc
  29  * @library /test/lib
  30  * @requires vm.gc=="null"
  31  * @modules java.base/jdk.internal.misc
  32  *          java.management
  33  * @run driver TestDisableDefaultGC
  34  */
  35 
  36 import jdk.test.lib.process.ProcessTools;
  37 import jdk.test.lib.process.OutputAnalyzer;
  38 
  39 public class TestDisableDefaultGC {
  40     public static void main(String[] args) throws Exception {
  41         // Start VM, disabling all possible default GCs
  42         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:-UseSerialGC",
  43                                                                   "-XX:-UseParallelGC",
  44                                                                   "-XX:-UseG1GC",
  45                                                                   "-XX:-UseConcMarkSweepGC",
  46                                                                   "-XX:+UnlockExperimentalVMOptions",
  47                                                                   "-XX:-UseShenandoahGC",
  48                                                                   "-XX:-UseZGC",
  49                                                                   "-version");
  50         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  51         output.shouldMatch("Garbage collector not selected");
  52         output.shouldHaveExitValue(1);
  53     }
  54 }
< prev index next >