< prev index next >

test/gc/arguments/TestInitialTenuringThreshold.java

Print this page
rev 8851 : [mq]: webrev.00


  22 */
  23 
  24 /*
  25  * @test TestInitialTenuringThreshold
  26  * @key gc
  27  * @bug 8014765
  28  * @summary Tests argument processing for initial tenuring threshold
  29  * @library /testlibrary
  30  * @modules java.base/sun.misc
  31  *          java.management
  32  * @run main/othervm TestInitialTenuringThreshold
  33  * @author thomas.schatzl@oracle.com
  34  */
  35 
  36 import jdk.test.lib.*;
  37 
  38 public class TestInitialTenuringThreshold {
  39 
  40   public static void runWithThresholds(int initial, int max, boolean shouldfail) throws Exception {
  41     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(

  42       "-XX:InitialTenuringThreshold=" + String.valueOf(initial),
  43       "-XX:MaxTenuringThreshold=" + String.valueOf(max),
  44       "-version"
  45       );
  46 
  47     OutputAnalyzer output = new OutputAnalyzer(pb.start());
  48     if (shouldfail) {
  49       output.shouldHaveExitValue(1);
  50     } else {
  51       output.shouldHaveExitValue(0);
  52     }
  53   }
  54 
  55 
  56   public static void main(String args[]) throws Exception {
  57     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  58       // some value below the default value of InitialTenuringThreshold of 7
  59       "-XX:MaxTenuringThreshold=1",
  60       "-version"
  61       );


  22 */
  23 
  24 /*
  25  * @test TestInitialTenuringThreshold
  26  * @key gc
  27  * @bug 8014765
  28  * @summary Tests argument processing for initial tenuring threshold
  29  * @library /testlibrary
  30  * @modules java.base/sun.misc
  31  *          java.management
  32  * @run main/othervm TestInitialTenuringThreshold
  33  * @author thomas.schatzl@oracle.com
  34  */
  35 
  36 import jdk.test.lib.*;
  37 
  38 public class TestInitialTenuringThreshold {
  39 
  40   public static void runWithThresholds(int initial, int max, boolean shouldfail) throws Exception {
  41     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  42       "-XX:+UseParallelGC",
  43       "-XX:InitialTenuringThreshold=" + String.valueOf(initial),
  44       "-XX:MaxTenuringThreshold=" + String.valueOf(max),
  45       "-version"
  46       );
  47 
  48     OutputAnalyzer output = new OutputAnalyzer(pb.start());
  49     if (shouldfail) {
  50       output.shouldHaveExitValue(1);
  51     } else {
  52       output.shouldHaveExitValue(0);
  53     }
  54   }
  55 
  56 
  57   public static void main(String args[]) throws Exception {
  58     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  59       // some value below the default value of InitialTenuringThreshold of 7
  60       "-XX:MaxTenuringThreshold=1",
  61       "-version"
  62       );
< prev index next >