< prev index next >

test/runtime/SharedArchiveFile/LimitSharedSizes.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 
  24 /* @test LimitSharedSizes
  25  * @summary Test handling of limits on shared space size
  26  * @library /testlibrary /runtime/CommandLine/OptionsValidation/common
  27  * @modules java.base/jdk.internal.misc
  28  *          java.management
  29  *          jdk.attach/sun.tools.attach
  30  * @run main LimitSharedSizes
  31  */
  32 
  33 import jdk.test.lib.*;


  34 import optionsvalidation.JVMOptionsUtils;
  35 
  36 public class LimitSharedSizes {
  37     static enum Result {
  38         OUT_OF_RANGE,
  39         TOO_SMALL,
  40         VALID,
  41         VALID_ARCHIVE
  42     }
  43 
  44     static enum Region {
  45         RO, RW, MD, MC
  46     }
  47 
  48     private static final boolean fitsRange(String name, String value) throws RuntimeException {
  49         boolean fits = true;
  50         try {
  51             fits = JVMOptionsUtils.fitsRange(name, value);
  52         } catch (Exception e) {
  53             throw new RuntimeException(e.getMessage());




   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 
  24 /* @test LimitSharedSizes
  25  * @summary Test handling of limits on shared space size
  26  * @library /test/lib /runtime/CommandLine/OptionsValidation/common
  27  * @modules java.base/jdk.internal.misc
  28  *          java.management
  29  *          jdk.attach/sun.tools.attach
  30  * @run main LimitSharedSizes
  31  */
  32 
  33 import jdk.test.lib.process.ProcessTools;
  34 import jdk.test.lib.process.OutputAnalyzer;
  35 import jdk.test.lib.Platform;
  36 import optionsvalidation.JVMOptionsUtils;
  37 
  38 public class LimitSharedSizes {
  39     static enum Result {
  40         OUT_OF_RANGE,
  41         TOO_SMALL,
  42         VALID,
  43         VALID_ARCHIVE
  44     }
  45 
  46     static enum Region {
  47         RO, RW, MD, MC
  48     }
  49 
  50     private static final boolean fitsRange(String name, String value) throws RuntimeException {
  51         boolean fits = true;
  52         try {
  53             fits = JVMOptionsUtils.fitsRange(name, value);
  54         } catch (Exception e) {
  55             throw new RuntimeException(e.getMessage());


< prev index next >