< prev index next >

test/testlibrary_tests/whitebox/vm_flags/BooleanTest.java

Print this page


   1 /*
   2  * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   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 /*
  25  * @test BooleanTest
  26  * @bug 8028756
  27  * @library /testlibrary /test/lib
  28  * @modules java.base/jdk.internal.misc
  29  *          java.compiler
  30  *          java.management/sun.management
  31  *          jdk.jvmstat/sun.jvmstat.monitor
  32  * @build BooleanTest ClassFileInstaller sun.hotspot.WhiteBox jdk.test.lib.*
  33  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  34  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  35  * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI BooleanTest
  36  * @summary testing of WB::set/getBooleanVMFlag()
  37  * @author igor.ignatyev@oracle.com
  38  */
  39 
  40 import sun.hotspot.WhiteBox;
  41 import jdk.test.lib.*;

  42 import sun.management.*;
  43 import com.sun.management.*;
  44 
  45 public class BooleanTest {
  46     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
  47     private static final Boolean[] TESTS = {true, false, true, true, false};
  48     private static final String TEST_NAME = "BooleanTest";
  49     private static final String FLAG_NAME = "PrintCompilation";
  50     private static final String FLAG_DEBUG_NAME = "SafepointALot";
  51     private static final String METHOD = TEST_NAME + "::method";
  52     private static final String METHOD1 = METHOD + "1";
  53     private static final String METHOD2 = METHOD + "2";
  54 
  55     public static void main(String[] args) throws Exception {
  56         if (args.length == 0) {
  57             VmFlagTest.runTest(FLAG_NAME, TESTS,
  58                 VmFlagTest.WHITE_BOX::setBooleanVMFlag,
  59                 VmFlagTest.WHITE_BOX::getBooleanVMFlag);
  60             testFunctional(false);
  61             testFunctional(true);


   1 /*
   2  * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   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 /*
  25  * @test BooleanTest
  26  * @bug 8028756
  27  * @library /test/lib
  28  * @modules java.base/jdk.internal.misc
  29  *          java.compiler
  30  *          java.management/sun.management
  31  *          jdk.jvmstat/sun.jvmstat.monitor
  32  * @build sun.hotspot.WhiteBox
  33  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  34  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  35  * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI BooleanTest
  36  * @summary testing of WB::set/getBooleanVMFlag()
  37  * @author igor.ignatyev@oracle.com
  38  */
  39 
  40 import sun.hotspot.WhiteBox;
  41 import jdk.test.lib.process.OutputAnalyzer;
  42 import jdk.test.lib.process.ProcessTools;
  43 import sun.management.*;
  44 import com.sun.management.*;
  45 
  46 public class BooleanTest {
  47     private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
  48     private static final Boolean[] TESTS = {true, false, true, true, false};
  49     private static final String TEST_NAME = "BooleanTest";
  50     private static final String FLAG_NAME = "PrintCompilation";
  51     private static final String FLAG_DEBUG_NAME = "SafepointALot";
  52     private static final String METHOD = TEST_NAME + "::method";
  53     private static final String METHOD1 = METHOD + "1";
  54     private static final String METHOD2 = METHOD + "2";
  55 
  56     public static void main(String[] args) throws Exception {
  57         if (args.length == 0) {
  58             VmFlagTest.runTest(FLAG_NAME, TESTS,
  59                 VmFlagTest.WHITE_BOX::setBooleanVMFlag,
  60                 VmFlagTest.WHITE_BOX::getBooleanVMFlag);
  61             testFunctional(false);
  62             testFunctional(true);


< prev index next >