use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class MethodNameBasedMBeanInfoAssemblerTests method testSetNameParameterIsNamed.
@Test
public void testSetNameParameterIsNamed() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
MBeanOperationInfo operationSetAge = info.getOperation("setName");
assertThat(operationSetAge.getSignature()[0].getName()).isEqualTo("name");
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class MethodNameBasedMBeanInfoAssemblerMappedTests method testNickNameIsExposed.
@Test
public void testNickNameIsExposed() throws Exception {
ModelMBeanInfo inf = (ModelMBeanInfo) getMBeanInfo();
MBeanAttributeInfo attr = inf.getAttribute("NickName");
assertNickName(attr);
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class MethodNameBasedMBeanInfoAssemblerMappedTests 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").isFalse();
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class MethodNameBasedMBeanInfoAssemblerMappedTests method testWithFallThrough.
@Test
public void testWithFallThrough() throws Exception {
MethodNameBasedMBeanInfoAssembler assembler = getWithMapping("foobar", "add,myOperation,getName,setName,getAge");
assembler.setManagedMethods("getNickName", "setNickName");
ModelMBeanInfo inf = assembler.getMBeanInfo(getBean(), getObjectName());
MBeanAttributeInfo attr = inf.getAttribute("NickName");
assertNickName(attr);
}
use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.
the class AbstractMetadataAssemblerTests method testOperationParameterMetadata.
@Test
public void testOperationParameterMetadata() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
ModelMBeanOperationInfo oper = info.getOperation("add");
MBeanParameterInfo[] params = oper.getSignature();
assertThat(params.length).as("Invalid number of params").isEqualTo(2);
assertThat(params[0].getName()).as("Incorrect name for x param").isEqualTo("x");
assertThat(params[0].getType()).as("Incorrect type for x param").isEqualTo(int.class.getName());
assertThat(params[1].getName()).as("Incorrect name for y param").isEqualTo("y");
assertThat(params[1].getType()).as("Incorrect type for y param").isEqualTo(int.class.getName());
}
Aggregations