use of javax.management.modelmbean.ModelMBeanInfo 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.ModelMBeanInfo 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.ModelMBeanInfo 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);
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractMetadataAssemblerTests method testManagedResourceDescriptor.
@Test
public void testManagedResourceDescriptor() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
Descriptor desc = info.getMBeanDescriptor();
assertEquals("Logging should be set to true", "true", desc.getFieldValue("log"));
assertEquals("Log file should be jmx.log", "jmx.log", desc.getFieldValue("logFile"));
assertEquals("Currency Time Limit should be 15", "15", desc.getFieldValue("currencyTimeLimit"));
assertEquals("Persist Policy should be OnUpdate", "OnUpdate", desc.getFieldValue("persistPolicy"));
assertEquals("Persist Period should be 200", "200", desc.getFieldValue("persistPeriod"));
assertEquals("Persist Location should be foo", "./foo", desc.getFieldValue("persistLocation"));
assertEquals("Persist Name should be bar", "bar.jmx", desc.getFieldValue("persistName"));
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractMetadataAssemblerTests method testAttributeDescriptor.
@Test
public void testAttributeDescriptor() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
Descriptor desc = info.getAttribute(NAME_ATTRIBUTE).getDescriptor();
assertEquals("Default value should be foo", "foo", desc.getFieldValue("default"));
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"));
}
Aggregations