553N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 487N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 487N/A * This code is free software; you can redistribute it and/or modify it 487N/A * under the terms of the GNU General Public License version 2 only, as 487N/A * published by the Free Software Foundation. 487N/A * This code is distributed in the hope that it will be useful, but WITHOUT 487N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 487N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 487N/A * version 2 for more details (a copy is included in the LICENSE file that 487N/A * accompanied this code). 487N/A * You should have received a copy of the GNU General Public License version 487N/A * 2 along with this work; if not, write to the Free Software Foundation, 487N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 553N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 553N/A * or visit www.oracle.com if you need additional information or have any 487N/A * Test processor used to check test programs using the @Test, @DA, and @TA 487N/A * The processor looks for elements annotated with @Test, and analyzes the 487N/A * syntax trees for those elements. Within such trees, the processor looks 487N/A * for the DA annotations on decls and TA annotations on types. 487N/A * The value of these annotations should be a simple string rendition of 487N/A * the tree node to which it is attached. 487N/A * The expected number of annotations is given by the parameter to the 487N/A * @Test annotation itself. 487N/A /** Process trees for elements annotated with the @Test(n) annotation. */ 487N/A /** Get the AnnotationMirror on an element for a given annotation. */ 487N/A /** Get the value of the value element of an annotation mirror. */ 487N/A /** Report an error to the annotation processing system. */ 487N/A /** Report an error to the annotation processing system. */ 487N/A // need better API for reporting tree position errors to the messager 487N/A /** Get the line number for the primary position for a tree. 487N/A * The code is intended to be simple, although not necessarily efficient. 487N/A * However, note that a file manager such as JavacFileManager is likely 487N/A * to cache the results of file.getCharContent, avoiding the need to read 487N/A * the bits from disk each time this method is called. 487N/A if (
cs.
charAt(i) ==
'\n')
// jtreg tests always use Unix line endings 487N/A /** Scan a tree, looking for @DA and @TA annotations, and verifying that such 487N/A * annotations are attached to the expected tree node matching the string 487N/A * parameter of the annotation. 487N/A /** Create a scanner for a given file. */ 487N/A /** Check the annotations in a given tree. */ 487N/A /** Check @DA annotations on a class declaration. */ 487N/A /** Check @DA annotations on a method declaration. */ 487N/A /** Check @DA annotations on a field, parameter or local variable declaration. */ 487N/A /** Check @TA annotations on a type. */ 487N/A /** Check to see if a list of annotations contains a named annotation, and 487N/A * if so, verify the annotation is expected by comparing the value of the 487N/A * annotation's argument against the string rendition of the reference tree 487N/A * @param annos the list of annotations to be checked 487N/A * @param name the name of the annotation to be checked 487N/A * @param tree the tree against which to compare the annotations's argument 487N/A /** Get the string value of an annotation argument, which is given by the 487N/A * expression <i>name</i>=<i>value</i>. 487N/A /** The file for the tree. Used to locate errors. */ 487N/A /** The number of annotations that have been found. @see #check */ 487N/A /** Convert a type or decl tree to a reference string used by the @DA and @TA annotations. */ 487N/A /** Convert a type or decl tree to a string. */