< prev index next >

test/gc/arguments/TestInitialTenuringThreshold.java

Print this page




  52 
  53 
  54   public static void main(String args[]) throws Exception {
  55     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  56       // some value below the default value of InitialTenuringThreshold of 7
  57       "-XX:MaxTenuringThreshold=1",
  58       "-version"
  59       );
  60 
  61     OutputAnalyzer output = new OutputAnalyzer(pb.start());
  62     output.shouldHaveExitValue(0);
  63     // successful tests
  64     runWithThresholds(0, 10, false);
  65     runWithThresholds(5, 5, false);
  66     runWithThresholds(8, 16, false);
  67     // failing tests
  68     runWithThresholds(10, 0, true);
  69     runWithThresholds(9, 8, true);
  70     runWithThresholds(-1, 8, true);
  71     runWithThresholds(8, -1, true);
  72     runWithThresholds(16, 8, true);
  73     runWithThresholds(8, 17, true);
  74   }
  75 }


  52 
  53 
  54   public static void main(String args[]) throws Exception {
  55     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
  56       // some value below the default value of InitialTenuringThreshold of 7
  57       "-XX:MaxTenuringThreshold=1",
  58       "-version"
  59       );
  60 
  61     OutputAnalyzer output = new OutputAnalyzer(pb.start());
  62     output.shouldHaveExitValue(0);
  63     // successful tests
  64     runWithThresholds(0, 10, false);
  65     runWithThresholds(5, 5, false);
  66     runWithThresholds(8, 16, false);
  67     // failing tests
  68     runWithThresholds(10, 0, true);
  69     runWithThresholds(9, 8, true);
  70     runWithThresholds(-1, 8, true);
  71     runWithThresholds(8, -1, true);
  72     runWithThresholds(32, 8, true);
  73     runWithThresholds(8, 33, true);
  74   }
  75 }
< prev index next >