Search in sources :

Example 1 with TestMbean

use of org.activiti.management.jmx.testMbeans.TestMbean in project Activiti by Activiti.

the class DefaultManagementMBeanAssemblerTest method testHappyPath.

@Test
public void testHappyPath() throws MalformedObjectNameException, JMException {
    TestMbean testMbean = new TestMbean();
    ModelMBean mbean = defaultManagementMBeanAssembler.assemble(testMbean, new ObjectName("org.activiti.jmx.Mbeans:type=something"));
    assertNotNull(mbean);
    assertNotNull(mbean.getMBeanInfo());
    assertNotNull(mbean.getMBeanInfo().getAttributes());
    MBeanAttributeInfo[] attributes = mbean.getMBeanInfo().getAttributes();
    assertEquals(2, attributes.length);
    assertTrue((attributes[0].getName().equals("TestAttributeString") && attributes[1].getName().equals("TestAttributeBoolean") || (attributes[1].getName().equals("TestAttributeString") && attributes[0].getName().equals("TestAttributeBoolean"))));
    assertNotNull(mbean.getMBeanInfo().getOperations());
    MBeanOperationInfo[] operations = mbean.getMBeanInfo().getOperations();
    assertNotNull(operations);
    assertEquals(3, operations.length);
}
Also used : ModelMBean(javax.management.modelmbean.ModelMBean) MBeanOperationInfo(javax.management.MBeanOperationInfo) TestMbean(org.activiti.management.jmx.testMbeans.TestMbean) MBeanAttributeInfo(javax.management.MBeanAttributeInfo) ObjectName(javax.management.ObjectName) Test(org.junit.Test)

Aggregations

MBeanAttributeInfo (javax.management.MBeanAttributeInfo)1 MBeanOperationInfo (javax.management.MBeanOperationInfo)1 ObjectName (javax.management.ObjectName)1 ModelMBean (javax.management.modelmbean.ModelMBean)1 TestMbean (org.activiti.management.jmx.testMbeans.TestMbean)1 Test (org.junit.Test)1