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 */
23
24 import javax.management.MBeanAttributeInfo;
25 import javax.management.MBeanConstructorInfo;
26 import javax.management.MBeanInfo;
27 import javax.management.MBeanNotificationInfo;
28 import javax.management.MBeanOperationInfo;
29 import javax.management.MBeanParameterInfo;
30 import javax.management.modelmbean.DescriptorSupport;
31 import javax.management.openmbean.SimpleType;
32
33 /*
34 * @test
35 * @bug 8023669
36 * @summary Test that hashCode()throws NullPointerException
37 * @author Shanliang JIANG
38 * @run clean MBeanInfoHashCodeNPETest
39 * @run build MBeanInfoHashCodeNPETest
40 * @run main MBeanInfoHashCodeNPETest
41 */
42 public class MBeanInfoHashCodeNPETest {
43 private static int failed = 0;
44
45 public static void main(String[] args) throws Exception {
46 System.out.println("---MBeanInfoHashCodeNPETest-main ...");
47
48 // ----
49 System.out.println("\n---Testing on MBeanAttributeInfo...");
50 MBeanAttributeInfo mbeanAttributeInfo = new MBeanAttributeInfo(
51 null, SimpleType.INTEGER.getClassName(), "description", true, true, false);
52 test(mbeanAttributeInfo, "class name");
53
54 mbeanAttributeInfo = new MBeanAttributeInfo(
55 "name", null, "description", true, true, false);
56 test(mbeanAttributeInfo, "type");
57
|
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 */
23
24 import javax.management.MBeanAttributeInfo;
25 import javax.management.MBeanConstructorInfo;
26 import javax.management.MBeanInfo;
27 import javax.management.MBeanNotificationInfo;
28 import javax.management.MBeanOperationInfo;
29 import javax.management.MBeanParameterInfo;
30 import javax.management.modelmbean.DescriptorSupport;
31 import javax.management.openmbean.SimpleType;
32
33 /*
34 * @test
35 * @bug 8023669
36 * @summary Test that hashCode()throws NullPointerException
37 * @author Shanliang JIANG
38 * @modules java.management
39 * @run clean MBeanInfoHashCodeNPETest
40 * @run build MBeanInfoHashCodeNPETest
41 * @run main MBeanInfoHashCodeNPETest
42 */
43 public class MBeanInfoHashCodeNPETest {
44 private static int failed = 0;
45
46 public static void main(String[] args) throws Exception {
47 System.out.println("---MBeanInfoHashCodeNPETest-main ...");
48
49 // ----
50 System.out.println("\n---Testing on MBeanAttributeInfo...");
51 MBeanAttributeInfo mbeanAttributeInfo = new MBeanAttributeInfo(
52 null, SimpleType.INTEGER.getClassName(), "description", true, true, false);
53 test(mbeanAttributeInfo, "class name");
54
55 mbeanAttributeInfo = new MBeanAttributeInfo(
56 "name", null, "description", true, true, false);
57 test(mbeanAttributeInfo, "type");
58
|