langtools/test/tools/javac/processing/errors/EnsureAnnotationTypeMismatchException/Source.java
author akulyakh
Thu, 21 May 2015 11:41:04 -0700
changeset 30730 d3ce7619db2c
parent 21015 f3bec12a63e7
child 36526 3b41f1c69604
permissions -rw-r--r--
8076543: Add @modules as needed to the langtools tests Reviewed-by: jjg, shurailine

/*
 * @test /nodynamiccopyright/
 * @bug 6278240
 * @summary Ensure AnnotationTypeMismatchException is thrown when appropriate
 *          with reasonable foundType filled.
 * @library /tools/javac/lib
 * @modules jdk.compiler/com.sun.tools.javac.util
 * @build JavacTestingAbstractProcessor Processor
 * @compile/fail/ref=Source.out -XDrawDiagnostics -processor Processor Source.java
 */

@Gen(fileName="Generated",
     content=
"class Generated {\n" +
"    @Check(classValue=String.class,\n" +
"           intConstValue=false,\n" +
"           enumValue=\"a\",\n" +
"           incorrectAnnotationValue=@Deprecated,\n" +
"           incorrectArrayValue={1, \"a\"},\n" +
"           incorrectClassValue=get())\n" +
"    public static Class<?> get() {\n" +
"        return null;\n" +
"    }\n" +
"}\n")
class Source {
}