2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2014-04-16 23:17:09 +00:00
|
|
|
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
2007-12-01 00:00:00 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 only, as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
* accompanied this code).
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License version
|
|
|
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
2010-05-25 22:54:51 +00:00
|
|
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
* or visit www.oracle.com if you need additional information or have any
|
|
|
|
* questions.
|
2007-12-01 00:00:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @test
|
2013-10-18 23:34:42 +00:00
|
|
|
* @bug 4663254 8016328 8025633 8026567
|
2007-12-01 00:00:00 +00:00
|
|
|
* @summary Verify that spaces do not appear in hrefs and anchors.
|
|
|
|
* @author jamieh
|
|
|
|
* @library ../lib/
|
2011-04-04 17:14:23 +00:00
|
|
|
* @build JavadocTester TestHref
|
2007-12-01 00:00:00 +00:00
|
|
|
* @run main TestHref
|
|
|
|
*/
|
|
|
|
|
|
|
|
public class TestHref extends JavadocTester {
|
|
|
|
|
|
|
|
//Javadoc arguments.
|
|
|
|
private static final String[] ARGS = new String[] {
|
2014-04-23 00:57:40 +00:00
|
|
|
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-linkoffline",
|
2007-12-01 00:00:00 +00:00
|
|
|
"http://java.sun.com/j2se/1.4/docs/api/", SRC_DIR, "pkg"
|
|
|
|
};
|
|
|
|
|
|
|
|
//Input for string search tests.
|
|
|
|
private static final String[][] TEST = {
|
|
|
|
//External link.
|
2014-04-23 00:57:40 +00:00
|
|
|
{ "pkg/C1.html",
|
2013-10-10 17:51:15 +00:00
|
|
|
"href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true#wait-long-int-\""
|
2007-12-01 00:00:00 +00:00
|
|
|
},
|
|
|
|
//Member summary table link.
|
2014-04-23 00:57:40 +00:00
|
|
|
{ "pkg/C1.html",
|
2013-10-10 17:51:15 +00:00
|
|
|
"href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\""
|
2007-12-01 00:00:00 +00:00
|
|
|
},
|
|
|
|
//Anchor test.
|
2014-04-23 00:57:40 +00:00
|
|
|
{ "pkg/C1.html",
|
2014-04-16 23:17:09 +00:00
|
|
|
"<a name=\"method-int-int-java.util.ArrayList-\">\n" +
|
|
|
|
"<!-- -->\n" +
|
2010-12-01 19:02:38 +00:00
|
|
|
"</a>"
|
2007-12-01 00:00:00 +00:00
|
|
|
},
|
|
|
|
//Backward compatibility anchor test.
|
2014-04-23 00:57:40 +00:00
|
|
|
{ "pkg/C1.html",
|
2014-04-16 23:17:09 +00:00
|
|
|
"<a name=\"method-int-int-java.util.ArrayList-\">\n" +
|
|
|
|
"<!-- -->\n" +
|
2010-12-01 19:02:38 +00:00
|
|
|
"</a>"
|
2007-12-01 00:00:00 +00:00
|
|
|
},
|
|
|
|
//{@link} test.
|
2014-04-23 00:57:40 +00:00
|
|
|
{ "pkg/C2.html",
|
2013-10-10 17:51:15 +00:00
|
|
|
"Link: <a href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\">"
|
2007-12-01 00:00:00 +00:00
|
|
|
},
|
|
|
|
//@see test.
|
2014-04-23 00:57:40 +00:00
|
|
|
{ "pkg/C2.html",
|
2014-04-16 23:17:09 +00:00
|
|
|
"See Also:</span></dt>\n" +
|
|
|
|
"<dd><a href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\">"
|
2007-12-01 00:00:00 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
//Header does not link to the page itself.
|
2014-04-23 00:57:40 +00:00
|
|
|
{ "pkg/C4.html",
|
2010-12-01 19:02:38 +00:00
|
|
|
"Class C4<E extends C4<E>></h2>"
|
2007-12-01 00:00:00 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
//Signature does not link to the page itself.
|
2014-04-23 00:57:40 +00:00
|
|
|
{ "pkg/C4.html",
|
2013-10-18 23:34:42 +00:00
|
|
|
"public abstract class <span class=\"typeNameLabel\">C4<E extends C4<E>></span>"
|
2007-12-01 00:00:00 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
private static final String[][] NEGATED_TEST =
|
|
|
|
{
|
|
|
|
{WARNING_OUTPUT, "<a> tag is malformed"}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The entry point of the test.
|
|
|
|
* @param args the array of command line arguments.
|
|
|
|
*/
|
|
|
|
public static void main(String[] args) {
|
|
|
|
TestHref tester = new TestHref();
|
2014-04-19 00:25:43 +00:00
|
|
|
tester.run(ARGS, TEST, NEGATED_TEST);
|
2007-12-01 00:00:00 +00:00
|
|
|
tester.printSummary();
|
|
|
|
}
|
|
|
|
}
|