private void getAttribute(String userName, JmxManagementInterface jmx) throws Exception {
boolean successExpected = isReadAllowed(userName);
MBeanServerConnection connection = jmx.getConnection();
ObjectName domain = new ObjectName("java.lang:type=OperatingSystem");
try {
Object attribute = connection.getAttribute(domain, "Name");
assertTrue("Failure was expected", successExpected);
assertEquals(System.getProperty("os.name"), attribute.toString());
} catch (JMRuntimeException e) {
if (e.getMessage().contains("WFLYJMX0037")) {
assertFalse("Success was expected but failure happened: " + e, successExpected);
} else {
throw e;
}
}
}
JmxRBACProviderServerGroupScopedRolesTestCase.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:wildfly-core
作者:
评论列表
文章目录