langtools/test/com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java
author jjg
Wed, 16 Apr 2014 16:17:09 -0700
changeset 23971 f5ff1f5a8dee
parent 23139 612191246a7d
child 24065 fc4022e50129
permissions -rw-r--r--
8031649: Clean up javadoc tests Reviewed-by: jjg Contributed-by: neil.toda@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9592
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
     1
/*
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 23139
diff changeset
     2
 * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
9592
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
     4
 *
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
     8
 *
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    13
 * accompanied this code).
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    14
 *
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    18
 *
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    21
 * questions.
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    22
 */
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    23
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    24
/*
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    25
 * @test
21008
af0b915df7cc 8025633: Fix javadoc to generate valid anchor names
bpatel
parents: 9592
diff changeset
    26
 * @bug      6758050 8025633
9592
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    27
 * @summary  Test HTML output for nested generic types.
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    28
 * @author   bpatel
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    29
 * @library  ../lib/
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    30
 * @build    JavadocTester TestNestedGenerics
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    31
 * @run main TestNestedGenerics
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    32
 */
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    33
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    34
public class TestNestedGenerics extends JavadocTester {
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    35
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    36
    //Test information.
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    37
    private static final String BUG_ID = "6758050";
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    38
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    39
    //Javadoc arguments.
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    40
    private static final String[] ARGS = new String[]{
23139
612191246a7d 8031670: Remove unneeded -source options in javadoc tests
darcy
parents: 21008
diff changeset
    41
        "-d", BUG_ID, "-sourcepath", SRC_DIR,
9592
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    42
        "pkg"
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    43
    };
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    44
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    45
    //Input for string search tests.
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    46
    private static final String[][] TEST = {
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 23139
diff changeset
    47
        {BUG_ID + "/pkg/NestedGenerics.html",
9592
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    48
            "<div class=\"block\">Contains <a " +
21008
af0b915df7cc 8025633: Fix javadoc to generate valid anchor names
bpatel
parents: 9592
diff changeset
    49
            "href=\"../pkg/NestedGenerics.html#foo-java.util.Map-\"><code>foo" +
9592
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    50
            "(java.util.Map&lt;A, java.util.Map&lt;A, A&gt;&gt;)</code></a></div>"
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    51
        }
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    52
    };
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    53
    private static final String[][] NEGATED_TEST = NO_TEST;
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    54
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    55
    /**
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    56
     * The entry point of the test.
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    57
     * @param args the array of command line arguments.
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    58
     */
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    59
    public static void main(String[] args) {
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    60
        TestNestedGenerics tester = new TestNestedGenerics();
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    61
        run(tester, ARGS, TEST, NEGATED_TEST);
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    62
        tester.printSummary();
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    63
    }
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    64
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    65
    /**
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    66
     * {@inheritDoc}
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    67
     */
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    68
    public String getBugId() {
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    69
        return BUG_ID;
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    70
    }
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    71
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    72
    /**
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    73
     * {@inheritDoc}
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    74
     */
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    75
    public String getBugName() {
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    76
        return getClass().getName();
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    77
    }
82e14c156b3b 6758050: javadoc handles nested generic types incorrectly
bpatel
parents:
diff changeset
    78
}