use of javax.management.modelmbean.ModelMBeanAttributeInfo 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.ModelMBeanAttributeInfo 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.ModelMBeanAttributeInfo in project spring-framework by spring-projects.
the class AbstractMetadataAssemblerTests method testAttributeDescriptionOnGetter.
@Test
public void testAttributeDescriptionOnGetter() throws Exception {
ModelMBeanInfo inf = getMBeanInfoFromAssembler();
ModelMBeanAttributeInfo attr = inf.getAttribute(NAME_ATTRIBUTE);
assertEquals("The description for the name attribute is incorrect", "The Name Attribute", attr.getDescription());
}
use of javax.management.modelmbean.ModelMBeanAttributeInfo in project spring-framework by spring-projects.
the class AbstractMetadataAssemblerTests method testAttributeDescriptionOnSetter.
@Test
public void testAttributeDescriptionOnSetter() throws Exception {
ModelMBeanInfo inf = getMBeanInfoFromAssembler();
ModelMBeanAttributeInfo attr = inf.getAttribute(AGE_ATTRIBUTE);
assertEquals("The description for the age attribute is incorrect", "The Age Attribute", attr.getDescription());
}
use of javax.management.modelmbean.ModelMBeanAttributeInfo in project spring-framework by spring-projects.
the class AbstractMetadataAssemblerTests method testWithOnlyGetter.
/**
* Tests the situation where the property only has a setter.
*/
@Test
public void testWithOnlyGetter() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
ModelMBeanAttributeInfo attr = info.getAttribute("Superman");
assertNotNull("Attribute should not be null", attr);
}
Aggregations