test/testlibrary/com/oracle/java/testlibrary/TestDynamicVMOption.java

Print this page




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 package com.oracle.java.testlibrary;
  24 
  25 /**
  26  * Simple class to check writeability, invalid and valid values for concrete VMOption
  27  */
  28 public class TestDynamicVMOption {



  29 
  30     private final String name;
  31     private final int value;
  32 
  33     /**
  34      * Constructor
  35      *
  36      * @param name of VM option to test
  37      */
  38     public TestDynamicVMOption(String name) {
  39         this.name = name;
  40         this.value = DynamicVMOptionChecker.getIntValue(name);
  41         System.out.println(this.name + " = " + this.value);
  42     }
  43 
  44     /**
  45      * Checks that this value can accept valid percentage values and cannot accept invalid percentage values
  46      *
  47      * @throws RuntimeException
  48      */




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 package com.oracle.java.testlibrary;
  24 
  25 /**
  26  * Simple class to check writability, invalid and valid values for concrete VMOption
  27  */
  28 public class TestDynamicVMOption {
  29 
  30     public static final String MIN_FREE_RATIO_FLAG_NAME = "MinHeapFreeRatio";
  31     public static final String MAX_FREE_RATIO_FLAG_NAME = "MaxHeapFreeRatio";
  32 
  33     private final String name;
  34     private final int value;
  35 
  36     /**
  37      * Constructor
  38      *
  39      * @param name of VM option to test
  40      */
  41     public TestDynamicVMOption(String name) {
  42         this.name = name;
  43         this.value = DynamicVMOptionChecker.getIntValue(name);
  44         System.out.println(this.name + " = " + this.value);
  45     }
  46 
  47     /**
  48      * Checks that this value can accept valid percentage values and cannot accept invalid percentage values
  49      *
  50      * @throws RuntimeException
  51      */