TestRTMTotalCountIncrRateOptionOnSupportedConfig.java revision 11707:ad7af1afda7a
198944Sobrien/*
298944Sobrien * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
3130803Smarcel * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4130803Smarcel *
598944Sobrien * This code is free software; you can redistribute it and/or modify it
698944Sobrien * under the terms of the GNU General Public License version 2 only, as
798944Sobrien * published by the Free Software Foundation.
898944Sobrien *
998944Sobrien * This code is distributed in the hope that it will be useful, but WITHOUT
1098944Sobrien * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1198944Sobrien * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1298944Sobrien * version 2 for more details (a copy is included in the LICENSE file that
1398944Sobrien * accompanied this code).
1498944Sobrien *
1598944Sobrien * You should have received a copy of the GNU General Public License version
1698944Sobrien * 2 along with this work; if not, write to the Free Software Foundation,
1798944Sobrien * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1898944Sobrien *
1998944Sobrien * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2098944Sobrien * or visit www.oracle.com if you need additional information or have any
2198944Sobrien * questions.
2298944Sobrien *
2398944Sobrien */
2498944Sobrien
2598944Sobrien/**
2698944Sobrien * @test
2798944Sobrien * @bug 8031320
2898944Sobrien * @summary Verify RTMTotalCountIncrRate option processing on CPU with
2998944Sobrien *          rtm support and on VM with rtm locking support.
3098944Sobrien * @library /testlibrary /test/lib /
3198944Sobrien * @modules java.base/jdk.internal.misc
3298944Sobrien *          java.management
3398944Sobrien *
3498944Sobrien * @build compiler.rtm.cli.TestRTMTotalCountIncrRateOptionOnSupportedConfig
3598944Sobrien * @run driver ClassFileInstaller sun.hotspot.WhiteBox
3698944Sobrien *                                sun.hotspot.WhiteBox$WhiteBoxPermission
3798944Sobrien * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
3898944Sobrien *                   -XX:+WhiteBoxAPI
3998944Sobrien *                   compiler.rtm.cli.TestRTMTotalCountIncrRateOptionOnSupportedConfig
4098944Sobrien */
4198944Sobrien
4298944Sobrienpackage compiler.rtm.cli;
4398944Sobrien
4498944Sobrienpublic class TestRTMTotalCountIncrRateOptionOnSupportedConfig
4598944Sobrien        extends RTMLockingAwareTest {
4698944Sobrien    private static final String DEFAULT_VALUE = "64";
4798944Sobrien
4898944Sobrien    private TestRTMTotalCountIncrRateOptionOnSupportedConfig() {
4998944Sobrien        super("RTMTotalCountIncrRate", false, true,
5098944Sobrien                TestRTMTotalCountIncrRateOptionOnSupportedConfig.DEFAULT_VALUE,
5198944Sobrien                /* correct values */
5298944Sobrien                new String[] { "1", "2", "128", "1024" },
5398944Sobrien                /* incorrect values */
5498944Sobrien                new String[] { "-1", "0", "3", "42" },
5598944Sobrien                RTMGenericCommandLineOptionTest.RTM_COUNT_INCR_WARNING);
5698944Sobrien    }
5798944Sobrien
5898944Sobrien    public static void main(String args[]) throws Throwable {
5998944Sobrien        new TestRTMTotalCountIncrRateOptionOnSupportedConfig().test();
6098944Sobrien    }
6198944Sobrien}
62130803Smarcel