JmxReporterTest.java 文件源码

java
阅读 31 收藏 0 点赞 0 评论 0

项目:tqdev-metrics 作者:
/**
 * Should throw exception on unknown type.
 *
 * @throws MBeanException
 *             the MBean exception
 * @throws AttributeNotFoundException
 *             the attribute not found exception
 * @throws ReflectionException
 *             the reflection exception
 */
@Test
public void shouldThrowExceptionOnUnknownType()
        throws MBeanException, AttributeNotFoundException, ReflectionException {
    try {
        readJmx("jdbc.Statement.Invocations", "select");
        Assert.fail("readJmx should have thrown an AttributeNotFoundException");
    } catch (Exception e) {
        assertThat(e.getClass().getSimpleName()).isEqualTo("AttributeNotFoundException");
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号