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 import java.util.Objects;
43
44 public class ThreadInfoCompositeData {
45 private static StackTraceElement[] ste = new StackTraceElement[1];
46 private static CompositeData[] steCD = new CompositeData[1];
47 private static String lockClassName = "myClass";
48 private static int lockIdentityHashCode = 123456;
49 private static String lockName = lockClassName + '@' +
50 Integer.toHexString(lockIdentityHashCode);
51 private static LockInfo lockInfo =
52 new LockInfo(lockClassName, lockIdentityHashCode);
|
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 import java.util.Objects;
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);
|