Main.java revision 553
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte/*
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte *
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * This code is free software; you can redistribute it and/or modify it
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * under the terms of the GNU General Public License version 2 only, as
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * published by the Free Software Foundation.
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte *
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * This code is distributed in the hope that it will be useful, but WITHOUT
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * version 2 for more details (a copy is included in the LICENSE file that
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * accompanied this code).
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte *
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * You should have received a copy of the GNU General Public License version
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * 2 along with this work; if not, write to the Free Software Foundation,
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte *
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * or visit www.oracle.com if you need additional information or have any
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * questions.
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte */
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte/*
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * @test
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * @bug 4904495
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * @summary Test an annotation type and annotations with elements of various
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * types.
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * @library ../../lib
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * @compile ../../lib/Tester.java Main.java
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte * @run main Main
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte */
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forteimport java.io.IOException;
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forteimport java.util.Arrays;
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forteimport com.sun.javadoc.*;
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forteimport com.sun.javadoc.AnnotationDesc.*;
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte
450396635f70344c58b6b1e4db38cf17ff34445cJohn Fortepublic class Main extends Tester.Doclet {
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte private static final Tester tester = new Tester("Main", "pkg1");
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte public static void main(String[] args) throws IOException {
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte tester.run();
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte tester.verify();
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte }
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte public static boolean start(RootDoc root) {
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte try {
450396635f70344c58b6b1e4db38cf17ff34445cJohn Forte ClassDoc[] cds = root.classes();
Arrays.sort(cds);
for (ClassDoc cd : cds) {
tester.printClass(cd);
tester.println();
}
return true;
} catch (IOException e) {
return false;
}
}
}