1 /*
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
24 import javax.management.MBeanNotificationInfo;
25 import javax.management.MBeanOperationInfo;
26 import javax.management.modelmbean.DescriptorSupport;
27 import javax.management.openmbean.OpenMBeanAttributeInfo;
28 import javax.management.openmbean.OpenMBeanAttributeInfoSupport;
29 import javax.management.openmbean.OpenMBeanConstructorInfo;
30 import javax.management.openmbean.OpenMBeanConstructorInfoSupport;
31 import javax.management.openmbean.OpenMBeanInfo;
32 import javax.management.openmbean.OpenMBeanInfoSupport;
33 import javax.management.openmbean.OpenMBeanOperationInfo;
34 import javax.management.openmbean.OpenMBeanOperationInfoSupport;
35 import javax.management.openmbean.OpenMBeanParameterInfo;
36 import javax.management.openmbean.OpenMBeanParameterInfoSupport;
37 import javax.management.openmbean.SimpleType;
38
39 /*
40 * @test
41 * @bug 8023529
42 * @summary Test that OpenMBean*Info.equals do not throw NPE
43 * @author Shanliang JIANG
44 * @run clean OpenMBeanInfoEqualsNPETest
45 * @run build OpenMBeanInfoEqualsNPETest
46 * @run main OpenMBeanInfoEqualsNPETest
47 */
48 public class OpenMBeanInfoEqualsNPETest {
49 private static int failed = 0;
50
51 public static void main(String[] args) throws Exception {
52 System.out.println("---OpenMBeanInfoEqualsNPETest-main ...");
53
54 // ----
55 System.out.println("\n---Testing on OpenMBeanAttributeInfoSupport...");
56 OpenMBeanAttributeInfo openMBeanAttributeInfo0 = new OpenMBeanAttributeInfoSupport(
57 "name", "description", SimpleType.INTEGER, true, true, false, 1, new Integer[]{1, 2, 3});
58 OpenMBeanAttributeInfo openMBeanAttributeInfo = new OpenMBeanAttributeInfoSupport(
59 "name", "description", SimpleType.INTEGER, true, true, false, null, new Integer[]{1, 2, 3});
60 test(openMBeanAttributeInfo0, openMBeanAttributeInfo, "defaultValue");
61
62 openMBeanAttributeInfo = new OpenMBeanAttributeInfoSupport(
63 "name", "description", SimpleType.INTEGER, true, true, false, 1, null);
|
1 /*
2 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
24 import javax.management.MBeanNotificationInfo;
25 import javax.management.MBeanOperationInfo;
26 import javax.management.modelmbean.DescriptorSupport;
27 import javax.management.openmbean.OpenMBeanAttributeInfo;
28 import javax.management.openmbean.OpenMBeanAttributeInfoSupport;
29 import javax.management.openmbean.OpenMBeanConstructorInfo;
30 import javax.management.openmbean.OpenMBeanConstructorInfoSupport;
31 import javax.management.openmbean.OpenMBeanInfo;
32 import javax.management.openmbean.OpenMBeanInfoSupport;
33 import javax.management.openmbean.OpenMBeanOperationInfo;
34 import javax.management.openmbean.OpenMBeanOperationInfoSupport;
35 import javax.management.openmbean.OpenMBeanParameterInfo;
36 import javax.management.openmbean.OpenMBeanParameterInfoSupport;
37 import javax.management.openmbean.SimpleType;
38
39 /*
40 * @test
41 * @bug 8023529
42 * @summary Test that OpenMBean*Info.equals do not throw NPE
43 * @author Shanliang JIANG
44 * @modules java.management
45 * @run clean OpenMBeanInfoEqualsNPETest
46 * @run build OpenMBeanInfoEqualsNPETest
47 * @run main OpenMBeanInfoEqualsNPETest
48 */
49 public class OpenMBeanInfoEqualsNPETest {
50 private static int failed = 0;
51
52 public static void main(String[] args) throws Exception {
53 System.out.println("---OpenMBeanInfoEqualsNPETest-main ...");
54
55 // ----
56 System.out.println("\n---Testing on OpenMBeanAttributeInfoSupport...");
57 OpenMBeanAttributeInfo openMBeanAttributeInfo0 = new OpenMBeanAttributeInfoSupport(
58 "name", "description", SimpleType.INTEGER, true, true, false, 1, new Integer[]{1, 2, 3});
59 OpenMBeanAttributeInfo openMBeanAttributeInfo = new OpenMBeanAttributeInfoSupport(
60 "name", "description", SimpleType.INTEGER, true, true, false, null, new Integer[]{1, 2, 3});
61 test(openMBeanAttributeInfo0, openMBeanAttributeInfo, "defaultValue");
62
63 openMBeanAttributeInfo = new OpenMBeanAttributeInfoSupport(
64 "name", "description", SimpleType.INTEGER, true, true, false, 1, null);
|