< prev index next >

test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java

Print this page




  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 package compiler.rtm.cli;
  25 
  26 import jdk.test.lib.process.ExitCode;
  27 import jdk.test.lib.Platform;
  28 import jdk.test.lib.cli.CommandLineOptionTest;
  29 
  30 import java.util.function.BooleanSupplier;
  31 
  32 public abstract class TestPrintPreciseRTMLockingStatisticsBase
  33         extends RTMGenericCommandLineOptionTest {
  34     protected static final String DEFAULT_VALUE = "false";
  35 
  36     protected TestPrintPreciseRTMLockingStatisticsBase(
  37             BooleanSupplier predicate) {
  38         super(predicate, "PrintPreciseRTMLockingStatistics", true, false,
  39                 TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE);
  40     }
  41 
  42     @Override
  43     protected void runNonX86TestCases() throws Throwable {
  44         verifyJVMStartup();
  45         verifyOptionValues();
  46     }
  47 
  48     @Override
  49     protected void verifyJVMStartup() throws Throwable {
  50         if (Platform.isServer()) {
  51             if (!Platform.isDebugBuild()) {
  52                 String shouldFailMessage = String.format("VM option '%s' is "
  53                         + "diagnostic%nJVM startup should fail without "
  54                         + "-XX:\\+UnlockDiagnosticVMOptions flag", optionName);
  55                 String shouldPassMessage = String.format("VM option '%s' is "
  56                         + "diagnostic%nJVM startup should pass with "
  57                         + "-XX:\\+UnlockDiagnosticVMOptions in debug build",
  58                         optionName);




  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 package compiler.rtm.cli;
  25 
  26 import jdk.test.lib.process.ExitCode;
  27 import jdk.test.lib.Platform;
  28 import jdk.test.lib.cli.CommandLineOptionTest;
  29 


  30 public abstract class TestPrintPreciseRTMLockingStatisticsBase
  31         extends RTMGenericCommandLineOptionTest {
  32     protected static final String DEFAULT_VALUE = "false";
  33 
  34     protected TestPrintPreciseRTMLockingStatisticsBase() {
  35         super("PrintPreciseRTMLockingStatistics", true, false,

  36                 TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE);
  37     }
  38 
  39     @Override
  40     protected void runNonX86TestCases() throws Throwable {
  41         verifyJVMStartup();
  42         verifyOptionValues();
  43     }
  44 
  45     @Override
  46     protected void verifyJVMStartup() throws Throwable {
  47         if (Platform.isServer()) {
  48             if (!Platform.isDebugBuild()) {
  49                 String shouldFailMessage = String.format("VM option '%s' is "
  50                         + "diagnostic%nJVM startup should fail without "
  51                         + "-XX:\\+UnlockDiagnosticVMOptions flag", optionName);
  52                 String shouldPassMessage = String.format("VM option '%s' is "
  53                         + "diagnostic%nJVM startup should pass with "
  54                         + "-XX:\\+UnlockDiagnosticVMOptions in debug build",
  55                         optionName);


< prev index next >