Package javax.management.modelmbean

Examples of javax.management.modelmbean.ModelMBeanInfo


    assertEquals("The descriptions are not the same", "My Managed Bean",
        info.getDescription());
  }

  public void testAttributeDescriptionOnSetter() throws Exception {
    ModelMBeanInfo inf = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = inf.getAttribute(AGE_ATTRIBUTE);
    assertEquals("The description for the age attribute is incorrect",
        "The Age Attribute", attr.getDescription());
  }
View Full Code Here


    assertEquals("The description for the age attribute is incorrect",
        "The Age Attribute", attr.getDescription());
  }

  public void testAttributeDescriptionOnGetter() throws Exception {
    ModelMBeanInfo inf = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = inf.getAttribute(NAME_ATTRIBUTE);
    assertEquals("The description for the name attribute is incorrect",
        "The Name Attribute", attr.getDescription());
  }
View Full Code Here

  /**
   * Tests the situation where the attribute is only defined on the getter.
   */
  public void testReadOnlyAttribute() throws Exception {
    ModelMBeanInfo inf = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = inf.getAttribute(AGE_ATTRIBUTE);
    assertFalse("The age attribute should not be writable", attr.isWritable());
  }
View Full Code Here

    ModelMBeanAttributeInfo attr = inf.getAttribute(AGE_ATTRIBUTE);
    assertFalse("The age attribute should not be writable", attr.isWritable());
  }

  public void testReadWriteAttribute() throws Exception {
    ModelMBeanInfo inf = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = inf.getAttribute(NAME_ATTRIBUTE);
    assertTrue("The name attribute should be writable", attr.isWritable());
    assertTrue("The name attribute should be readable", attr.isReadable());
  }
View Full Code Here

  /**
   * Tests the situation where the property only has a getter.
   */
  public void testWithOnlySetter() throws Exception {
    ModelMBeanInfo inf = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = inf.getAttribute("NickName");
    assertNotNull("Attribute should not be null", attr);
  }
View Full Code Here

  /**
   * Tests the situation where the property only has a setter.
   */
  public void testWithOnlyGetter() throws Exception {
    ModelMBeanInfo info = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = info.getAttribute("Superman");
    assertNotNull("Attribute should not be null", attr);
  }
View Full Code Here

    ModelMBeanAttributeInfo attr = info.getAttribute("Superman");
    assertNotNull("Attribute should not be null", attr);
  }

  public void testManagedResourceDescriptor() throws Exception {
    ModelMBeanInfo info = getMBeanInfoFromAssembler();
    Descriptor desc = info.getMBeanDescriptor();

    assertEquals("Logging should be set to true", "true", desc.getFieldValue("log"));
    assertEquals("Log file should be jmx.log", "jmx.log", desc.getFieldValue("logFile"));
    assertEquals("Currency Time Limit should be 15", "15", desc.getFieldValue("currencyTimeLimit"));
    assertEquals("Persist Policy should be OnUpdate", "OnUpdate", desc.getFieldValue("persistPolicy"));
View Full Code Here

    assertEquals("Persist Location should be foo", "./foo", desc.getFieldValue("persistLocation"));
    assertEquals("Persist Name should be bar", "bar.jmx", desc.getFieldValue("persistName"));
  }

  public void testAttributeDescriptor() throws Exception {
    ModelMBeanInfo info = getMBeanInfoFromAssembler();
    Descriptor desc = info.getAttribute(NAME_ATTRIBUTE).getDescriptor();

    assertEquals("Default value should be foo", "foo", desc.getFieldValue("default"));
    assertEquals("Currency Time Limit should be 20", "20", desc.getFieldValue("currencyTimeLimit"));
    assertEquals("Persist Policy should be OnUpdate", "OnUpdate", desc.getFieldValue("persistPolicy"));
    assertEquals("Persist Period should be 300", "300", desc.getFieldValue("persistPeriod"));
View Full Code Here

    assertEquals("Persist Policy should be OnUpdate", "OnUpdate", desc.getFieldValue("persistPolicy"));
    assertEquals("Persist Period should be 300", "300", desc.getFieldValue("persistPeriod"));
  }

  public void testOperationDescriptor() throws Exception {
    ModelMBeanInfo info = getMBeanInfoFromAssembler();
    Descriptor desc = info.getOperation("myOperation").getDescriptor();

    assertEquals("Currency Time Limit should be 30", "30", desc.getFieldValue("currencyTimeLimit"));
    assertEquals("Role should be \"operation\"", "operation", desc.getFieldValue("role"));
  }
View Full Code Here

    assertEquals("Currency Time Limit should be 30", "30", desc.getFieldValue("currencyTimeLimit"));
    assertEquals("Role should be \"operation\"", "operation", desc.getFieldValue("role"));
  }

  public void testOperationParameterMetadata() throws Exception {
    ModelMBeanInfo info = getMBeanInfoFromAssembler();
    ModelMBeanOperationInfo oper = info.getOperation("add");
    MBeanParameterInfo[] params = oper.getSignature();

    assertEquals("Invalid number of params", 2, params.length);
    assertEquals("Incorrect name for x param", "x", params[0].getName());
    assertEquals("Incorrect type for x param", int.class.getName(), params[0].getType());
View Full Code Here

TOP

Related Classes of javax.management.modelmbean.ModelMBeanInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.