Search in sources :

Example 51 with ModelMBeanInfo

use of javax.management.modelmbean.ModelMBeanInfo in project cxf by apache.

the class ModelMBeanAssemblerTest method testGetMBeanAttributeInfo.

@Test
public void testGetMBeanAttributeInfo() throws Exception {
    ModelMBeanInfo info = getMBeanInfoFromAssembler();
    MBeanAttributeInfo[] inf = info.getAttributes();
    assertEquals("Invalid number of Attributes returned", 4, inf.length);
    for (int x = 0; x < inf.length; x++) {
        assertNotNull("MBeanAttributeInfo should not be null", inf[x]);
        assertNotNull("Description for MBeanAttributeInfo should not be null", inf[x].getDescription());
    }
}
Also used : ModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) MBeanAttributeInfo(javax.management.MBeanAttributeInfo) Test(org.junit.Test)

Example 52 with ModelMBeanInfo

use of javax.management.modelmbean.ModelMBeanInfo in project cxf by apache.

the class ModelMBeanAssemblerTest method testAttributeHasCorrespondingOperations.

@Test
public void testAttributeHasCorrespondingOperations() throws Exception {
    ModelMBeanInfo info = getMBeanInfoFromAssembler();
    ModelMBeanOperationInfo myOperation = info.getOperation("myOperation");
    assertNotNull("get operation should not be null", myOperation);
    assertEquals("Incorrect myOperation return type", "long", myOperation.getReturnType());
    ModelMBeanOperationInfo add = info.getOperation("add");
    assertNotNull("set operation should not be null", add);
    assertEquals("Incorrect add method description", "Add Two Numbers Together", add.getDescription());
}
Also used : ModelMBeanOperationInfo(javax.management.modelmbean.ModelMBeanOperationInfo) ModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) Test(org.junit.Test)

Example 53 with ModelMBeanInfo

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

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

Example 54 with ModelMBeanInfo

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

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

Example 55 with ModelMBeanInfo

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

the class MethodExclusionMBeanInfoAssemblerTests method testSupermanIsReadOnly.

@Test
public void testSupermanIsReadOnly() throws Exception {
    ModelMBeanInfo info = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = info.getAttribute("Superman");
    assertThat(attr.isReadable()).isTrue();
    assertThat(attr.isWritable()).isFalse();
}
Also used : ModelMBeanAttributeInfo(javax.management.modelmbean.ModelMBeanAttributeInfo) ModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) Test(org.junit.jupiter.api.Test)

Aggregations

ModelMBeanInfo (javax.management.modelmbean.ModelMBeanInfo)74 Test (org.junit.jupiter.api.Test)42 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 Test (org.junit.Test)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