langtools/test/com/sun/javadoc/testIndentation/TestIndentation.java
author jjg
Wed, 16 Apr 2014 16:17:09 -0700
changeset 23971 f5ff1f5a8dee
parent 17564 c329fe11193d
child 24065 fc4022e50129
permissions -rw-r--r--
8031649: Clean up javadoc tests Reviewed-by: jjg Contributed-by: neil.toda@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17564
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
     1
/*
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 17564
diff changeset
     2
 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
17564
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
     4
 *
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
     8
 *
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    13
 * accompanied this code).
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    14
 *
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    18
 *
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    21
 * questions.
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    22
 */
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    23
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    24
/*
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    25
 * @test
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    26
 * @bug      8011288
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    27
 * @summary  Erratic/inconsistent indentation of signatures
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    28
 * @library  ../lib/
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    29
 * @build    JavadocTester
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    30
 * @run main TestIndentation
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    31
 */
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    32
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    33
public class TestIndentation extends JavadocTester {
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    34
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    35
    //Test information.
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    36
    private static final String BUG_ID = "8011288";
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    37
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    38
    //Javadoc arguments.
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    39
    private static final String[] ARGS = new String[] {
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    40
        "-d", BUG_ID, "-sourcepath", SRC_DIR, "p"
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    41
    };
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    42
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    43
    //Input for string search tests.
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    44
    private static final String[][] TEST = {
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 17564
diff changeset
    45
        { BUG_ID + "/p/Indent.html",
17564
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    46
          "<pre>public&nbsp;&lt;T&gt;&nbsp;void&nbsp;m(T&nbsp;t1," },
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 17564
diff changeset
    47
        { BUG_ID + "/p/Indent.html",
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 17564
diff changeset
    48
          "\n" +
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 17564
diff changeset
    49
          "                  T&nbsp;t2)" },
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 17564
diff changeset
    50
        { BUG_ID + "/p/Indent.html",
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 17564
diff changeset
    51
          "\n" +
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 17564
diff changeset
    52
          "           throws java.lang.Exception" }
17564
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    53
    };
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    54
    private static final String[][] NEGATED_TEST = NO_TEST;
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    55
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    56
    /**
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    57
     * The entry point of the test.
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    58
     * @param args the array of command line arguments.
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    59
     */
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    60
    public static void main(String[] args) {
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    61
        TestIndentation tester = new TestIndentation();
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    62
        run(tester, ARGS, TEST, NEGATED_TEST);
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    63
        tester.printSummary();
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    64
    }
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    65
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    66
    /**
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    67
     * {@inheritDoc}
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    68
     */
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    69
    public String getBugId() {
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    70
        return BUG_ID;
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    71
    }
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    72
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    73
    /**
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    74
     * {@inheritDoc}
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    75
     */
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    76
    public String getBugName() {
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    77
        return getClass().getName();
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    78
    }
c329fe11193d 8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
diff changeset
    79
}