test/tools/javac/processing/model/element/repeatingAnnotations/RepeatableOverrideATest.java

Thu, 25 Jul 2013 11:02:27 +0200

author
jfranck
date
Thu, 25 Jul 2013 11:02:27 +0200
changeset 1918
a218f7befd55
parent 1721
abd153854f16
child 2525
2eb010b6cb22
permissions
-rw-r--r--

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 RepeatableOverrideATest.java
jfranck@1560 33 */
jfranck@1560 34
jfranck@1560 35 @BarInherited(value = 1)
jfranck@1560 36 @BarInherited(value = 2)
jfranck@1560 37 class B {}
jfranck@1560 38
jfranck@1560 39 @ExpectedBase(
jfranck@1560 40 value = BarInherited.class,
jfranck@1560 41 getAnnotation = "@BarInherited(value=3)",
jfranck@1560 42 getAnnotationsByType = {"@BarInherited(value=3)"},
jfranck@1560 43 getAllAnnotationMirrors = {
jfranck@1560 44 "@BarInherited(3)",
jfranck@1560 45 "@BarInheritedContainer({@BarInherited(1), @BarInherited(2)})",
jfranck@1560 46 "ExpectedBase",
jfranck@1560 47 "ExpectedContainer"
jfranck@1560 48 },
jfranck@1560 49 getAnnotationMirrors = {
jfranck@1560 50 "@BarInherited(3)",
jfranck@1560 51 "ExpectedBase",
jfranck@1560 52 "ExpectedContainer"
jfranck@1560 53 })
jfranck@1560 54 @ExpectedContainer(
jfranck@1560 55 value = BarInheritedContainer.class,
jfranck@1560 56 getAnnotation = "@BarInheritedContainer("
jfranck@1560 57 + "value=[@BarInherited(value=1), @BarInherited(value=2)])",
jfranck@1560 58 getAnnotationsByType = {"@BarInheritedContainer("
jfranck@1560 59 + "value=[@BarInherited(value=1), @BarInherited(value=2)])"})
jfranck@1560 60 @BarInherited(value = 3)
jfranck@1560 61 class RepeatableOverrideATest extends B {}

mercurial