Thu, 25 Jul 2013 11:02:27 +0200
8007961: javax.lang.model tests for repeating annotations fail in getAnnotationsByType
Reviewed-by: jjg
jfranck@1560 | 1 | /* |
jfranck@1560 | 2 | * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
jfranck@1560 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
jfranck@1560 | 4 | * |
jfranck@1560 | 5 | * This code is free software; you can redistribute it and/or modify it |
jfranck@1560 | 6 | * under the terms of the GNU General Public License version 2 only, as |
jfranck@1560 | 7 | * published by the Free Software Foundation. |
jfranck@1560 | 8 | * |
jfranck@1560 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
jfranck@1560 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
jfranck@1560 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
jfranck@1560 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
jfranck@1560 | 13 | * accompanied this code). |
jfranck@1560 | 14 | * |
jfranck@1560 | 15 | * You should have received a copy of the GNU General Public License version |
jfranck@1560 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
jfranck@1560 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
jfranck@1560 | 18 | * |
jfranck@1560 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
jfranck@1560 | 20 | * or visit www.oracle.com if you need additional information or have any |
jfranck@1560 | 21 | * questions. |
jfranck@1560 | 22 | */ |
jfranck@1560 | 23 | |
jfranck@1560 | 24 | /* |
jfranck@1560 | 25 | * @test |
jfranck@1918 | 26 | * @bug 8004822 8007961 |
jfranck@1560 | 27 | * @author mnunez |
jfranck@1560 | 28 | * @summary Language model api test basics for repeating annotations |
jfranck@1560 | 29 | * @library /tools/javac/lib |
jfranck@1560 | 30 | * @library supportingAnnotations |
jfranck@1560 | 31 | * @build JavacTestingAbstractProcessor ElementRepAnnoTester |
jfranck@1560 | 32 | * @compile -processor ElementRepAnnoTester -proc:only RepeatableOverrideBTest.java |
jfranck@1560 | 33 | */ |
jfranck@1560 | 34 | |
jfranck@1560 | 35 | @BarInherited(value = 0) |
jfranck@1560 | 36 | class C {} |
jfranck@1560 | 37 | |
jfranck@1560 | 38 | @ExpectedBase( |
jfranck@1560 | 39 | value = BarInherited.class, |
jfranck@1560 | 40 | getAnnotation = "@BarInherited(value=0)", |
jfranck@1560 | 41 | getAnnotationsByType = { |
jfranck@1560 | 42 | "@BarInherited(value=1)", |
jfranck@1560 | 43 | "@BarInherited(value=2)" |
jfranck@1560 | 44 | }, |
jfranck@1560 | 45 | getAllAnnotationMirrors = { |
jfranck@1560 | 46 | "@BarInherited(0)", |
jfranck@1560 | 47 | "@BarInheritedContainer({@BarInherited(1), @BarInherited(2)})", |
jfranck@1560 | 48 | "ExpectedBase", |
jfranck@1560 | 49 | "ExpectedContainer" |
jfranck@1560 | 50 | }, |
jfranck@1560 | 51 | getAnnotationMirrors = { |
jfranck@1560 | 52 | "@BarInheritedContainer({@BarInherited(1), @BarInherited(2)})", |
jfranck@1560 | 53 | "ExpectedBase", |
jfranck@1560 | 54 | "ExpectedContainer" |
jfranck@1560 | 55 | }) |
jfranck@1560 | 56 | @ExpectedContainer( |
jfranck@1560 | 57 | value = BarInheritedContainer.class, |
jfranck@1560 | 58 | getAnnotation = "@BarInheritedContainer(" |
jfranck@1560 | 59 | + "value=[@BarInherited(value=1), @BarInherited(value=2)])", |
jfranck@1560 | 60 | getAnnotationsByType = {"@BarInheritedContainer(" |
jfranck@1560 | 61 | + "value=[@BarInherited(value=1), @BarInherited(value=2)])"}) |
jfranck@1560 | 62 | @BarInherited(value = 1) |
jfranck@1560 | 63 | @BarInherited(value = 2) |
jfranck@1560 | 64 | class RepeatableOverrideBTest extends C {} |