1 /* |
1 /* |
2 * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
34 * @compile -processor ElementRepAnnoTester -proc:only MixSingularAndUnofficialContainerBasicTest.java |
34 * @compile -processor ElementRepAnnoTester -proc:only MixSingularAndUnofficialContainerBasicTest.java |
35 */ |
35 */ |
36 |
36 |
37 @ExpectedBase( |
37 @ExpectedBase( |
38 value = Foo.class, |
38 value = Foo.class, |
39 getAnnotation = "@Foo(value=0)", |
39 getAnnotation = "@Foo(0)", |
40 getAnnotationsByType = {"@Foo(value=0)"}, |
40 getAnnotationsByType = {"@Foo(0)"}, |
41 getAllAnnotationMirrors = { |
41 getAllAnnotationMirrors = { |
42 "@Foo(0)", |
42 "@Foo(0)", |
43 "@UnofficialContainer({@Foo(1), @Foo(2)})", |
43 "@UnofficialContainer({@Foo(1), @Foo(2)})", |
44 "ExpectedBase", |
44 "ExpectedBase", |
45 "ExpectedContainer" |
45 "ExpectedContainer" |
51 "ExpectedContainer" |
51 "ExpectedContainer" |
52 }) |
52 }) |
53 @ExpectedContainer( |
53 @ExpectedContainer( |
54 value = UnofficialContainer.class, |
54 value = UnofficialContainer.class, |
55 getAnnotation = "@UnofficialContainer(" |
55 getAnnotation = "@UnofficialContainer(" |
56 + "value={@Foo(value=1), @Foo(value=2)})", |
56 + "{@Foo(1), @Foo(2)})", |
57 getAnnotationsByType = {"@UnofficialContainer(" |
57 getAnnotationsByType = {"@UnofficialContainer(" |
58 + "value={@Foo(value=1), @Foo(value=2)})"}) |
58 + "{@Foo(1), @Foo(2)})"}) |
59 @Foo(value = 0) |
59 @Foo(0) |
60 @UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)}) |
60 @UnofficialContainer({@Foo(1), @Foo(2)}) |
61 class MixSingularAndUnofficialContainerBasicTest { |
61 class MixSingularAndUnofficialContainerBasicTest { |
62 |
62 |
63 @ExpectedBase( |
63 @ExpectedBase( |
64 value = Foo.class, |
64 value = Foo.class, |
65 getAnnotation = "@Foo(value=0)", |
65 getAnnotation = "@Foo(0)", |
66 getAnnotationsByType = {"@Foo(value=0)"}, |
66 getAnnotationsByType = {"@Foo(0)"}, |
67 getAllAnnotationMirrors = { |
67 getAllAnnotationMirrors = { |
68 "@Foo(0)", |
68 "@Foo(0)", |
69 "@UnofficialContainer({@Foo(1), @Foo(2)})", |
69 "@UnofficialContainer({@Foo(1), @Foo(2)})", |
70 "ExpectedBase", |
70 "ExpectedBase", |
71 "ExpectedContainer" |
71 "ExpectedContainer" |
77 "ExpectedContainer" |
77 "ExpectedContainer" |
78 }) |
78 }) |
79 @ExpectedContainer( |
79 @ExpectedContainer( |
80 value = UnofficialContainer.class, |
80 value = UnofficialContainer.class, |
81 getAnnotation = "@UnofficialContainer(" |
81 getAnnotation = "@UnofficialContainer(" |
82 + "value={@Foo(value=1), @Foo(value=2)})", |
82 + "{@Foo(1), @Foo(2)})", |
83 getAnnotationsByType = {"@UnofficialContainer(" |
83 getAnnotationsByType = {"@UnofficialContainer(" |
84 + "value={@Foo(value=1), @Foo(value=2)})"}) |
84 + "{@Foo(1), @Foo(2)})"}) |
85 @Foo(value = 0) |
85 @Foo(0) |
86 @UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)}) |
86 @UnofficialContainer({@Foo(1), @Foo(2)}) |
87 int testField = 0; |
87 int testField = 0; |
88 |
88 |
89 @ExpectedBase( |
89 @ExpectedBase( |
90 value = Foo.class, |
90 value = Foo.class, |
91 getAnnotation = "@Foo(value=0)", |
91 getAnnotation = "@Foo(0)", |
92 getAnnotationsByType = {"@Foo(value=0)"}, |
92 getAnnotationsByType = {"@Foo(0)"}, |
93 getAllAnnotationMirrors = { |
93 getAllAnnotationMirrors = { |
94 "@Foo(0)", |
94 "@Foo(0)", |
95 "@UnofficialContainer({@Foo(1), @Foo(2)})", |
95 "@UnofficialContainer({@Foo(1), @Foo(2)})", |
96 "ExpectedBase", |
96 "ExpectedBase", |
97 "ExpectedContainer" |
97 "ExpectedContainer" |
103 "ExpectedContainer" |
103 "ExpectedContainer" |
104 }) |
104 }) |
105 @ExpectedContainer( |
105 @ExpectedContainer( |
106 value = UnofficialContainer.class, |
106 value = UnofficialContainer.class, |
107 getAnnotation = "@UnofficialContainer(" |
107 getAnnotation = "@UnofficialContainer(" |
108 + "value={@Foo(value=1), @Foo(value=2)})", |
108 + "{@Foo(1), @Foo(2)})", |
109 getAnnotationsByType = {"@UnofficialContainer(" |
109 getAnnotationsByType = {"@UnofficialContainer(" |
110 + "value={@Foo(value=1), @Foo(value=2)})"}) |
110 + "{@Foo(1), @Foo(2)})"}) |
111 @Foo(value = 0) |
111 @Foo(0) |
112 @UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)}) |
112 @UnofficialContainer({@Foo(1), @Foo(2)}) |
113 void testMethod() {} |
113 void testMethod() {} |
114 } |
114 } |