Path: blob/aarch64-shenandoah-jdk8u272-b10/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java
48230 views
/*1* Copyright (c) 2002, 2013, 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 4652655 4857717 8025633 802656726* @summary This test verifies that class cross references work properly.27* @author jamieh28* @library ../lib/29* @build JavadocTester30* @build TestClassCrossReferences31* @run main TestClassCrossReferences32*/3334public class TestClassCrossReferences extends JavadocTester {3536private static final String BUG_ID = "4652655-4857717";37private static final String[][] TEST = {38{BUG_ID + FS + "C.html",39"<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/package-summary.html?is-external=true\"><code>Link to math package</code></a>"},40{BUG_ID + FS + "C.html",41"<a href=\"http://java.sun.com/j2se/1.4/docs/api/javax/swing/text/AbstractDocument.AttributeContext.html?is-external=true\" " +42"title=\"class or interface in javax.swing.text\"><code>Link to AttributeContext innerclass</code></a>"},43{BUG_ID + FS + "C.html",44"<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/BigDecimal.html?is-external=true\" " +45"title=\"class or interface in java.math\"><code>Link to external class BigDecimal</code></a>"},46{BUG_ID + FS + "C.html",47"<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/BigInteger.html?is-external=true#gcd-java.math.BigInteger-\" " +48"title=\"class or interface in java.math\"><code>Link to external member gcd</code></a>"},49{BUG_ID + FS + "C.html",50"<dl>" + NL + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +51"<dd><code>toString</code> in class <code>java.lang.Object</code></dd>" + NL +52"</dl>"}53};54private static final String[][] NEGATED_TEST = NO_TEST;55private static final String[] ARGS =56new String[] {57"-d", BUG_ID, "-sourcepath", SRC_DIR,58"-linkoffline", "http://java.sun.com/j2se/1.4/docs/api/",59SRC_DIR, SRC_DIR + FS + "C.java"};6061/**62* The entry point of the test.63* @param args the array of command line arguments.64*/65public static void main(String[] args) {66TestClassCrossReferences tester = new TestClassCrossReferences();67run(tester, ARGS, TEST, NEGATED_TEST);68tester.printSummary();69}7071/**72* {@inheritDoc}73*/74public String getBugId() {75return BUG_ID;76}7778/**79* {@inheritDoc}80*/81public String getBugName() {82return getClass().getName();83}84}858687