--- a/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java Tue Mar 15 13:48:30 2016 -0700
+++ b/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java Thu Mar 17 19:04:28 2016 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -51,14 +51,21 @@
// method and not in independent @Test methods.
@Test
void test() {
+ String mylib = "mylib";
+ String[] javacArgs = {
+ "-d", mylib, testSrc + "/extra/StringBuilder.java"
+ };
+ com.sun.tools.javac.Main.compile(javacArgs);
+
// Generate the documentation using -linkoffline and a URL as the first parameter.
String out1 = "out1";
- String url = "http://java.sun.com/j2se/1.4/docs/api/";
+ String url = "http://acme.com/jdk/";
javadoc("-d", out1,
+ "-classpath", mylib,
"-sourcepath", testSrc,
- "-linkoffline", url, testSrc,
+ "-linkoffline", url, testSrc + "/jdk",
"-package",
- "pkg", "java.lang");
+ "pkg", "mylib.lang");
checkExit(Exit.OK);
checkOutput("pkg/C.html", true,
@@ -73,7 +80,7 @@
+ " <a href=\"" + url + "java/lang/Object.html?is-external=true\" title=\"class or interface in java.lang\">"
+ "Object</a> p3)");
- checkOutput("java/lang/StringBuilderChild.html", true,
+ checkOutput("mylib/lang/StringBuilderChild.html", true,
"<pre>public abstract class <span class=\"typeNameLabel\">StringBuilderChild</span>\n"
+ "extends <a href=\"" + url + "java/lang/Object.html?is-external=true\" "
+ "title=\"class or interface in java.lang\">Object</a></pre>"
@@ -100,7 +107,7 @@
String out4 = "out4";
javadoc(createArguments(out4, out1, false)); // without trailing slash
checkExit(Exit.OK);
- // Note: the following test is very weak, and will fail if ever the test
+ // Note: the following test is very weak, and will fail if ever the text
// of the message is changed. We should have a separate test to verify
// this is the text that is given when there is a problem with a URL
checkOutput(Output.WARNING, false,