private void checkMBeanInfoAttributes(MBeanInfo info, boolean writable, boolean expressions) {
//All attributes should be read-only
MBeanAttributeInfo[] attributes = info.getAttributes();
Assert.assertEquals(14, attributes.length);
Arrays.sort(attributes, new Comparator<MBeanAttributeInfo>() {
@Override
public int compare(MBeanAttributeInfo o1, MBeanAttributeInfo o2) {
return o1.getName().compareTo(o2.getName());
}
});
assertAttributeDescription(attributes[0], "bigdec", expressions ? String.class.getName() : BigDecimal.class.getName(), "bigdec", true, writable);
assertAttributeDescription(attributes[1], "bigint", expressions ? String.class.getName() : BigInteger.class.getName(), "bigint", true, writable);
assertAttributeDescription(attributes[2], "boolean", expressions ? String.class.getName() : Boolean.class.getName(), "boolean", true, writable);
assertAttributeDescription(attributes[3], "bytes", byte[].class.getName(), "bytes", true, writable);
checkComplexTypeInfo(assertCast(CompositeType.class, assertCast(OpenMBeanAttributeInfo.class, attributes[4]).getOpenType()), expressions, "complex.");
assertAttributeDescription(attributes[5], "double", expressions ? String.class.getName() : Double.class.getName(), "double", true, writable);
assertAttributeDescription(attributes[6], "int", expressions ? String.class.getName() : Integer.class.getName(), "int", true, writable);
assertAttributeDescription(attributes[7], "list", expressions ? String[].class.getName() : Integer[].class.getName(), "list", true, writable);
assertAttributeDescription(attributes[8], "long", expressions ? String.class.getName() : Long.class.getName(), "long", true, writable);
//type=OBJECT, value-type=a simple type -> a map
assertAttributeDescription(attributes[9], "map", TabularData.class.getName(), "map", true, writable);
assertMapType(assertCast(OpenMBeanAttributeInfo.class, attributes[9]).getOpenType(), SimpleType.STRING, expressions ? SimpleType.STRING : SimpleType.INTEGER);
assertAttributeDescription(attributes[10], "roInt", expressions ? String.class.getName() : Integer.class.getName(), "ro-int", true, false);
assertAttributeDescription(attributes[11], "string", expressions ? String.class.getName() : String.class.getName(), "string", true, writable);
assertAttributeDescription(attributes[12], "type", String.class.getName(), "type", true, writable);
assertAttributeDescription(attributes[13], "undefinedInt", expressions ? String.class.getName() : Integer.class.getName(), "undefined-int", true, writable);
}
ModelControllerMBeanTestCase.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:wildfly-core
作者:
评论列表
文章目录