< prev index next >

test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java

Print this page




  34 
  35 import java.util.ArrayList;
  36 import java.util.List;
  37 import java.util.Map;
  38 import jdk.test.lib.Asserts;
  39 import optionsvalidation.JVMOption;
  40 import optionsvalidation.JVMOptionsUtils;
  41 
  42 public class TestOptionsWithRanges {
  43 
  44     public static void main(String[] args) throws Exception {
  45         int failedTests;
  46         Map<String, JVMOption> allOptionsAsMap = JVMOptionsUtils.getOptionsWithRangeAsMap();
  47         List<JVMOption> allOptions;
  48 
  49         /*
  50          * Remove CICompilerCount from testing because currently it can hang system
  51          */
  52         allOptionsAsMap.remove("CICompilerCount");
  53 








  54         allOptions = new ArrayList<>(allOptionsAsMap.values());
  55 
  56         Asserts.assertGT(allOptions.size(), 0, "Options with ranges not found!");
  57 
  58         System.out.println("Parsed " + allOptions.size() + " options with ranges. Start test!");
  59 
  60         failedTests = JVMOptionsUtils.runCommandLineTests(allOptions);
  61 
  62         Asserts.assertEQ(failedTests, 0,
  63                 String.format("%d tests failed! %s", failedTests, JVMOptionsUtils.getMessageWithFailures()));
  64     }
  65 }


  34 
  35 import java.util.ArrayList;
  36 import java.util.List;
  37 import java.util.Map;
  38 import jdk.test.lib.Asserts;
  39 import optionsvalidation.JVMOption;
  40 import optionsvalidation.JVMOptionsUtils;
  41 
  42 public class TestOptionsWithRanges {
  43 
  44     public static void main(String[] args) throws Exception {
  45         int failedTests;
  46         Map<String, JVMOption> allOptionsAsMap = JVMOptionsUtils.getOptionsWithRangeAsMap();
  47         List<JVMOption> allOptions;
  48 
  49         /*
  50          * Remove CICompilerCount from testing because currently it can hang system
  51          */
  52         allOptionsAsMap.remove("CICompilerCount");
  53 
  54         /*
  55          * Exclude below options as the maximum value of them would consume too much momory.
  56          * And this would affect to other tests that running in parallel.
  57          */
  58         allOptionsAsMap.remove("G1ConcRefinementThreads");
  59         allOptionsAsMap.remove("G1RSetRegionEntries");
  60         allOptionsAsMap.remove("G1RSetSparseRegionEntries");
  61 
  62         allOptions = new ArrayList<>(allOptionsAsMap.values());
  63 
  64         Asserts.assertGT(allOptions.size(), 0, "Options with ranges not found!");
  65 
  66         System.out.println("Parsed " + allOptions.size() + " options with ranges. Start test!");
  67 
  68         failedTests = JVMOptionsUtils.runCommandLineTests(allOptions);
  69 
  70         Asserts.assertEQ(failedTests, 0,
  71                 String.format("%d tests failed! %s", failedTests, JVMOptionsUtils.getMessageWithFailures()));
  72     }
  73 }
< prev index next >