langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java
author jjg
Fri, 09 May 2014 15:37:12 -0700
changeset 24399 af1a0220d0fa
parent 24217 25b12d4d4192
child 30730 d3ce7619db2c
permissions -rw-r--r--
8038730: Clean up the way JavadocTester is invoked, and checks for errors. Reviewed-by: ksrini, sogoel, bpatel
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
     1
/*
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 21478
diff changeset
     2
 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
     4
 *
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
     8
 *
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    13
 * accompanied this code).
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    14
 *
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    18
 *
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    21
 * questions.
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    22
 */
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    23
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    24
/*
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    25
 * @test
21478
fa4c7cda1b41 8026567: Use meaningful style names for strong and italic styles.
bpatel
parents: 17567
diff changeset
    26
 * @bug      7180906 8026567
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    27
 * @summary  Test to make sure that the since tag works correctly
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    28
 * @author   Bhavesh Patel
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    29
 * @library  ../lib
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    30
 * @build    JavadocTester
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    31
 * @run main TestSinceTag
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    32
 */
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    33
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    34
public class TestSinceTag extends JavadocTester {
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    35
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    36
    public static void main(String... args) throws Exception {
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    37
        TestSinceTag tester = new TestSinceTag();
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    38
        tester.runTests();
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    39
        tester.printSummary();
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    40
    }
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    41
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    42
    @Test
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    43
    void testSince() {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    44
        javadoc("-d", "out-since",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    45
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    46
                "pkg1");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    47
        checkExit(Exit.FAILED); // TODO: investigate
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    48
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    49
        checkSince(true);
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    50
    }
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    51
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    52
    @Test
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    53
    void testNoSince() {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    54
        javadoc("-d", "out-nosince",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    55
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    56
                "-nosince",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    57
                "pkg1");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    58
        checkExit(Exit.FAILED); // TODO: investigate
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    59
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    60
        checkSince(false);
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    61
    }
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    62
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    63
    void checkSince(boolean on) {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    64
        checkOutput("pkg1/C1.html", on,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    65
                "<dl>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    66
                + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    67
                + "<dd>JDK1.0</dd>");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    68
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    69
        checkOutput("serialized-form.html", on,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    70
                "<dl>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    71
                + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    72
                + "<dd>1.4</dd>");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24217
diff changeset
    73
    }
13842
6908f6badce4 7180906: Javadoc tool does not apply parameter -nosince
bpatel
parents:
diff changeset
    74
}