23
24 import javax.management.MBeanNotificationInfo;
25 import javax.management.modelmbean.DescriptorSupport;
26 import javax.management.openmbean.OpenMBeanAttributeInfo;
27 import javax.management.openmbean.OpenMBeanAttributeInfoSupport;
28 import javax.management.openmbean.OpenMBeanConstructorInfo;
29 import javax.management.openmbean.OpenMBeanConstructorInfoSupport;
30 import javax.management.openmbean.OpenMBeanInfo;
31 import javax.management.openmbean.OpenMBeanInfoSupport;
32 import javax.management.openmbean.OpenMBeanOperationInfo;
33 import javax.management.openmbean.OpenMBeanOperationInfoSupport;
34 import javax.management.openmbean.OpenMBeanParameterInfo;
35 import javax.management.openmbean.OpenMBeanParameterInfoSupport;
36 import javax.management.openmbean.SimpleType;
37
38 /*
39 * @test
40 * @bug 8023529
41 * @summary Test that OpenMBean*Info.hashCode do not throw NPE
42 * @author Shanliang JIANG
43 * @modules java.management
44 * @run clean OpenMBeanInfoHashCodeNPETest
45 * @run build OpenMBeanInfoHashCodeNPETest
46 * @run main OpenMBeanInfoHashCodeNPETest
47 */
48 public class OpenMBeanInfoHashCodeNPETest {
49 private static int failed = 0;
50
51 public static void main(String[] args) throws Exception {
52 System.out.println("---OpenMBeanInfoHashCodeNPETest-main ...");
53
54 // ----
55 System.out.println("\n---Testing on OpenMBeanInfohashCodeTest...");
56 OpenMBeanAttributeInfo openMBeanAttributeInfo = new OpenMBeanAttributeInfoSupport(
57 "name", "description", SimpleType.INTEGER, true, true, false, null, new Integer[]{1, 2, 3});
58 test(openMBeanAttributeInfo, "defaultValue");
59
60 openMBeanAttributeInfo = new OpenMBeanAttributeInfoSupport(
61 "name", "description", SimpleType.INTEGER, true, true, false, 1, null);
62 test(openMBeanAttributeInfo, "legalValues");
63
|
23
24 import javax.management.MBeanNotificationInfo;
25 import javax.management.modelmbean.DescriptorSupport;
26 import javax.management.openmbean.OpenMBeanAttributeInfo;
27 import javax.management.openmbean.OpenMBeanAttributeInfoSupport;
28 import javax.management.openmbean.OpenMBeanConstructorInfo;
29 import javax.management.openmbean.OpenMBeanConstructorInfoSupport;
30 import javax.management.openmbean.OpenMBeanInfo;
31 import javax.management.openmbean.OpenMBeanInfoSupport;
32 import javax.management.openmbean.OpenMBeanOperationInfo;
33 import javax.management.openmbean.OpenMBeanOperationInfoSupport;
34 import javax.management.openmbean.OpenMBeanParameterInfo;
35 import javax.management.openmbean.OpenMBeanParameterInfoSupport;
36 import javax.management.openmbean.SimpleType;
37
38 /*
39 * @test
40 * @bug 8023529
41 * @summary Test that OpenMBean*Info.hashCode do not throw NPE
42 * @author Shanliang JIANG
43 *
44 * @run clean OpenMBeanInfoHashCodeNPETest
45 * @run build OpenMBeanInfoHashCodeNPETest
46 * @run main OpenMBeanInfoHashCodeNPETest
47 */
48 public class OpenMBeanInfoHashCodeNPETest {
49 private static int failed = 0;
50
51 public static void main(String[] args) throws Exception {
52 System.out.println("---OpenMBeanInfoHashCodeNPETest-main ...");
53
54 // ----
55 System.out.println("\n---Testing on OpenMBeanInfohashCodeTest...");
56 OpenMBeanAttributeInfo openMBeanAttributeInfo = new OpenMBeanAttributeInfoSupport(
57 "name", "description", SimpleType.INTEGER, true, true, false, null, new Integer[]{1, 2, 3});
58 test(openMBeanAttributeInfo, "defaultValue");
59
60 openMBeanAttributeInfo = new OpenMBeanAttributeInfoSupport(
61 "name", "description", SimpleType.INTEGER, true, true, false, 1, null);
62 test(openMBeanAttributeInfo, "legalValues");
63
|