use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractJmxAssemblerTests method testAttributeInfoHasDescriptors.
@Test
public void testAttributeInfoHasDescriptors() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
ModelMBeanAttributeInfo attr = info.getAttribute(NAME_ATTRIBUTE);
Descriptor desc = attr.getDescriptor();
assertNotNull("getMethod field should not be null", desc.getFieldValue("getMethod"));
assertNotNull("setMethod field should not be null", desc.getFieldValue("setMethod"));
assertEquals("getMethod field has incorrect value", "getName", desc.getFieldValue("getMethod"));
assertEquals("setMethod field has incorrect value", "setName", desc.getFieldValue("setMethod"));
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractJmxAssemblerTests method testGetMBeanAttributeInfo.
@Test
public void testGetMBeanAttributeInfo() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
MBeanAttributeInfo[] inf = info.getAttributes();
assertEquals("Invalid number of Attributes returned", getExpectedAttributeCount(), inf.length);
for (int x = 0; x < inf.length; x++) {
assertNotNull("MBeanAttributeInfo should not be null", inf[x]);
assertNotNull("Description for MBeanAttributeInfo should not be null", inf[x].getDescription());
}
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractMetadataAssemblerTests method testDescription.
@Test
public void testDescription() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
assertEquals("The descriptions are not the same", "My Managed Bean", info.getDescription());
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractMetadataAssemblerTests method testReadOnlyAttribute.
/**
* Tests the situation where the attribute is only defined on the getter.
*/
@Test
public void testReadOnlyAttribute() throws Exception {
ModelMBeanInfo inf = getMBeanInfoFromAssembler();
ModelMBeanAttributeInfo attr = inf.getAttribute(AGE_ATTRIBUTE);
assertFalse("The age attribute should not be writable", attr.isWritable());
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractMetadataAssemblerTests method testMetricDescriptor.
@Test
public void testMetricDescriptor() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
Descriptor desc = info.getAttribute(QUEUE_SIZE_METRIC).getDescriptor();
assertEquals("Currency Time Limit should be 20", "20", desc.getFieldValue("currencyTimeLimit"));
assertEquals("Persist Policy should be OnUpdate", "OnUpdate", desc.getFieldValue("persistPolicy"));
assertEquals("Persist Period should be 300", "300", desc.getFieldValue("persistPeriod"));
assertEquals("Unit should be messages", "messages", desc.getFieldValue("units"));
assertEquals("Display Name should be Queue Size", "Queue Size", desc.getFieldValue("displayName"));
assertEquals("Metric Type should be COUNTER", "COUNTER", desc.getFieldValue("metricType"));
assertEquals("Metric Category should be utilization", "utilization", desc.getFieldValue("metricCategory"));
}
Aggregations