TestSourceTab.java revision 0
3551N/A/*
3551N/A * Copyright 2002-2004 Sun Microsystems, Inc. All Rights Reserved.
3551N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3551N/A *
3551N/A * This code is free software; you can redistribute it and/or modify it
3551N/A * under the terms of the GNU General Public License version 2 only, as
3551N/A * published by the Free Software Foundation.
3551N/A *
3551N/A * This code is distributed in the hope that it will be useful, but WITHOUT
3551N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3551N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3551N/A * version 2 for more details (a copy is included in the LICENSE file that
3551N/A * accompanied this code).
3551N/A *
3551N/A * You should have received a copy of the GNU General Public License version
3551N/A * 2 along with this work; if not, write to the Free Software Foundation,
3551N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3551N/A *
3551N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
3551N/A * CA 95054 USA or visit www.sun.com if you need additional information or
3551N/A * have any questions.
3551N/A */
3551N/A
3551N/A/*
3551N/A * @test
3551N/A * @bug 4510979
3551N/A * @summary Test to make sure that the source documentation is indented properly
3551N/A * when -linksourcetab is used.
3551N/A * @author jamieh
3551N/A * @library ../lib/
3551N/A * @build JavadocTester
3551N/A * @build TestSourceTab
3551N/A * @run main TestSourceTab
3551N/A */
3551N/A
3551N/Apublic class TestSourceTab extends JavadocTester {
3551N/A
3551N/A private static final String BUG_ID = "4510979";
3551N/A private static final String OUTPUT_DIR1 = BUG_ID + "-tabLengthEight";
3551N/A private static final String OUTPUT_DIR2 = BUG_ID + "-tabLengthFour";
3551N/A private static final String[][] TEST = NO_TEST;
3551N/A private static final String[][] NEGATED_TEST = NO_TEST;
3551N/A
3551N/A //Run Javadoc on a source file with that is indented with a single tab per line
3551N/A private static final String[] ARGS1 =
3551N/A new String[] {
3551N/A "-d", OUTPUT_DIR1, "-sourcepath", SRC_DIR,
3551N/A "-notimestamp", "-linksource", SRC_DIR + FS + "SingleTab" + FS + "C.java"
3551N/A };
3551N/A
3551N/A //Run Javadoc on a source file with that is indented with a two tab per line
3551N/A //If we double the tabs and decrease the tab length by a half, the output should
3551N/A //be the same as the one generated above.
3551N/A private static final String[] ARGS2 =
3551N/A new String[] {
3551N/A "-d", OUTPUT_DIR2, "-sourcepath", SRC_DIR,
3551N/A "-notimestamp", "-sourcetab", "4", SRC_DIR + FS + "DoubleTab" + FS + "C.java"
3551N/A };
3551N/A
3551N/A //Files to diff
3551N/A private static final String[][] FILES_TO_DIFF = {
3551N/A {OUTPUT_DIR1 + FS + "src-html" + FS + "C.html",
3551N/A OUTPUT_DIR2 + FS + "src-html" + FS + "C.html"
3551N/A },
3551N/A {OUTPUT_DIR1 + FS + "C.html",
3551N/A OUTPUT_DIR2 + FS + "C.html"
3551N/A }
3551N/A
3551N/A };
3551N/A
3551N/A /**
3551N/A * The entry point of the test.
3551N/A * @param args the array of command line arguments.
3612N/A */
3551N/A public static void main(String[] args) {
3551N/A TestSourceTab tester = new TestSourceTab();
3551N/A run(tester, ARGS1, TEST, NEGATED_TEST);
3551N/A run(tester, ARGS2, TEST, NEGATED_TEST);
3551N/A tester.runDiffs(FILES_TO_DIFF);
3551N/A }
3551N/A
3551N/A /**
3551N/A * {@inheritDoc}
3551N/A */
3551N/A public String getBugId() {
3551N/A return BUG_ID;
3551N/A }
3551N/A
3551N/A /**
3551N/A * {@inheritDoc}
3551N/A */
3551N/A public String getBugName() {
3551N/A return getClass().getName();
3551N/A }
3551N/A}
3551N/A