use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractMetadataAssemblerTests method testReadWriteAttribute.
@Test
public void testReadWriteAttribute() throws Exception {
ModelMBeanInfo inf = getMBeanInfoFromAssembler();
ModelMBeanAttributeInfo attr = inf.getAttribute(NAME_ATTRIBUTE);
assertThat(attr.isWritable()).as("The name attribute should be writable").isTrue();
assertThat(attr.isReadable()).as("The name attribute should be readable").isTrue();
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractMetadataAssemblerTests method testWithOnlySetter.
/**
* Tests the situation where the property only has a getter.
*/
@Test
public void testWithOnlySetter() throws Exception {
ModelMBeanInfo inf = getMBeanInfoFromAssembler();
ModelMBeanAttributeInfo attr = inf.getAttribute("NickName");
assertThat(attr).as("Attribute should not be null").isNotNull();
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractMetadataAssemblerTests method testMetricDescriptorDefaults.
@Test
public void testMetricDescriptorDefaults() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
Descriptor desc = info.getAttribute(CACHE_ENTRIES_METRIC).getDescriptor();
assertThat(desc.getFieldValue("currencyTimeLimit")).as("Currency Time Limit should not be populated").isNull();
assertThat(desc.getFieldValue("persistPolicy")).as("Persist Policy should not be populated").isNull();
assertThat(desc.getFieldValue("persistPeriod")).as("Persist Period should not be populated").isNull();
assertThat(desc.getFieldValue("units")).as("Unit should not be populated").isNull();
assertThat(desc.getFieldValue("displayName")).as("Display Name should be populated by default via JMX").isEqualTo(CACHE_ENTRIES_METRIC);
assertThat(desc.getFieldValue("metricType")).as("Metric Type should be GAUGE").isEqualTo("GAUGE");
assertThat(desc.getFieldValue("metricCategory")).as("Metric Category should not be populated").isNull();
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractMetadataAssemblerTests method testMetricDescription.
@Test
public void testMetricDescription() throws Exception {
ModelMBeanInfo inf = getMBeanInfoFromAssembler();
ModelMBeanAttributeInfo metric = inf.getAttribute(QUEUE_SIZE_METRIC);
ModelMBeanOperationInfo operation = inf.getOperation("getQueueSize");
assertThat(metric.getDescription()).as("The description for the queue size metric is incorrect").isEqualTo("The QueueSize metric");
assertThat(operation.getDescription()).as("The description for the getter operation of the queue size metric is incorrect").isEqualTo("The QueueSize metric");
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class MethodExclusionMBeanInfoAssemblerNotMappedTests method testNickNameIsExposed.
@Test
public void testNickNameIsExposed() throws Exception {
ModelMBeanInfo inf = (ModelMBeanInfo) getMBeanInfo();
MBeanAttributeInfo attr = inf.getAttribute("NickName");
assertThat(attr).as("Nick Name should not be null").isNotNull();
assertThat(attr.isWritable()).as("Nick Name should be writable").isTrue();
assertThat(attr.isReadable()).as("Nick Name should be readable").isTrue();
}
Aggregations