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 /*
25 * @test
26 * @bug 5043245
27 * @summary Test the following in RequiredModelMBean.getAttribute():
28 * The declared type of the attribute is the String returned by
29 * ModelMBeanAttributeInfo.getType(). A value is compatible
30 * with this type if one of the following is true:
31 * - the value is null;
32 * - the declared name is a primitive type name (such as "int")
33 * and the value is an instance of the corresponding wrapper
34 * type (such as java.lang.Integer);
35 * - the name of the value's class is identical to the declared name;
36 * - the declared name can be loaded by the value's class loader and
37 * produces a class to which the value can be assigned.
38 * @author Luis-Miguel Alventosa
39 * @modules java.management
40 * @run clean RequiredModelMBeanGetAttributeTest
41 * @run build RequiredModelMBeanGetAttributeTest
42 * @run main RequiredModelMBeanGetAttributeTest
43 */
44
45 import java.lang.reflect.Method;
46 import java.util.Hashtable;
47 import java.util.Map;
48 import javax.management.Descriptor;
49 import javax.management.MBeanServer;
50 import javax.management.MBeanServerFactory;
51 import javax.management.ObjectName;
52 import javax.management.modelmbean.DescriptorSupport;
53 import javax.management.modelmbean.ModelMBean;
54 import javax.management.modelmbean.ModelMBeanAttributeInfo;
55 import javax.management.modelmbean.ModelMBeanInfo;
56 import javax.management.modelmbean.ModelMBeanInfoSupport;
57 import javax.management.modelmbean.ModelMBeanOperationInfo;
58 import javax.management.modelmbean.RequiredModelMBean;
59
|
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 /*
25 * @test
26 * @bug 5043245
27 * @summary Test the following in RequiredModelMBean.getAttribute():
28 * The declared type of the attribute is the String returned by
29 * ModelMBeanAttributeInfo.getType(). A value is compatible
30 * with this type if one of the following is true:
31 * - the value is null;
32 * - the declared name is a primitive type name (such as "int")
33 * and the value is an instance of the corresponding wrapper
34 * type (such as java.lang.Integer);
35 * - the name of the value's class is identical to the declared name;
36 * - the declared name can be loaded by the value's class loader and
37 * produces a class to which the value can be assigned.
38 * @author Luis-Miguel Alventosa
39 *
40 * @run clean RequiredModelMBeanGetAttributeTest
41 * @run build RequiredModelMBeanGetAttributeTest
42 * @run main RequiredModelMBeanGetAttributeTest
43 */
44
45 import java.lang.reflect.Method;
46 import java.util.Hashtable;
47 import java.util.Map;
48 import javax.management.Descriptor;
49 import javax.management.MBeanServer;
50 import javax.management.MBeanServerFactory;
51 import javax.management.ObjectName;
52 import javax.management.modelmbean.DescriptorSupport;
53 import javax.management.modelmbean.ModelMBean;
54 import javax.management.modelmbean.ModelMBeanAttributeInfo;
55 import javax.management.modelmbean.ModelMBeanInfo;
56 import javax.management.modelmbean.ModelMBeanInfoSupport;
57 import javax.management.modelmbean.ModelMBeanOperationInfo;
58 import javax.management.modelmbean.RequiredModelMBean;
59
|