Path: blob/aarch64-shenandoah-jdk8u272-b10/langtools/test/com/sun/javadoc/testCmndLineClass/TestCmndLineClass.java
86410 views
/*1* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/*24* @test25* @bug 450698026* @summary Test to make sure that there is no difference in the output27* when specifying packages on the command line and specifying individual28* classes.29* @author jamieh30* @library ../lib/31* @build JavadocTester32* @build TestCmndLineClass33* @run main TestCmndLineClass34*/3536public class TestCmndLineClass extends JavadocTester {3738private static final String OUTPUT_DIR1 = "4506980-tmp1";39private static final String OUTPUT_DIR2 = "4506980-tmp2";40private static final String[][] TEST = NO_TEST;41private static final String[][] NEGATED_TEST = NO_TEST;42private static final String[] ARGS1 =43new String[] {44"-d", OUTPUT_DIR1, "-sourcepath", SRC_DIR,45"-notimestamp", SRC_DIR + FS + "C5.java", "pkg1", "pkg2"46};47private static final String[] ARGS2 =48new String[] {49"-d", OUTPUT_DIR2, "-sourcepath", SRC_DIR,50"-notimestamp", SRC_DIR + FS + "C5.java",51SRC_DIR + FS + "pkg1" + FS + "C1.java",52SRC_DIR + FS + "pkg1" + FS + "C2.java",53SRC_DIR + FS + "pkg2" + FS + "C3.java",54SRC_DIR + FS + "pkg2" + FS + "C4.java"55};56private static final String[][] FILES_TO_DIFF = {57{OUTPUT_DIR1 + FS + "C5.html", OUTPUT_DIR2 + FS + "C5.html"},58{OUTPUT_DIR2 + FS + "pkg1" + FS + "C1.html", OUTPUT_DIR2 + FS + "pkg1" + FS + "C1.html"},59{OUTPUT_DIR1 + FS + "pkg1" + FS + "C2.html", OUTPUT_DIR2 + FS + "pkg1" + FS + "C2.html"},60{OUTPUT_DIR1 + FS + "pkg2" + FS + "C3.html", OUTPUT_DIR2 + FS + "pkg2" + FS + "C3.html"},61{OUTPUT_DIR1 + FS + "pkg2" + FS + "C4.html", OUTPUT_DIR2 + FS + "pkg2" + FS + "C4.html"}62};6364private static final String BUG_ID = "4506980";6566/**67* The entry point of the test.68* @param args the array of command line arguments.69*/70public static void main(String[] args) {71TestCmndLineClass tester = new TestCmndLineClass();72run(tester, ARGS1, TEST, NEGATED_TEST);73run(tester, ARGS2, TEST, NEGATED_TEST);74tester.runDiffs(FILES_TO_DIFF);75}7677/**78* {@inheritDoc}79*/80public String getBugId() {81return BUG_ID;82}8384/**85* {@inheritDoc}86*/87public String getBugName() {88return getClass().getName();89}90}919293