use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class MethodExclusionMBeanInfoAssemblerNotMappedTests method testGetAgeIsReadOnly.
@Test
public void testGetAgeIsReadOnly() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
ModelMBeanAttributeInfo attr = info.getAttribute(AGE_ATTRIBUTE);
assertThat(attr.isReadable()).as("Age is not readable").isTrue();
assertThat(attr.isWritable()).as("Age is not writable").isTrue();
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractJmxAssemblerTests method testGetMBeanOperationInfo.
@Test
public void testGetMBeanOperationInfo() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
MBeanOperationInfo[] inf = info.getOperations();
assertThat(inf).as("Invalid number of Operations returned").hasSize(getExpectedOperationCount());
for (MBeanOperationInfo element : inf) {
assertThat(element).as("MBeanOperationInfo should not be null").isNotNull();
assertThat(element.getDescription()).as("Description for MBeanOperationInfo should not be null").isNotNull();
}
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractJmxAssemblerTests method getMBeanInfoFromAssembler.
protected ModelMBeanInfo getMBeanInfoFromAssembler() throws Exception {
IJmxTestBean bean = getBean();
ModelMBeanInfo info = getAssembler().getMBeanInfo(bean, getObjectName());
return info;
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractJmxAssemblerTests method testNotificationMetadata.
@Test
public void testNotificationMetadata() throws Exception {
ModelMBeanInfo info = (ModelMBeanInfo) getMBeanInfo();
MBeanNotificationInfo[] notifications = info.getNotifications();
assertThat(notifications).as("Incorrect number of notifications").hasSize(1);
assertThat(notifications[0].getName()).as("Incorrect notification name").isEqualTo("My Notification");
String[] notifTypes = notifications[0].getNotifTypes();
assertThat(notifTypes).as("Incorrect number of notification types").hasSize(2);
assertThat(notifTypes[0]).as("Notification type.foo not found").isEqualTo("type.foo");
assertThat(notifTypes[1]).as("Notification type.bar not found").isEqualTo("type.bar");
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractJmxAssemblerTests method testAttributeHasCorrespondingOperations.
@Test
public void testAttributeHasCorrespondingOperations() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
ModelMBeanOperationInfo get = info.getOperation("getName");
assertThat(get).as("get operation should not be null").isNotNull();
assertThat(Integer.valueOf(4)).as("get operation should have visibility of four").isEqualTo(get.getDescriptor().getFieldValue("visibility"));
assertThat(get.getDescriptor().getFieldValue("role")).as("get operation should have role \"getter\"").isEqualTo("getter");
ModelMBeanOperationInfo set = info.getOperation("setName");
assertThat(set).as("set operation should not be null").isNotNull();
assertThat(Integer.valueOf(4)).as("set operation should have visibility of four").isEqualTo(set.getDescriptor().getFieldValue("visibility"));
assertThat(set.getDescriptor().getFieldValue("role")).as("set operation should have role \"setter\"").isEqualTo("setter");
}
Aggregations