langtools/test/tools/javac/processing/model/element/repeatingAnnotations/UnofficialContainerBasicTest.java
changeset 40231 ba38ad2dd137
parent 30730 d3ce7619db2c
equal deleted inserted replaced
40230:3e8975c92291 40231:ba38ad2dd137
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2016, 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.
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug     8004822
    26  * @bug     8004822 8163113
    27  * @author  mnunez
    27  * @author  mnunez
    28  * @summary Language model api test basics for repeating annotations
    28  * @summary Language model api test basics for repeating annotations
    29  * @library /tools/javac/lib
    29  * @library /tools/javac/lib
    30  * @library supportingAnnotations
    30  * @library supportingAnnotations
    31  * @modules java.compiler
    31  * @modules java.compiler
    48             "ExpectedBase",
    48             "ExpectedBase",
    49             "ExpectedContainer"
    49             "ExpectedContainer"
    50         })
    50         })
    51 @ExpectedContainer(
    51 @ExpectedContainer(
    52         value = UnofficialContainer.class,
    52         value = UnofficialContainer.class,
    53         getAnnotation = "@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])",
    53         getAnnotation = "@UnofficialContainer(value={@Foo(value=1), @Foo(value=2)})",
    54         getAnnotationsByType = {"@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])"})
    54         getAnnotationsByType = {"@UnofficialContainer(value={@Foo(value=1), @Foo(value=2)})"})
    55 @UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)})
    55 @UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)})
    56 class UnofficialContainerBasicTest {
    56 class UnofficialContainerBasicTest {
    57 
    57 
    58     @ExpectedBase(
    58     @ExpectedBase(
    59             value = Foo.class,
    59             value = Foo.class,
    69                 "ExpectedBase",
    69                 "ExpectedBase",
    70                 "ExpectedContainer"
    70                 "ExpectedContainer"
    71             })
    71             })
    72     @ExpectedContainer(
    72     @ExpectedContainer(
    73             value = UnofficialContainer.class,
    73             value = UnofficialContainer.class,
    74             getAnnotation = "@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])",
    74             getAnnotation = "@UnofficialContainer(value={@Foo(value=1), @Foo(value=2)})",
    75             getAnnotationsByType = {"@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])"})
    75             getAnnotationsByType = {"@UnofficialContainer(value={@Foo(value=1), @Foo(value=2)})"})
    76     @UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)})
    76     @UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)})
    77     int testField = 0;
    77     int testField = 0;
    78 
    78 
    79     @ExpectedBase(
    79     @ExpectedBase(
    80             value = Foo.class,
    80             value = Foo.class,
    90                 "ExpectedBase",
    90                 "ExpectedBase",
    91                 "ExpectedContainer"
    91                 "ExpectedContainer"
    92             })
    92             })
    93     @ExpectedContainer(
    93     @ExpectedContainer(
    94             value = UnofficialContainer.class,
    94             value = UnofficialContainer.class,
    95             getAnnotation = "@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])",
    95             getAnnotation = "@UnofficialContainer(value={@Foo(value=1), @Foo(value=2)})",
    96             getAnnotationsByType = {"@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])"})
    96             getAnnotationsByType = {"@UnofficialContainer(value={@Foo(value=1), @Foo(value=2)})"})
    97     @UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)})
    97     @UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)})
    98     void testMethod() {}
    98     void testMethod() {}
    99 }
    99 }