java类javax.management.modelmbean.ModelMBeanInfo的实例源码

AbstractJmxAssemblerTests.java 文件源码 项目:spring4-understanding 阅读 21 收藏 0 点赞 0 评论 0
@Test
public void testNotificationMetadata() throws Exception {
    ModelMBeanInfo info = (ModelMBeanInfo) getMBeanInfo();
    MBeanNotificationInfo[] notifications = info.getNotifications();
    assertEquals("Incorrect number of notifications", 1, notifications.length);
    assertEquals("Incorrect notification name", "My Notification", notifications[0].getName());

    String[] notifTypes = notifications[0].getNotifTypes();

    assertEquals("Incorrect number of notification types", 2, notifTypes.length);
    assertEquals("Notification type.foo not found", "type.foo", notifTypes[0]);
    assertEquals("Notification type.bar not found", "type.bar", notifTypes[1]);
}
MethodNameBasedMBeanInfoAssemblerMappedTests.java 文件源码 项目:spring4-understanding 阅读 25 收藏 0 点赞 0 评论 0
@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());
}
MethodNameBasedMBeanInfoAssemblerMappedTests.java 文件源码 项目:spring4-understanding 阅读 20 收藏 0 点赞 0 评论 0
@Test
public void testWithFallThrough() throws Exception {
    MethodNameBasedMBeanInfoAssembler assembler =
            getWithMapping("foobar", "add,myOperation,getName,setName,getAge");
    assembler.setManagedMethods(new String[]{"getNickName", "setNickName"});

    ModelMBeanInfo inf = assembler.getMBeanInfo(getBean(), getObjectName());
    MBeanAttributeInfo attr = inf.getAttribute("NickName");

    assertNickName(attr);
}
MethodNameBasedMBeanInfoAssemblerMappedTests.java 文件源码 项目:spring4-understanding 阅读 21 收藏 0 点赞 0 评论 0
@Test
public void testNickNameIsExposed() throws Exception {
    ModelMBeanInfo inf = (ModelMBeanInfo) getMBeanInfo();
    MBeanAttributeInfo attr = inf.getAttribute("NickName");

    assertNickName(attr);
}
MethodExclusionMBeanInfoAssemblerComboTests.java 文件源码 项目:spring4-understanding 阅读 21 收藏 0 点赞 0 评论 0
@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());
}
MethodExclusionMBeanInfoAssemblerComboTests.java 文件源码 项目:spring4-understanding 阅读 21 收藏 0 点赞 0 评论 0
@Test
public void testNickNameIsExposed() throws Exception {
    ModelMBeanInfo inf = (ModelMBeanInfo) getMBeanInfo();
    MBeanAttributeInfo attr = inf.getAttribute("NickName");
    assertNotNull("Nick Name should not be null", attr);
    assertTrue("Nick Name should be writable", attr.isWritable());
    assertTrue("Nick Name should be readable", attr.isReadable());
}
InterfaceBasedMBeanInfoAssemblerMappedTests.java 文件源码 项目:spring4-understanding 阅读 20 收藏 0 点赞 0 评论 0
@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());
}
InterfaceBasedMBeanInfoAssemblerMappedTests.java 文件源码 项目:spring4-understanding 阅读 133 收藏 0 点赞 0 评论 0
@Test
public void testWithFallThrough() throws Exception {
    InterfaceBasedMBeanInfoAssembler assembler =
            getWithMapping("foobar", "org.springframework.jmx.export.assembler.ICustomJmxBean");
    assembler.setManagedInterfaces(new Class<?>[] {IAdditionalTestMethods.class});

    ModelMBeanInfo inf = assembler.getMBeanInfo(getBean(), getObjectName());
    MBeanAttributeInfo attr = inf.getAttribute("NickName");

    assertNickName(attr);
}
InterfaceBasedMBeanInfoAssemblerMappedTests.java 文件源码 项目:spring4-understanding 阅读 26 收藏 0 点赞 0 评论 0
@Test
public void testNickNameIsExposed() throws Exception {
    ModelMBeanInfo inf = (ModelMBeanInfo) getMBeanInfo();
    MBeanAttributeInfo attr = inf.getAttribute("NickName");

    assertNickName(attr);
}
MethodExclusionMBeanInfoAssemblerNotMappedTests.java 文件源码 项目:spring4-understanding 阅读 18 收藏 0 点赞 0 评论 0
@Test
public void testGetAgeIsReadOnly() throws Exception {
    ModelMBeanInfo info = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = info.getAttribute(AGE_ATTRIBUTE);
    assertTrue("Age is not readable", attr.isReadable());
    assertTrue("Age is not writable", attr.isWritable());
}


问题


面经


文章

微信
公众号

扫码关注公众号