assertTrue(attribute.isReadable());
assertFalse(attribute.isWritable());
// Check that both methods are exposed
MBeanOperationInfo[] operations = mBeanInfo.getOperations();
assertEquals(2, operations.length);
MBeanOperationInfo getOperation;
MBeanOperationInfo setOperation;
// Order is not important
if (operations[0].getName().equals("getIntegerValue")) {
getOperation = operations[0];
setOperation = operations[1];
} else {
setOperation = operations[0];
getOperation = operations[1];
}
// Check the 'get' operation
assertEquals("getIntegerValue", getOperation.getName());
assertEquals("Get the value of the integer",
getOperation.getDescription());
assertEquals("int", getOperation.getReturnType());
MBeanParameterInfo[] getOperationParams = getOperation.getSignature();
assertEquals(0, getOperationParams.length);
// Check the 'set' operation
assertEquals("setIntegerValue", setOperation.getName());
assertEquals("Set the value of the integer",
setOperation.getDescription());
assertEquals("int", setOperation.getReturnType());
MBeanParameterInfo[] setOperationParams = setOperation.getSignature();
assertEquals(1, setOperationParams.length);
assertEquals("int", setOperationParams[0].getType());
// Call the methods and test the result, also test notifications
CustomNotificationListener listener = new CustomNotificationListener();
m_server.addNotificationListener(objectName, listener, null, null);