Search in sources :

Example 41 with ModelMBeanInfo

use of javax.management.modelmbean.ModelMBeanInfo in project spring-framework by spring-projects.

the class AnnotationMetadataAssemblerTests method testOperationOnGetter.

@Test
public void testOperationOnGetter() throws Exception {
    ModelMBeanInfo inf = getMBeanInfoFromAssembler();
    ModelMBeanOperationInfo op = inf.getOperation("getExpensiveToCalculate");
    assertNotNull(op);
}
Also used : ModelMBeanOperationInfo(javax.management.modelmbean.ModelMBeanOperationInfo) ModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) Test(org.junit.Test)

Example 42 with ModelMBeanInfo

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);
}
Also used : ModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) ModelMBeanAttributeInfo(javax.management.modelmbean.ModelMBeanAttributeInfo) MBeanAttributeInfo(javax.management.MBeanAttributeInfo) Test(org.junit.Test)

Example 43 with ModelMBeanInfo

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);
}
Also used : ModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) ModelMBeanAttributeInfo(javax.management.modelmbean.ModelMBeanAttributeInfo) MBeanAttributeInfo(javax.management.MBeanAttributeInfo) Test(org.junit.Test)

Example 44 with ModelMBeanInfo

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);
    assertTrue("Age is not readable", attr.isReadable());
    assertFalse("Age is not writable", attr.isWritable());
}
Also used : ModelMBeanAttributeInfo(javax.management.modelmbean.ModelMBeanAttributeInfo) ModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) Test(org.junit.Test)

Example 45 with ModelMBeanInfo

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");
    assertEquals("name", operationSetAge.getSignature()[0].getName());
}
Also used : MBeanOperationInfo(javax.management.MBeanOperationInfo) ModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) Test(org.junit.Test)

Aggregations

ModelMBeanInfo (javax.management.modelmbean.ModelMBeanInfo)74 Test (org.junit.Test)51 ModelMBeanAttributeInfo (javax.management.modelmbean.ModelMBeanAttributeInfo)33 Descriptor (javax.management.Descriptor)16 ModelMBeanOperationInfo (javax.management.modelmbean.ModelMBeanOperationInfo)14 RequiredModelMBean (javax.management.modelmbean.RequiredModelMBean)11 MBeanAttributeInfo (javax.management.MBeanAttributeInfo)10 ObjectName (javax.management.ObjectName)9 ModelMBeanInfoSupport (javax.management.modelmbean.ModelMBeanInfoSupport)9 InvalidTargetObjectTypeException (javax.management.modelmbean.InvalidTargetObjectTypeException)8 MBeanException (javax.management.MBeanException)6 InstanceNotFoundException (javax.management.InstanceNotFoundException)5 MBeanServer (javax.management.MBeanServer)5 MalformedObjectNameException (javax.management.MalformedObjectNameException)5 RuntimeOperationsException (javax.management.RuntimeOperationsException)5 FileLogger (mx4j.log.FileLogger)5 Logger (mx4j.log.Logger)5 MBeanLogger (mx4j.log.MBeanLogger)5 JMException (javax.management.JMException)4 DescriptorSupport (javax.management.modelmbean.DescriptorSupport)4