test/gc/arguments/TestInitialTenuringThreshold.java

Print this page




  46     if (shouldfail) {
  47       output.shouldHaveExitValue(1);
  48     } else {
  49       output.shouldHaveExitValue(0);
  50     }
  51   }
  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     // failing tests
  67     runWithThresholds(10, 0, true);
  68     runWithThresholds(9, 8, true);
  69     runWithThresholds(-1, 8, true);
  70     runWithThresholds(8, -1, true);
  71     runWithThresholds(8, 16, true);
  72     runWithThresholds(16, 8, true);

  73   }
  74 }
  75 


  46     if (shouldfail) {
  47       output.shouldHaveExitValue(1);
  48     } else {
  49       output.shouldHaveExitValue(0);
  50     }
  51   }
  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 }