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;
}
}
}
JmxRBACProviderHostScopedRolesTestCase.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:wildfly-core
作者:
评论列表
文章目录