langtools/test/tools/javadoc/parser/7091528/T7091528.java
changeset 23973 4b5f3a297142
parent 23116 4c134ccd6b8d
child 30730 d3ce7619db2c
equal deleted inserted replaced
23972:af37c1dbcb88 23973:4b5f3a297142
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /**
    24 /**
    25  * @test
    25  * @test
    26  * @bug     7091528 8029145
    26  * @bug     7091528 8029145 8037484
    27  * @summary ensures javadoc parses unique source files and ignores all class files
    27  * @summary ensures javadoc parses unique source files and ignores all class files
    28  * @compile p/C1.java p/q/C2.java
    28  * @compile p/C1.java p/q/C2.java
    29  * @run main T7091528
    29  * @run main T7091528
    30  */
    30  */
    31 
    31 
    48         // 8029145, tests if unique source files are parsed
    48         // 8029145, tests if unique source files are parsed
    49         runTest("-d", ".",
    49         runTest("-d", ".",
    50             "-sourcepath", testSrc.getAbsolutePath(),
    50             "-sourcepath", testSrc.getAbsolutePath(),
    51             "-subpackages",
    51             "-subpackages",
    52             "p:p.q");
    52             "p:p.q");
       
    53         File testPkgDir = new File(testSrc, "p");
       
    54         File testFile = new File(testPkgDir, "C3.java");
       
    55         runTest("-d", ".",
       
    56             "-sourcepath", testSrc.getAbsolutePath(),
       
    57             testFile.getAbsolutePath(),
       
    58             "p");
       
    59         runTest("-d", ".",
       
    60             "-classpath", testSrc.getAbsolutePath(),
       
    61             testFile.getAbsolutePath(),
       
    62             "p");
    53 
    63 
    54     }
    64     }
    55     void runTest(String... args) {
    65     void runTest(String... args) {
    56         StringWriter sw = new StringWriter();
    66         StringWriter sw = new StringWriter();
    57         PrintWriter pw = new PrintWriter(sw);
    67         PrintWriter pw = new PrintWriter(sw);
    63         if (!out.isEmpty()) {
    73         if (!out.isEmpty()) {
    64             System.err.println(out);
    74             System.err.println(out);
    65         }
    75         }
    66 
    76 
    67         if (rc != 0)
    77         if (rc != 0)
    68             System.err.println("javadoc failed: exit code = " + rc);
    78             throw new Error("javadoc failed: exit code = " + rc);
    69 
    79 
    70         if (out.matches("(?s).*p/[^ ]+\\.class.*"))
    80         if (out.matches("(?s).*p/[^ ]+\\.class.*"))
    71             throw new Error("reading .class files");
    81             throw new Error("reading .class files");
    72 
    82 
    73         if (!new File("index.html").exists())
    83         if (!new File("index.html").exists())