langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java
changeset 24399 af1a0220d0fa
parent 24072 e7549dcbc4af
child 30730 d3ce7619db2c
equal deleted inserted replaced
24398:601a611d0aee 24399:af1a0220d0fa
    25  * @test
    25  * @test
    26  * @bug      4933335
    26  * @bug      4933335
    27  * @summary  Make sure that all inherited methods from multiple extended
    27  * @summary  Make sure that all inherited methods from multiple extended
    28  *           interfaces are documented
    28  *           interfaces are documented
    29  * @author   jamieh
    29  * @author   jamieh
    30  * @library  ../lib/
    30  * @library  ../lib
    31  * @build    JavadocTester
    31  * @build    JavadocTester
    32  * @build    TestMultiInheritence
       
    33  * @run main TestMultiInheritence
    32  * @run main TestMultiInheritence
    34  */
    33  */
    35 
    34 
       
    35 // TODO: should be TestMultiInheritance
    36 public class TestMultiInheritence extends JavadocTester {
    36 public class TestMultiInheritence extends JavadocTester {
    37 
    37 
    38     //Javadoc arguments.
    38     public static void main(String... args) throws Exception {
    39     private static final String[] ARGS = new String[] {
    39         TestMultiInheritence tester = new TestMultiInheritence();
    40         "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg3"
    40         tester.runTests();
    41     };
    41     }
    42 
    42 
    43     //Method foo() is inherited from BOTH I2 and I3
    43     @Test
    44     private static final String[][] TEST = {
    44     void test() {
    45        { "pkg3/I1.html",
    45         javadoc("-d", "out",
    46         "Methods inherited from interface pkg3." +
    46                 "-sourcepath", testSrc,
    47                 "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">" +
    47                 "pkg3");
    48                 "I2</a>"},
    48         checkExit(Exit.OK);
    49         { "pkg3/I1.html",
       
    50         "Methods inherited from interface&nbsp;pkg3." +
       
    51                  "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">" +
       
    52                  "I3</a>"},
       
    53         { "pkg3/I0.html",
       
    54         "Methods inherited from interface&nbsp;pkg3." +
       
    55                  "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">" +
       
    56                  "I2</a>"},
       
    57         { "pkg3/I0.html",
       
    58         "Methods inherited from interface&nbsp;pkg3." +
       
    59                  "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">" +
       
    60                  "I3</a>"},
       
    61     };
       
    62 
    49 
    63     //Method foo() is NOT inherited from I4 because it is overriden by
    50         // Method foo() is inherited from BOTH I2 and I3
    64     //I3.
       
    65     private static final String[][] NEGATED_TEST = {
       
    66         { "pkg3/I1.html",
       
    67         "Methods inherited from interface&nbsp;pkg3." +
       
    68                  "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">" +
       
    69                  "I4</a>"},
       
    70         { "pkg3/I0.html",
       
    71         "Methods inherited from interface&nbsp;pkg3." +
       
    72                  "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">" +
       
    73                  "I4</a>"},
       
    74     };
       
    75 
    51 
    76     /**
    52         checkOutput("pkg3/I1.html", true,
    77      * The entry point of the test.
    53                 "Methods inherited from interface&nbsp;pkg3."
    78      * @param args the array of command line arguments.
    54                 + "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">"
    79      */
    55                 + "I2</a>",
    80     public static void main(String[] args) {
    56                 "Methods inherited from interface&nbsp;pkg3."
    81         TestMultiInheritence tester = new TestMultiInheritence();
    57                 + "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">"
    82         tester.run(ARGS, TEST, NEGATED_TEST);
    58                 + "I3</a>");
    83         tester.printSummary();
    59 
       
    60         checkOutput("pkg3/I0.html", true,
       
    61                 "Methods inherited from interface&nbsp;pkg3."
       
    62                 + "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">"
       
    63                 + "I2</a>",
       
    64                 "Methods inherited from interface&nbsp;pkg3."
       
    65                 + "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">"
       
    66                 + "I3</a>");
       
    67 
       
    68         // Method foo() is NOT inherited from I4 because it is overriden by I3.
       
    69 
       
    70         checkOutput("pkg3/I1.html", false,
       
    71                 "Methods inherited from interface&nbsp;pkg3."
       
    72                 + "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">"
       
    73                 + "I4</a>");
       
    74 
       
    75         checkOutput("pkg3/I0.html", false,
       
    76                 "Methods inherited from interface&nbsp;pkg3."
       
    77                 + "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">"
       
    78                 + "I4</a>");
    84     }
    79     }
    85 }
    80 }