/* * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * @test * @bug 8005092 6469562 * @summary Test repeated annotations output. * @author bpatel * @library ../lib * @modules jdk.javadoc * @build JavadocTester * @run main TestRepeatedAnnotations */ public class TestRepeatedAnnotations extends JavadocTester { public static void main(String... args) throws Exception { TestRepeatedAnnotations tester = new TestRepeatedAnnotations(); tester.runTests(); } @Test void test() { javadoc("-d", "out", "-sourcepath", testSrc, "pkg", "pkg1"); checkExit(Exit.OK); checkOutput("pkg/C.html", true, "@ContaineeSynthDoc " + "@ContaineeSynthDoc", "@ContaineeRegDoc " + "@ContaineeRegDoc", "@RegContainerDoc" + "({" + "@RegContaineeNotDoc," + "@RegContaineeNotDoc})", "@ContaineeSynthDoc " + "@ContaineeSynthDoc " + "@ContaineeSynthDoc", "@ContainerSynthDoc(" + "" + "@ContaineeSynthDoc)", "@ContaineeSynthDoc " + "@ContaineeSynthDoc"); checkOutput("pkg/D.html", true, "@RegDoc" + "(x=1)", "@RegArryDoc" + "(y=1)", "@RegArryDoc" + "(y={1,2})", "@NonSynthDocContainer" + "(" + "@RegArryDoc)"); checkOutput("pkg1/C.html", true, "@RegContainerValDoc" + "(value={" + "@RegContaineeNotDoc," + "@RegContaineeNotDoc}," + "y=3)", "@ContainerValDoc" + "(value={" + "@ContaineeNotDoc," + "@ContaineeNotDoc}," + "x=1)"); checkOutput("pkg/C.html", false, "@RegContaineeDoc " + "@RegContaineeDoc", "@RegContainerNotDoc" + "(value={" + "@RegContaineeNotDoc," + "@RegContaineeNotDoc})"); checkOutput("pkg1/C.html", false, "@ContaineeSynthDoc " + "@ContaineeSynthDoc", "@RegContainerValNotDoc" + "(value={" + "@RegContaineeDoc," + "@RegContaineeDoc}," + "y=4)", "@ContainerValNotDoc" + "(value={" + "@ContaineeNotDoc," + "@ContaineeNotDoc}," + "x=2)", "@ContainerSynthNotDoc(" + "value=" + "@ContaineeSynthDoc)"); } }