langtools/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java
changeset 24399 af1a0220d0fa
parent 24072 e7549dcbc4af
child 30730 d3ce7619db2c
--- a/langtools/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java	Fri May 09 23:31:05 2014 +0200
+++ b/langtools/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java	Fri May 09 15:37:12 2014 -0700
@@ -25,73 +25,61 @@
  * @test
  * @bug      8002387 8014636
  * @summary  Improve rendered HTML formatting for {@code}
- * @library  ../lib/
- * @build    JavadocTester TestLiteralCodeInPre
+ * @library  ../lib
+ * @build    JavadocTester
  * @run main TestLiteralCodeInPre
  */
 
 public class TestLiteralCodeInPre extends JavadocTester {
 
-    //Javadoc arguments.
-    private static final String[] ARGS = new String[] {
-        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-Xdoclint:none", "pkg"
-    };
+    public static void main(String... args) throws Exception {
+        TestLiteralCodeInPre tester = new TestLiteralCodeInPre();
+        tester.runTests();
+    }
+
+    @Test
+    void test() {
+        javadoc("-d", "out",
+                "-sourcepath", testSrc,
+                "-Xdoclint:none",
+                "pkg");
+        checkExit(Exit.OK);
 
-    //Input for string search tests.
-    private static final String[][] TEST = {
-        { "pkg/Test.html",
-            "no_pre()</pre>\n" +
-            "<div class=\"block\">abc<code>def</code>ghi</div>" },
-        { "pkg/Test.html",
-            "no_pre_extra_whitespace()</pre>\n" +
-            "<div class=\"block\">abc<code>def  </code>ghi</div>" },
-        { "pkg/Test.html",
-            "in_pre()</pre>\n" +
-            "<div class=\"block\"><pre> abc<code>  def  </code>ghi</pre></div>" },
-        { "pkg/Test.html",
-            "pre_after_text()</pre>\n" +
-            "<div class=\"block\">xyz <pre> abc<code>  def  </code>ghi</pre></div>" },
-        { "pkg/Test.html",
-            "after_pre()</pre>\n" +
-            "<div class=\"block\">xyz <pre> pqr </pre> abc<code>def  </code>ghi</div>" },
-        { "pkg/Test.html",
-            "back_in_pre()</pre>\n" +
-            "<div class=\"block\">xyz <pre> pqr </pre> mno <pre> abc<code>  def  </code>ghi</pre></div>" },
-        { "pkg/Test.html",
-            "typical_usage_code()</pre>\n" +
-            "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n" +
-            " Example:  <pre><code>\n" +
-            "   line 1 &lt;T&gt; void m(T t) {\n" +
-            "   line 2     // do something with T\n" +
-            "   line 3 }\n" +
-            " </code></pre>\n" +
-            " and so it goes.</div>" },
-        { "pkg/Test.html",
-            "typical_usage_literal()</pre>\n" +
-            "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n" +
-            " Example:  <pre>\n" +
-            "   line 1 &lt;T&gt; void m(T t) {\n" +
-            "   line 2     // do something with T\n" +
-            "   line 3 }\n" +
-            " </pre>\n" +
-            " and so it goes.</div>" },
-        { "pkg/Test.html",
-            "recommended_usage_literal()</pre>\n" +
-            "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n" +
-            " Example:  <pre>\n" +
-            "   line 1 &lt;T&gt; void m(T t) {\n" +
-            "   line 2     // do something with T\n" +
-            "   line 3 } </pre>\n" +
-            " and so it goes.</div>" }
-    };
-
-    /**
-     * The entry point of the test.
-     * @param args the array of command line arguments.
-     */
-    public static void main(String[] args) {
-        TestLiteralCodeInPre tester = new TestLiteralCodeInPre();
-        tester.run(ARGS, TEST, NO_TEST);
-        tester.printSummary();
+        checkOutput("pkg/Test.html", true,
+                "no_pre()</pre>\n"
+                + "<div class=\"block\">abc<code>def</code>ghi</div>",
+                "no_pre_extra_whitespace()</pre>\n"
+                + "<div class=\"block\">abc<code>def  </code>ghi</div>",
+                "in_pre()</pre>\n"
+                + "<div class=\"block\"><pre> abc<code>  def  </code>ghi</pre></div>",
+                "pre_after_text()</pre>\n"
+                + "<div class=\"block\">xyz <pre> abc<code>  def  </code>ghi</pre></div>",
+                "after_pre()</pre>\n"
+                + "<div class=\"block\">xyz <pre> pqr </pre> abc<code>def  </code>ghi</div>",
+                "back_in_pre()</pre>\n"
+                + "<div class=\"block\">xyz <pre> pqr </pre> mno <pre> abc<code>  def  </code>ghi</pre></div>",
+                "typical_usage_code()</pre>\n"
+                + "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n"
+                + " Example:  <pre><code>\n"
+                + "   line 1 &lt;T&gt; void m(T t) {\n"
+                + "   line 2     // do something with T\n"
+                + "   line 3 }\n"
+                + " </code></pre>\n"
+                + " and so it goes.</div>",
+                "typical_usage_literal()</pre>\n"
+                + "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n"
+                + " Example:  <pre>\n"
+                + "   line 1 &lt;T&gt; void m(T t) {\n"
+                + "   line 2     // do something with T\n"
+                + "   line 3 }\n"
+                + " </pre>\n"
+                + " and so it goes.</div>",
+                "recommended_usage_literal()</pre>\n"
+                + "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n"
+                + " Example:  <pre>\n"
+                + "   line 1 &lt;T&gt; void m(T t) {\n"
+                + "   line 2     // do something with T\n"
+                + "   line 3 } </pre>\n"
+                + " and so it goes.</div>");
     }
 }