use of javax.management.openmbean.OpenMBeanInfo in project jdk8u_jdk by JetBrains.
the class OpenMBeanInfoHashCodeNPETest method main.
public static void main(String[] args) throws Exception {
System.out.println("---OpenMBeanInfoHashCodeNPETest-main ...");
// ----
System.out.println("\n---Testing on OpenMBeanInfohashCodeTest...");
OpenMBeanAttributeInfo openMBeanAttributeInfo = new OpenMBeanAttributeInfoSupport("name", "description", SimpleType.INTEGER, true, true, false, null, new Integer[] { 1, 2, 3 });
test(openMBeanAttributeInfo, "defaultValue");
openMBeanAttributeInfo = new OpenMBeanAttributeInfoSupport("name", "description", SimpleType.INTEGER, true, true, false, 1, null);
test(openMBeanAttributeInfo, "legalValues");
// ----
System.out.println("\n---Testing on OpenMBeanConstructorInfoSupport...");
OpenMBeanConstructorInfo openMBeanConstructorInfo;
openMBeanConstructorInfo = new OpenMBeanConstructorInfoSupport("name", "description", null, new DescriptorSupport());
test(openMBeanConstructorInfo, "sigs");
openMBeanConstructorInfo = new OpenMBeanConstructorInfoSupport("name", "description", new OpenMBeanParameterInfo[] {}, null);
test(openMBeanConstructorInfo, "Descriptor");
// ----
System.out.println("\n---Testing on OpenMBeanOperationInfoSupport...");
OpenMBeanOperationInfo openMBeanOperationInfo;
openMBeanOperationInfo = new OpenMBeanOperationInfoSupport("name", "description", null, SimpleType.INTEGER, 1, new DescriptorSupport());
test(openMBeanOperationInfo, "sigs");
openMBeanOperationInfo = new OpenMBeanOperationInfoSupport("name", "description", new OpenMBeanParameterInfo[] {}, SimpleType.INTEGER, 1, null);
test(openMBeanOperationInfo, "Descriptor");
// ----
System.out.println("\n---Testing on OpenMBeanParameterInfoSupport 1...");
OpenMBeanParameterInfo openMBeanParameterInfo;
openMBeanParameterInfo = new OpenMBeanParameterInfoSupport("name", "description", SimpleType.INTEGER, null, -1, 1);
test(openMBeanParameterInfo, "default value");
openMBeanParameterInfo = new OpenMBeanParameterInfoSupport("name", "description", SimpleType.INTEGER, 0, null, 1);
test(openMBeanParameterInfo, "min value");
openMBeanParameterInfo = new OpenMBeanParameterInfoSupport("name", "description", SimpleType.INTEGER, 0, -1, null);
test(openMBeanParameterInfo, "max value");
// ----
System.out.println("\n---Testing on OpenMBeanParameterInfoSupport 2...");
openMBeanParameterInfo = new OpenMBeanParameterInfoSupport("name", "description", SimpleType.INTEGER, 1, new Integer[] { -1, 1, 2 });
openMBeanParameterInfo = new OpenMBeanParameterInfoSupport("name", "description", SimpleType.INTEGER, null, new Integer[] { -1, 1, 2 });
test(openMBeanParameterInfo, "default value");
openMBeanParameterInfo = new OpenMBeanParameterInfoSupport("name", "description", SimpleType.INTEGER, 1, null);
test(openMBeanParameterInfo, "legal values");
// ----
System.out.println("\n---Testing on OpenMBeanInfoSupport...");
String className = "toto";
String description = "titi";
OpenMBeanAttributeInfo[] attrInfos = new OpenMBeanAttributeInfo[] {};
OpenMBeanConstructorInfo[] constrInfos = new OpenMBeanConstructorInfo[] {};
OpenMBeanOperationInfo[] operaInfos = new OpenMBeanOperationInfo[] {};
MBeanNotificationInfo[] notifInfos = new MBeanNotificationInfo[] {};
OpenMBeanInfo ominfo = new OpenMBeanInfoSupport(null, description, attrInfos, constrInfos, operaInfos, notifInfos);
test(ominfo, "class name");
ominfo = new OpenMBeanInfoSupport(className, null, attrInfos, constrInfos, operaInfos, notifInfos);
test(ominfo, "description");
ominfo = new OpenMBeanInfoSupport(className, description, null, constrInfos, operaInfos, notifInfos);
test(ominfo, "attrInfos");
ominfo = new OpenMBeanInfoSupport(className, description, attrInfos, null, operaInfos, notifInfos);
test(ominfo, "constructor infos");
ominfo = new OpenMBeanInfoSupport(className, description, attrInfos, constrInfos, null, notifInfos);
test(ominfo, "operation infos");
ominfo = new OpenMBeanInfoSupport(className, description, attrInfos, constrInfos, operaInfos, null);
test(ominfo, "notif infos");
if (failed > 0) {
throw new RuntimeException("Test failed: " + failed);
} else {
System.out.println("---Test: PASSED");
}
}
use of javax.management.openmbean.OpenMBeanInfo in project jdk8u_jdk by JetBrains.
the class OpenMBeanInfoEqualsNPETest method main.
public static void main(String[] args) throws Exception {
System.out.println("---OpenMBeanInfoEqualsNPETest-main ...");
// ----
System.out.println("\n---Testing on OpenMBeanAttributeInfoSupport...");
OpenMBeanAttributeInfo openMBeanAttributeInfo0 = new OpenMBeanAttributeInfoSupport("name", "description", SimpleType.INTEGER, true, true, false, 1, new Integer[] { 1, 2, 3 });
OpenMBeanAttributeInfo openMBeanAttributeInfo = new OpenMBeanAttributeInfoSupport("name", "description", SimpleType.INTEGER, true, true, false, null, new Integer[] { 1, 2, 3 });
test(openMBeanAttributeInfo0, openMBeanAttributeInfo, "defaultValue");
openMBeanAttributeInfo = new OpenMBeanAttributeInfoSupport("name", "description", SimpleType.INTEGER, true, true, false, 1, null);
test(openMBeanAttributeInfo0, openMBeanAttributeInfo, "legalValues");
// ----
System.out.println("\n---Testing on OpenMBeanConstructorInfoSupport...");
OpenMBeanConstructorInfo openMBeanConstructorInfo0 = new OpenMBeanConstructorInfoSupport("name", "description", new OpenMBeanParameterInfo[] {}, new DescriptorSupport());
OpenMBeanConstructorInfo openMBeanConstructorInfo;
openMBeanConstructorInfo = new OpenMBeanConstructorInfoSupport("name", "description", null, new DescriptorSupport());
test(openMBeanConstructorInfo0, openMBeanConstructorInfo, "sigs");
openMBeanConstructorInfo = new OpenMBeanConstructorInfoSupport("name", "description", new OpenMBeanParameterInfo[] {}, null);
test(openMBeanConstructorInfo0, openMBeanConstructorInfo, "Descriptor");
// ----
System.out.println("\n---Testing on OpenMBeanOperationInfoSupport...");
OpenMBeanOperationInfo openMBeanOperationInfo0 = new OpenMBeanOperationInfoSupport("name", "description", new OpenMBeanParameterInfo[] {}, SimpleType.INTEGER, 1, new DescriptorSupport());
OpenMBeanOperationInfo openMBeanOperationInfo;
openMBeanOperationInfo = new OpenMBeanOperationInfoSupport("name", "description", null, SimpleType.INTEGER, 1, new DescriptorSupport());
test(openMBeanOperationInfo0, openMBeanOperationInfo, "sigs");
openMBeanOperationInfo = new OpenMBeanOperationInfoSupport("name", "description", new OpenMBeanParameterInfo[] {}, SimpleType.INTEGER, MBeanOperationInfo.UNKNOWN, null);
test(openMBeanOperationInfo0, openMBeanOperationInfo, "Descriptor");
// ----
System.out.println("\n---Testing on OpenMBeanParameterInfoSupport 1...");
OpenMBeanParameterInfo openMBeanParameterInfo0 = new OpenMBeanParameterInfoSupport("name", "description", SimpleType.INTEGER, 0, -1, 1);
OpenMBeanParameterInfo openMBeanParameterInfo;
openMBeanParameterInfo = new OpenMBeanParameterInfoSupport("name", "description", SimpleType.INTEGER, null, -1, 1);
test(openMBeanParameterInfo0, openMBeanParameterInfo, "default value");
openMBeanParameterInfo = new OpenMBeanParameterInfoSupport("name", "description", SimpleType.INTEGER, 0, null, 1);
test(openMBeanParameterInfo0, openMBeanParameterInfo, "min value");
openMBeanParameterInfo = new OpenMBeanParameterInfoSupport("name", "description", SimpleType.INTEGER, 0, -1, null);
test(openMBeanParameterInfo0, openMBeanParameterInfo, "max value");
// ----
System.out.println("\n---Testing on OpenMBeanParameterInfoSupport 2...");
openMBeanParameterInfo0 = new OpenMBeanParameterInfoSupport("name", "description", SimpleType.INTEGER, 1, new Integer[] { -1, 1, 2 });
openMBeanParameterInfo = new OpenMBeanParameterInfoSupport("name", "description", SimpleType.INTEGER, null, new Integer[] { -1, 1, 2 });
test(openMBeanParameterInfo0, openMBeanParameterInfo, "default value");
openMBeanParameterInfo = new OpenMBeanParameterInfoSupport("name", "description", SimpleType.INTEGER, 1, null);
test(openMBeanParameterInfo0, openMBeanParameterInfo, "legal values");
// ----
System.out.println("\n---Testing on OpenMBeanInfoSupport...");
String className = "toto";
String description = "titi";
OpenMBeanAttributeInfo[] attrInfos = new OpenMBeanAttributeInfo[] {};
OpenMBeanConstructorInfo[] constrInfos = new OpenMBeanConstructorInfo[] {};
OpenMBeanOperationInfo[] operaInfos = new OpenMBeanOperationInfo[] {};
MBeanNotificationInfo[] notifInfos = new MBeanNotificationInfo[] {};
OpenMBeanInfo ominfo0 = new OpenMBeanInfoSupport("toto", description, attrInfos, constrInfos, operaInfos, notifInfos);
OpenMBeanInfo ominfo = new OpenMBeanInfoSupport(null, description, attrInfos, constrInfos, operaInfos, notifInfos);
test(ominfo0, ominfo, "class name");
ominfo = new OpenMBeanInfoSupport(className, null, attrInfos, constrInfos, operaInfos, notifInfos);
test(ominfo0, ominfo, "description");
ominfo = new OpenMBeanInfoSupport(className, description, null, constrInfos, operaInfos, notifInfos);
test(ominfo0, ominfo, "attrInfos");
ominfo = new OpenMBeanInfoSupport(className, description, attrInfos, null, operaInfos, notifInfos);
test(ominfo0, ominfo, "constructor infos");
ominfo = new OpenMBeanInfoSupport(className, description, attrInfos, constrInfos, null, notifInfos);
test(ominfo0, ominfo, "operation infos");
ominfo = new OpenMBeanInfoSupport(className, description, attrInfos, constrInfos, operaInfos, null);
test(ominfo0, ominfo, "notif infos");
if (failed > 0) {
throw new RuntimeException("Test failed: " + failed);
} else {
System.out.println("---Test: PASSED");
}
}
Aggregations