1 /*
2 * Copyright (c) 2004, 2005, 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
26 * @bug 4982289
27 * @summary Test ThreadInfo.from to return a valid
28 * ThreadInfo object. Or throw exception if
29 * the input CompositeData is invalid.
30 * @author Mandy Chung
31 *
32 * @compile OpenTypeConverter.java
33 * @build ThreadInfoCompositeData
34 * @run main ThreadInfoCompositeData
35 */
36
37 import javax.management.openmbean.*;
38 import java.lang.management.LockInfo;
39 import java.lang.management.MonitorInfo;
40 import java.lang.management.ThreadInfo;
41
42 public class ThreadInfoCompositeData {
43 private static StackTraceElement[] ste = new StackTraceElement[1];
44 private static CompositeData[] steCD = new CompositeData[1];
45 private static String lockClassName = "myClass";
46 private static int lockIdentityHashCode = 123456;
47 private static String lockName = lockClassName + '@' +
48 Integer.toHexString(lockIdentityHashCode);
49 private static LockInfo lockInfo =
50 new LockInfo(lockClassName, lockIdentityHashCode);
51
|
1 /*
2 * Copyright (c) 2004, 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
26 * @bug 4982289
27 * @summary Test ThreadInfo.from to return a valid
28 * ThreadInfo object. Or throw exception if
29 * the input CompositeData is invalid.
30 * @author Mandy Chung
31 *
32 * @modules java.management
33 * @compile OpenTypeConverter.java
34 * @build ThreadInfoCompositeData
35 * @run main ThreadInfoCompositeData
36 */
37
38 import javax.management.openmbean.*;
39 import java.lang.management.LockInfo;
40 import java.lang.management.MonitorInfo;
41 import java.lang.management.ThreadInfo;
42
43 public class ThreadInfoCompositeData {
44 private static StackTraceElement[] ste = new StackTraceElement[1];
45 private static CompositeData[] steCD = new CompositeData[1];
46 private static String lockClassName = "myClass";
47 private static int lockIdentityHashCode = 123456;
48 private static String lockName = lockClassName + '@' +
49 Integer.toHexString(lockIdentityHashCode);
50 private static LockInfo lockInfo =
51 new LockInfo(lockClassName, lockIdentityHashCode);
52
|