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

MethodExclusionMBeanInfoAssemblerTests.java 文件源码 项目:spring4-understanding 阅读 15 收藏 0 点赞 0 评论 0
@Test
public void testSupermanIsReadOnly() throws Exception {
    ModelMBeanInfo info = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = info.getAttribute("Superman");

    assertTrue(attr.isReadable());
    assertFalse(attr.isWritable());
}
MethodExclusionMBeanInfoAssemblerMappedTests.java 文件源码 项目:spring4-understanding 阅读 15 收藏 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());
}
MethodNameBasedMBeanInfoAssemblerTests.java 文件源码 项目:spring4-understanding 阅读 17 收藏 0 点赞 0 评论 0
@Test
public void testGetAgeIsReadOnly() throws Exception {
    ModelMBeanInfo info = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = info.getAttribute(AGE_ATTRIBUTE);

    assertTrue(attr.isReadable());
    assertFalse(attr.isWritable());
}
AnnotationMetadataAssemblerTests.java 文件源码 项目:class-guard 阅读 20 收藏 0 点赞 0 评论 0
@Test
public void testAttributeFromInterface() throws Exception {
    ModelMBeanInfo inf = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = inf.getAttribute("Colour");
    assertTrue("The name attribute should be writable", attr.isWritable());
    assertTrue("The name attribute should be readable", attr.isReadable());
}
AbstractMetadataAssemblerTests.java 文件源码 项目:class-guard 阅读 21 收藏 0 点赞 0 评论 0
@Test
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());
}
AbstractMetadataAssemblerTests.java 文件源码 项目:class-guard 阅读 17 收藏 0 点赞 0 评论 0
@Test
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());
}
AbstractMetadataAssemblerTests.java 文件源码 项目:class-guard 阅读 19 收藏 0 点赞 0 评论 0
/**
 * Tests the situation where the attribute is only defined on the getter.
 */
@Test
public void testReadOnlyAttribute() throws Exception {
    ModelMBeanInfo inf = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = inf.getAttribute(AGE_ATTRIBUTE);
    assertFalse("The age attribute should not be writable", attr.isWritable());
}
AbstractMetadataAssemblerTests.java 文件源码 项目:class-guard 阅读 19 收藏 0 点赞 0 评论 0
@Test
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());
}
AbstractMetadataAssemblerTests.java 文件源码 项目:class-guard 阅读 19 收藏 0 点赞 0 评论 0
/**
 * Tests the situation where the property only has a getter.
 */
@Test
public void testWithOnlySetter() throws Exception {
    ModelMBeanInfo inf = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = inf.getAttribute("NickName");
    assertNotNull("Attribute should not be null", attr);
}
AbstractMetadataAssemblerTests.java 文件源码 项目:class-guard 阅读 17 收藏 0 点赞 0 评论 0
/**
 * Tests the situation where the property only has a setter.
 */
@Test
public void testWithOnlyGetter() throws Exception {
    ModelMBeanInfo info = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = info.getAttribute("Superman");
    assertNotNull("Attribute should not be null", attr);
}


问题


面经


文章

微信
公众号

扫码关注公众号