langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java
changeset 24072 e7549dcbc4af
parent 24065 fc4022e50129
child 24399 af1a0220d0fa
equal deleted inserted replaced
24071:b0845717434e 24072:e7549dcbc4af
    33  * @run main TestOverridenPrivateMethods
    33  * @run main TestOverridenPrivateMethods
    34  */
    34  */
    35 
    35 
    36 public class TestOverridenPrivateMethods extends JavadocTester {
    36 public class TestOverridenPrivateMethods extends JavadocTester {
    37 
    37 
    38     private static final String BUG_ID = "4634891";
       
    39 
       
    40     private static final String[][] TEST = {
    38     private static final String[][] TEST = {
    41         //The public method should be overriden
    39         //The public method should be overriden
    42         {BUG_ID + "/pkg1/SubClass.html",
    40         { "pkg1/SubClass.html",
    43          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
    41          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
    44                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
    42                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
    45 
    43 
    46         //The public method in different package should be overriden
    44         //The public method in different package should be overriden
    47         {BUG_ID + "/pkg2/SubClass.html",
    45         { "pkg2/SubClass.html",
    48          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
    46          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
    49                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"}
    47                  "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"}
    50     };
    48     };
    51 
    49 
    52     private static final String[][] NEGATED_TEST = {
    50     private static final String[][] NEGATED_TEST = {
    53 
    51 
    54         //The package private method should be overriden since the base and sub class are in the same
    52         //The package private method should be overriden since the base and sub class are in the same
    55         //package.  However, the link should not show up because the package private methods are not documented.
    53         //package.  However, the link should not show up because the package private methods are not documented.
    56         {BUG_ID + "/pkg1/SubClass.html",
    54         { "pkg1/SubClass.html",
    57          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
    55          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
    58                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"},
    56                  "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"},
    59 
    57 
    60         //The private method in should not be overriden
    58         //The private method in should not be overriden
    61         {BUG_ID + "/pkg1/SubClass.html",
    59         { "pkg1/SubClass.html",
    62          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
    60          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
    63                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
    61                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
    64 
    62 
    65         //The private method in different package should not be overriden
    63         //The private method in different package should not be overriden
    66         {BUG_ID + "/pkg2/SubClass.html",
    64         { "pkg2/SubClass.html",
    67          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
    65          "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
    68                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
    66                  "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
    69 
    67 
    70         //The package private method should not be overriden since the base and sub class are in
    68         //The package private method should not be overriden since the base and sub class are in
    71         //different packages.
    69         //different packages.
    72         {BUG_ID + "/pkg2/SubClass.html",
    70         { "pkg2/SubClass.html",
    73          "Overrides:</span></dt><dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}
    71          "Overrides:</span></dt><dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}
    74     };
    72     };
    75 
    73 
    76     private static final String[] ARGS =
    74     private static final String[] ARGS =
    77         new String[] {
    75         new String[] {
    78             "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2"};
    76             "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1", "pkg2"};
    79 
    77 
    80     /**
    78     /**
    81      * The entry point of the test.
    79      * The entry point of the test.
    82      * @param args the array of command line arguments.
    80      * @param args the array of command line arguments.
    83      */
    81      */
    84     public static void main(String[] args) {
    82     public static void main(String[] args) {
    85         TestOverridenPrivateMethods tester = new TestOverridenPrivateMethods();
    83         TestOverridenPrivateMethods tester = new TestOverridenPrivateMethods();
    86         tester.run(ARGS, TEST, NEGATED_TEST);
    84         tester.run(ARGS, TEST, NEGATED_TEST);
    87         tester.printSummary();
    85         tester.printSummary();
    88     }
    86     }
    89 
       
    90     /**
       
    91      * {@inheritDoc}
       
    92      */
       
    93     public String getBugId() {
       
    94         return BUG_ID;
       
    95     }
       
    96 
       
    97     /**
       
    98      * {@inheritDoc}
       
    99      */
       
   100     public String getBugName() {
       
   101         return getClass().getName();
       
   102     }
       
   103 }
    87 }