langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java
changeset 24072 e7549dcbc4af
parent 24065 fc4022e50129
child 24217 25b12d4d4192
equal deleted inserted replaced
24071:b0845717434e 24072:e7549dcbc4af
    34  * @run main TestSerializedFormDeprecationInfo
    34  * @run main TestSerializedFormDeprecationInfo
    35  */
    35  */
    36 
    36 
    37 public class TestSerializedFormDeprecationInfo extends JavadocTester {
    37 public class TestSerializedFormDeprecationInfo extends JavadocTester {
    38 
    38 
    39     private static final String BUG_ID = "6802694";
       
    40 
       
    41     // Test for normal run of javadoc. The serialized-form.html should
    39     // Test for normal run of javadoc. The serialized-form.html should
    42     // display the inline comments, tags and deprecation information if any.
    40     // display the inline comments, tags and deprecation information if any.
    43     private static final String[][] TEST_CMNT_DEPR = {
    41     private static final String[][] TEST_CMNT_DEPR = {
    44         {BUG_ID + "/serialized-form.html", "<dl>\n" +
    42         { "serialized-form.html", "<dl>\n" +
    45                  "<dt><span class=\"throwsLabel\">Throws:</span></dt>\n" +
    43                  "<dt><span class=\"throwsLabel\">Throws:</span></dt>\n" +
    46                  "<dd><code>" +
    44                  "<dd><code>" +
    47                  "java.io.IOException</code></dd>\n" +
    45                  "java.io.IOException</code></dd>\n" +
    48                  "<dt><span class=\"seeLabel\">See Also:</span>" +
    46                  "<dt><span class=\"seeLabel\">See Also:</span>" +
    49                  "</dt>\n" +
    47                  "</dt>\n" +
    50                  "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
    48                  "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
    51                  "<code>C1.setUndecorated(boolean)</code></a></dd>\n" +
    49                  "<code>C1.setUndecorated(boolean)</code></a></dd>\n" +
    52                  "</dl>"},
    50                  "</dl>"},
    53         {BUG_ID + "/serialized-form.html",
    51         { "serialized-form.html",
    54                  "<span class=\"deprecatedLabel\">Deprecated.</span>" +
    52                  "<span class=\"deprecatedLabel\">Deprecated.</span>" +
    55                  "&nbsp;<span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" +
    53                  "&nbsp;<span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" +
    56                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
    54                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
    57                  "<code>setUndecorated(boolean)</code></a>.</span></div>\n" +
    55                  "<code>setUndecorated(boolean)</code></a>.</span></div>\n" +
    58                  "<div class=\"block\">This field indicates whether the C1 " +
    56                  "<div class=\"block\">This field indicates whether the C1 " +
    64                  "<dt><span class=\"seeLabel\">See Also:</span>" +
    62                  "<dt><span class=\"seeLabel\">See Also:</span>" +
    65                  "</dt>\n" +
    63                  "</dt>\n" +
    66                  "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
    64                  "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
    67                  "<code>C1.setUndecorated(boolean)</code></a></dd>\n" +
    65                  "<code>C1.setUndecorated(boolean)</code></a></dd>\n" +
    68                  "</dl>"},
    66                  "</dl>"},
    69         {BUG_ID + "/serialized-form.html",
    67         { "serialized-form.html",
    70                  "<span class=\"deprecatedLabel\">Deprecated.</span>" +
    68                  "<span class=\"deprecatedLabel\">Deprecated.</span>" +
    71                  "&nbsp;<span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" +
    69                  "&nbsp;<span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" +
    72                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
    70                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
    73                  "<code>setUndecorated(boolean)</code></a>.</span></div>\n" +
    71                  "<code>setUndecorated(boolean)</code></a>.</span></div>\n" +
    74                  "<div class=\"block\">Reads the object stream.</div>\n" +
    72                  "<div class=\"block\">Reads the object stream.</div>\n" +
    76                  "<dt><span class=\"throwsLabel\">Throws:</span></dt>\n" +
    74                  "<dt><span class=\"throwsLabel\">Throws:</span></dt>\n" +
    77                  "<dd><code><code>" +
    75                  "<dd><code><code>" +
    78                  "IOException</code></code></dd>\n" +
    76                  "IOException</code></code></dd>\n" +
    79                  "<dd><code>java.io.IOException</code></dd>\n" +
    77                  "<dd><code>java.io.IOException</code></dd>\n" +
    80                  "</dl>"},
    78                  "</dl>"},
    81         {BUG_ID + "/serialized-form.html",
    79         { "serialized-form.html",
    82                  "<span class=\"deprecatedLabel\">Deprecated.</span>" +
    80                  "<span class=\"deprecatedLabel\">Deprecated.</span>" +
    83                  "&nbsp;</div>\n" +
    81                  "&nbsp;</div>\n" +
    84                  "<div class=\"block\">" +
    82                  "<div class=\"block\">" +
    85                  "The name for this class.</div>"}};
    83                  "The name for this class.</div>"}};
    86 
    84 
    87     // Test with -nocomment option. The serialized-form.html should
    85     // Test with -nocomment option. The serialized-form.html should
    88     // not display the inline comments and tags but should display deprecation
    86     // not display the inline comments and tags but should display deprecation
    89     // information if any.
    87     // information if any.
    90     private static final String[][] TEST_NOCMNT = {
    88     private static final String[][] TEST_NOCMNT = {
    91         {BUG_ID + "/serialized-form.html",
    89         { "serialized-form.html",
    92                  "<pre>boolean undecorated</pre>\n" +
    90                  "<pre>boolean undecorated</pre>\n" +
    93                  "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;<span class=\"deprecationComment\">" +
    91                  "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span>&nbsp;<span class=\"deprecationComment\">" +
    94                  "As of JDK version 1.5, replaced by\n" +
    92                  "As of JDK version 1.5, replaced by\n" +
    95                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\"><code>" +
    93                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\"><code>" +
    96                  "setUndecorated(boolean)</code></a>.</span></div>\n" +
    94                  "setUndecorated(boolean)</code></a>.</span></div>\n" +
    97                  "</li>"},
    95                  "</li>"},
    98         {BUG_ID + "/serialized-form.html",
    96         { "serialized-form.html",
    99                  "<span class=\"deprecatedLabel\">" +
    97                  "<span class=\"deprecatedLabel\">" +
   100                  "Deprecated.</span>&nbsp;<span class=\"deprecationComment\">As of JDK version" +
    98                  "Deprecated.</span>&nbsp;<span class=\"deprecationComment\">As of JDK version" +
   101                  " 1.5, replaced by\n" +
    99                  " 1.5, replaced by\n" +
   102                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
   100                  " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" +
   103                  "<code>setUndecorated(boolean)</code></a>.</span></div>\n" +
   101                  "<code>setUndecorated(boolean)</code></a>.</span></div>\n" +
   115     // -nocomment option.
   113     // -nocomment option.
   116     private static final String[][] TEST_NOCMNT_NODEPR = TEST_NOCMNT;
   114     private static final String[][] TEST_NOCMNT_NODEPR = TEST_NOCMNT;
   117 
   115 
   118     private static final String[] ARGS1 =
   116     private static final String[] ARGS1 =
   119         new String[] {
   117         new String[] {
   120             "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"};
   118             "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"};
   121 
   119 
   122     private static final String[] ARGS2 =
   120     private static final String[] ARGS2 =
   123         new String[] {
   121         new String[] {
   124             "-d", BUG_ID, "-nocomment", "-sourcepath", SRC_DIR, "pkg1"};
   122             "-d", OUTPUT_DIR, "-nocomment", "-sourcepath", SRC_DIR, "pkg1"};
   125 
   123 
   126     private static final String[] ARGS3 =
   124     private static final String[] ARGS3 =
   127         new String[] {
   125         new String[] {
   128             "-d", BUG_ID, "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"};
   126             "-d", OUTPUT_DIR, "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"};
   129 
   127 
   130     private static final String[] ARGS4 =
   128     private static final String[] ARGS4 =
   131         new String[] {
   129         new String[] {
   132             "-d", BUG_ID, "-nocomment", "-nodeprecated", "-sourcepath",
   130             "-d", OUTPUT_DIR, "-nocomment", "-nodeprecated", "-sourcepath",
   133             SRC_DIR, "pkg1"};
   131             SRC_DIR, "pkg1"};
   134 
   132 
   135     /**
   133     /**
   136      * The entry point of the test.
   134      * The entry point of the test.
   137      * @param args the array of command line arguments.
   135      * @param args the array of command line arguments.
   142         tester.run(ARGS2, TEST_NOCMNT, TEST_CMNT_DEPR);
   140         tester.run(ARGS2, TEST_NOCMNT, TEST_CMNT_DEPR);
   143         tester.run(ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR);
   141         tester.run(ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR);
   144         tester.run(ARGS4, TEST_NOCMNT_NODEPR, TEST_NODEPR);
   142         tester.run(ARGS4, TEST_NOCMNT_NODEPR, TEST_NODEPR);
   145         tester.printSummary();
   143         tester.printSummary();
   146     }
   144     }
   147 
       
   148     /**
       
   149      * {@inheritDoc}
       
   150      */
       
   151     public String getBugId() {
       
   152         return BUG_ID;
       
   153     }
       
   154 
       
   155     /**
       
   156      * {@inheritDoc}
       
   157      */
       
   158     public String getBugName() {
       
   159         return getClass().getName();
       
   160     }
       
   161 }
   145 }