< prev index next >

test/sun/management/HotspotThreadMBean/GetInternalThreads.java

Print this page
rev 16783 : 8176176: fix @modules in jdk_svc tests
Reviewed-by: duke


  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
  26  * @bug     4530538
  27  * @summary Basic Test for HotspotThreadMBean.getInternalThreadCount()
  28  *          and getInternalThreadCpuTime()
  29  * @author  Mandy Chung
  30  * @modules java.management/sun.management
  31  * @run main/othervm -XX:+UsePerfData GetInternalThreads
  32  */
  33 
  34 import sun.management.*;
  35 import java.util.*;
  36 import java.lang.management.ThreadMXBean;
  37 import java.lang.management.ManagementFactory;
  38 
  39 public class GetInternalThreads {
  40     private final static HotspotThreadMBean mbean =
  41         ManagementFactoryHelper.getHotspotThreadMBean();
  42 
  43     // Minimum number of VM internal threads
  44     //   VM thread, watcher thread, Low memory detector, compiler thread
  45     private static final long MIN_VALUE_FOR_PASS = 4;
  46     private static final long MAX_VALUE_FOR_PASS = Long.MAX_VALUE;
  47 
  48     public static void main(String[] args) throws Exception {
  49         long value = mbean.getInternalThreadCount();
  50 




  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
  26  * @bug     4530538
  27  * @summary Basic Test for HotspotThreadMBean.getInternalThreadCount()
  28  *          and getInternalThreadCpuTime()
  29  * @author  Mandy Chung
  30  *
  31  * @run main/othervm -XX:+UsePerfData GetInternalThreads
  32  */
  33 
  34 import sun.management.*;
  35 import java.util.*;
  36 import java.lang.management.ThreadMXBean;
  37 import java.lang.management.ManagementFactory;
  38 
  39 public class GetInternalThreads {
  40     private final static HotspotThreadMBean mbean =
  41         ManagementFactoryHelper.getHotspotThreadMBean();
  42 
  43     // Minimum number of VM internal threads
  44     //   VM thread, watcher thread, Low memory detector, compiler thread
  45     private static final long MIN_VALUE_FOR_PASS = 4;
  46     private static final long MAX_VALUE_FOR_PASS = Long.MAX_VALUE;
  47 
  48     public static void main(String[] args) throws Exception {
  49         long value = mbean.getInternalThreadCount();
  50 


< prev index next >