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