assertTrue("activeThreadGroupCount > 0", activeThreadGroupCountValue > 0);
// Operations
Set<ManagedOperation> ops = mc.getOperations();
log.info("ServerInfo.ops: "+ ops);
ManagedOperation listThreadCpuUtilization = ManagedOperationMatcher.findOperation(ops, "listThreadCpuUtilization");
assertNotNull(listThreadCpuUtilization);
MetaValue listThreadCpuUtilizationMV = listThreadCpuUtilization.invoke();
// TODO
assertNotNull(listThreadCpuUtilizationMV);
assertEquals(SimpleMetaType.STRING, listThreadCpuUtilizationMV.getMetaType());
SimpleValue listThreadCpuUtilizationSV = (SimpleValue) listThreadCpuUtilizationMV;
String cpuUtilization = (String) listThreadCpuUtilizationSV.getValue();
log.info(cpuUtilization);
assertTrue(cpuUtilization.length() > 100);
// Try invoking listThreadCpuUtilization and checking freeMemory until it changes
long currentFreeMemoryValue = freeMemoryValue;
for(int n = 0; n < 100; n ++)
{
listThreadCpuUtilization.invoke();
currentFreeMemoryValue = getLong(freeMemory);
if(currentFreeMemoryValue != freeMemoryValue)
break;
}
assertTrue("currentFreeMemoryValue != original freeMemoryValue",