* Test method for 'java.lang.management.ThreadInfo.from(CompositeData)'
* with more than 13 essential fields
*/
public void test_from_fields() throws Exception {
Object stackTraceElementData = createGoodStackTraceCompositeData();
CompositeType stackTraceElementType = createGoodStackTraceElementCompositeType();
String[] names = { "threadId", "threadName", "threadState",
"suspended", "inNative", "blockedCount", "blockedTime",
"waitedCount", "waitedTime", "lockName", "lockOwnerId",
"lockOwnerName", "stackTrace", "additionalName" };
Object[] values = { 1L, "threadName", GOOD_THREAD_STATE.toString(),
true, false, 1L, 500L, 1L, 1L, "lock", 2L, "lockOwner",
stackTraceElementData, "additionalValue" };
OpenType[] types = { SimpleType.LONG, SimpleType.STRING,
SimpleType.STRING, SimpleType.BOOLEAN, SimpleType.BOOLEAN,
SimpleType.LONG, SimpleType.LONG, SimpleType.LONG,
SimpleType.LONG, SimpleType.STRING, SimpleType.LONG,
SimpleType.STRING, new ArrayType(1, stackTraceElementType),
SimpleType.STRING };
CompositeType compositeType = new CompositeType(ThreadInfo.class
.getName(), ThreadInfo.class.getName(), names, names, types);
CompositeData data = new CompositeDataSupport(compositeType, names,
values);
ThreadInfo threadInfo = ThreadInfo.from(data);
assertEquals(values[0], threadInfo.getThreadId());