test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTag.java
changeset 53097 2e82ca64b25d
parent 50612 e10812a82a3b
equal deleted inserted replaced
53096:58154bf80f90 53097:2e82ca64b25d
    25  * @test
    25  * @test
    26  * @bug      4764045 8004825 8026567 8191030 8204330
    26  * @bug      4764045 8004825 8026567 8191030 8204330
    27  * @summary  This test ensures that the value tag works in all
    27  * @summary  This test ensures that the value tag works in all
    28  *           use cases, the tests are explained below.
    28  *           use cases, the tests are explained below.
    29  * @author   jamieh
    29  * @author   jamieh
    30  * @library ../lib
    30  * @library ../../lib
    31  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    31  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    32  * @build    JavadocTester
    32  * @build    javadoc.tester.*
    33  * @run main TestValueTag
    33  * @run main TestValueTag
    34  */
    34  */
    35 
    35 
    36 import java.io.IOException;
    36 import java.io.IOException;
    37 import java.nio.file.Files;
    37 import java.nio.file.Files;
    38 import java.nio.file.Path;
    38 import java.nio.file.Path;
    39 import java.nio.file.Paths;
    39 import java.nio.file.Paths;
    40 import java.util.List;
    40 import java.util.List;
    41 
    41 
       
    42 import javadoc.tester.JavadocTester;
       
    43 
    42 public class TestValueTag extends JavadocTester {
    44 public class TestValueTag extends JavadocTester {
    43 
    45 
    44     public static void main(String... args) throws Exception {
    46     public static void main(String... args) throws Exception {
    45         TestValueTag tester = new TestValueTag();
    47         TestValueTag tester = new TestValueTag();
    46         tester.runTests();
    48         tester.runTests();
    47     }
    49     }
    48 
    50 
    49     @Test
    51     @Test
    50     void test1() {
    52     public void test1() {
    51         javadoc("-d", "out1",
    53         javadoc("-d", "out1",
    52                 "-sourcepath", testSrc,
    54                 "-sourcepath", testSrc,
    53                 "-tag", "todo",
    55                 "-tag", "todo",
    54                 "pkg1", "pkg2");
    56                 "pkg1", "pkg2");
    55         checkExit(Exit.ERROR);
    57         checkExit(Exit.ERROR);
   115 
   117 
   116         checkForException();
   118         checkForException();
   117     }
   119     }
   118 
   120 
   119     @Test
   121     @Test
   120     void test2() {
   122     public void test2() {
   121         javadoc("-Xdoclint:none",
   123         javadoc("-Xdoclint:none",
   122                 "-d", "out2",
   124                 "-d", "out2",
   123                 "-sourcepath", testSrc,
   125                 "-sourcepath", testSrc,
   124                 "-tag", "todo",
   126                 "-tag", "todo",
   125                 "pkg1", "pkg2");
   127                 "pkg1", "pkg2");
   138         );
   140         );
   139         checkForException();
   141         checkForException();
   140     }
   142     }
   141 
   143 
   142     @Test
   144     @Test
   143     void test3() {
   145     public void test3() {
   144         javadoc("-d", "out3",
   146         javadoc("-d", "out3",
   145                 "-sourcepath", testSrc,
   147                 "-sourcepath", testSrc,
   146                 "pkg2", "pkg3");
   148                 "pkg2", "pkg3");
   147         checkExit(Exit.OK);
   149         checkExit(Exit.OK);
   148 
   150 
   154                 + "\"Test 12 passes\"</a>.");
   156                 + "\"Test 12 passes\"</a>.");
   155         checkForException();
   157         checkForException();
   156     }
   158     }
   157 
   159 
   158     @Test
   160     @Test
   159     void test4() throws IOException {
   161     public void test4() throws IOException {
   160         Path base = Paths.get("test4");
   162         Path base = Paths.get("test4");
   161         Path src = base.resolve("src");
   163         Path src = base.resolve("src");
   162         Files.createDirectories(src.resolve("p"));
   164         Files.createDirectories(src.resolve("p"));
   163         Files.write(src.resolve("p").resolve("C.java"), List.of(
   165         Files.write(src.resolve("p").resolve("C.java"), List.of(
   164                 "package p;",
   166                 "package p;",