JmxRBACProviderHostScopedRolesTestCase.java 文件源码

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

项目:wildfly-core 作者:
private void setAttribute(String userName, JmxManagementInterface jmx) throws Exception {
    boolean successExpected = isWriteAllowed(userName);

    MBeanServerConnection connection = jmx.getConnection();
    ObjectName domain = new ObjectName("java.lang:type=Memory");
    try {
        connection.setAttribute(domain, new Attribute("Verbose", true));
        connection.setAttribute(domain, new Attribute("Verbose", false)); // back to default to not pollute the logs
        assertTrue("Failure was expected", successExpected);
    } catch (JMRuntimeException e) {
        if (e.getMessage().contains("WFLYJMX0037")) {
            assertFalse("Success was expected but failure happened: " + e, successExpected);
        } else {
            throw e;
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号