8047157: [javadoc] fixup tests for determinism and add classes uses

Reviewed-by: jjg
This commit is contained in:
Kumar Srinivasan 2014-06-24 15:15:22 -07:00
parent b963c0bc59
commit 7aa3c59051
7 changed files with 182 additions and 6 deletions

View File

@ -36,20 +36,19 @@
import java.util.Locale;
public class TestHtmlTag extends JavadocTester {
private static final String defaultLanguage = Locale.getDefault().getLanguage();
public static void main(String... args) throws Exception {
TestHtmlTag tester = new TestHtmlTag();
tester.runTests();
}
@Test
void test_default() {
javadoc("-d", "out-default",
javadoc("-locale", defaultLanguage,
"-d", "out-default",
"-sourcepath", testSrc,
"pkg1");
checkExit(Exit.OK);
String defaultLanguage = Locale.getDefault().getLanguage();
checkExit(Exit.OK);
checkOutput("pkg1/C1.html", true,
"<html lang=\"" + defaultLanguage + "\">");

View File

@ -79,6 +79,23 @@ public class TestUseOption extends JavadocTester {
"<a href=\"../../index.html?pkg2/class-use/C3.html\" target=\"_top\">"
+ "Frames</a></li>"
);
checkOutput("pkg1/class-use/UsedClass.html", true,
"that return types with arguments of type"
);
checkOutput("pkg1/class-use/UsedClass.html", true,
"<a href=\"../../pkg1/C1.html#methodInC1ReturningType--\">methodInC1ReturningType</a>"
);
checkOutput("pkg1/class-use/UsedInterface.html", true,
"Classes in <a href=\"../../pkg1/package-summary.html\">pkg1</a> that implement " +
"<a href=\"../../pkg1/UsedInterface.html\" title=\"interface in pkg1\">UsedInterface</a>"
);
checkOutput("pkg1/class-use/UsedInterfaceA.html", true,
"Classes in <a href=\"../../pkg1/package-summary.html\">pkg1</a> that implement " +
"<a href=\"../../pkg1/UsedInterfaceA.html\" title=\"interface in pkg1\">UsedInterfaceA</a>"
);
checkOutput("pkg1/class-use/UsedClass.html", false,
"methodInC1Protected"
);
}
@Test

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2014, 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
@ -23,6 +23,8 @@
package pkg1;
import java.util.List;
/**
* Test 3 passes.
*/
@ -40,4 +42,15 @@ public class C1 {
public UsedClass methodInC1(UsedClass p) {
return p;
}
public List<UsedClass> methodInC1ReturningType() {
return null;
}
/*
* this must not appear anywhere.
*/
UsedClass methodInC1Protected(List<UsedClass> p){
return p;
}
}

View File

@ -0,0 +1,41 @@
/*
* Copyright (c) 2014, 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
* 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.
*
* 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.
*/
package pkg1;
/**
* An implementor
*
*/
public class C10 extends UsedClass implements UsedInterface, UsedInterfaceA {
/**
* Nothing
*/
public void doNothing() {}
/**
* Me too
*/
public void doNothingA() {}
}

View File

@ -0,0 +1,32 @@
/*
* Copyright (c) 2014, 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
* 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.
*
* 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.
*/
package pkg1;
/**
* An implementor
*
*/
public class C9 implements UsedInterface, UsedInterfaceA {
public void doNothing(){}
}

View File

@ -0,0 +1,37 @@
/*
* Copyright (c) 2014, 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
* 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.
*
* 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.
*/
/**
* An interface
*
*/
package pkg1;
public interface UsedInterface {
/**
* Does nothing
*/
void doNothing();
}

View File

@ -0,0 +1,37 @@
/*
* Copyright (c) 2014, 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
* 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.
*
* 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.
*/
/**
* An interface
*
*/
package pkg1;
public interface UsedInterfaceA {
/**
* Does nothing
*/
void doNothingA();
}