20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 */
24
25 import java.beans.ConstructorProperties;
26 import javax.management.ConstructorParameters;
27 import javax.management.MBeanServer;
28 import javax.management.MBeanServerFactory;
29 import javax.management.ObjectName;
30
31 /*
32 * @test
33 * @bug 7199353
34 * @summary Asserts that 'java.beans.ConstructorProperties' annotation is still
35 * recognized and properly handled for custom types mapped to open types.
36 * Also, makes sure that if the same constructor is annotated by both
37 * j.b.ConstructorProperties and j.m.ConstructorProperties annotations
38 * only j.m.ConstructorProperties annotation is considered.
39 * @author Jaroslav Bachorik
40 * @modules java.management
41 * java.desktop
42 * @run main LegacyConstructorPropertiesTest
43 */
44
45 public class LegacyConstructorPropertiesTest {
46 public static class CustomType {
47 private String name;
48 private int value;
49 @ConstructorProperties({"name", "value"})
50 public CustomType(String name, int value) {
51 this.name = name;
52 this.value = value;
53 }
54
55 // if @java.beans.ConstructorProperties would be used
56 // the introspector would choke on this
57 @ConstructorProperties("noname")
58 @ConstructorParameters("name")
59 public CustomType(String name) {
60 this.name = name;
61 this.value = -1;
|
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 */
24
25 import java.beans.ConstructorProperties;
26 import javax.management.ConstructorParameters;
27 import javax.management.MBeanServer;
28 import javax.management.MBeanServerFactory;
29 import javax.management.ObjectName;
30
31 /*
32 * @test
33 * @bug 7199353
34 * @summary Asserts that 'java.beans.ConstructorProperties' annotation is still
35 * recognized and properly handled for custom types mapped to open types.
36 * Also, makes sure that if the same constructor is annotated by both
37 * j.b.ConstructorProperties and j.m.ConstructorProperties annotations
38 * only j.m.ConstructorProperties annotation is considered.
39 * @author Jaroslav Bachorik
40 *
41 * @modules java.desktop
42 * java.management
43 *
44 * @run main LegacyConstructorPropertiesTest
45 */
46
47 public class LegacyConstructorPropertiesTest {
48 public static class CustomType {
49 private String name;
50 private int value;
51 @ConstructorProperties({"name", "value"})
52 public CustomType(String name, int value) {
53 this.name = name;
54 this.value = value;
55 }
56
57 // if @java.beans.ConstructorProperties would be used
58 // the introspector would choke on this
59 @ConstructorProperties("noname")
60 @ConstructorParameters("name")
61 public CustomType(String name) {
62 this.name = name;
63 this.value = -1;
|