Search in sources :

Example 1 with OpenMBeanInfo

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");
    }
}
Also used : OpenMBeanParameterInfo(javax.management.openmbean.OpenMBeanParameterInfo) OpenMBeanInfoSupport(javax.management.openmbean.OpenMBeanInfoSupport) DescriptorSupport(javax.management.modelmbean.DescriptorSupport) OpenMBeanParameterInfoSupport(javax.management.openmbean.OpenMBeanParameterInfoSupport) OpenMBeanConstructorInfo(javax.management.openmbean.OpenMBeanConstructorInfo) MBeanNotificationInfo(javax.management.MBeanNotificationInfo) OpenMBeanAttributeInfo(javax.management.openmbean.OpenMBeanAttributeInfo) OpenMBeanConstructorInfoSupport(javax.management.openmbean.OpenMBeanConstructorInfoSupport) OpenMBeanAttributeInfoSupport(javax.management.openmbean.OpenMBeanAttributeInfoSupport) OpenMBeanOperationInfo(javax.management.openmbean.OpenMBeanOperationInfo) OpenMBeanOperationInfoSupport(javax.management.openmbean.OpenMBeanOperationInfoSupport) OpenMBeanInfo(javax.management.openmbean.OpenMBeanInfo)

Example 2 with OpenMBeanInfo

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");
    }
}
Also used : OpenMBeanParameterInfo(javax.management.openmbean.OpenMBeanParameterInfo) OpenMBeanInfoSupport(javax.management.openmbean.OpenMBeanInfoSupport) DescriptorSupport(javax.management.modelmbean.DescriptorSupport) OpenMBeanParameterInfoSupport(javax.management.openmbean.OpenMBeanParameterInfoSupport) OpenMBeanConstructorInfo(javax.management.openmbean.OpenMBeanConstructorInfo) MBeanNotificationInfo(javax.management.MBeanNotificationInfo) OpenMBeanAttributeInfo(javax.management.openmbean.OpenMBeanAttributeInfo) OpenMBeanConstructorInfoSupport(javax.management.openmbean.OpenMBeanConstructorInfoSupport) OpenMBeanAttributeInfoSupport(javax.management.openmbean.OpenMBeanAttributeInfoSupport) OpenMBeanOperationInfo(javax.management.openmbean.OpenMBeanOperationInfo) OpenMBeanOperationInfoSupport(javax.management.openmbean.OpenMBeanOperationInfoSupport) OpenMBeanInfo(javax.management.openmbean.OpenMBeanInfo)

Aggregations

MBeanNotificationInfo (javax.management.MBeanNotificationInfo)2 DescriptorSupport (javax.management.modelmbean.DescriptorSupport)2 OpenMBeanAttributeInfo (javax.management.openmbean.OpenMBeanAttributeInfo)2 OpenMBeanAttributeInfoSupport (javax.management.openmbean.OpenMBeanAttributeInfoSupport)2 OpenMBeanConstructorInfo (javax.management.openmbean.OpenMBeanConstructorInfo)2 OpenMBeanConstructorInfoSupport (javax.management.openmbean.OpenMBeanConstructorInfoSupport)2 OpenMBeanInfo (javax.management.openmbean.OpenMBeanInfo)2 OpenMBeanInfoSupport (javax.management.openmbean.OpenMBeanInfoSupport)2 OpenMBeanOperationInfo (javax.management.openmbean.OpenMBeanOperationInfo)2 OpenMBeanOperationInfoSupport (javax.management.openmbean.OpenMBeanOperationInfoSupport)2 OpenMBeanParameterInfo (javax.management.openmbean.OpenMBeanParameterInfo)2 OpenMBeanParameterInfoSupport (javax.management.openmbean.OpenMBeanParameterInfoSupport)2