8047157: [javadoc] fixup tests for determinism and add classes uses
authorksrini
Tue, 24 Jun 2014 15:15:22 -0700
changeset 25284 e6a8d468b838
parent 25283 082d51b7010b
child 25285 182793efeeb9
8047157: [javadoc] fixup tests for determinism and add classes uses Reviewed-by: jjg
langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java
langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java
langtools/test/com/sun/javadoc/testUseOption/pkg1/C1.java
langtools/test/com/sun/javadoc/testUseOption/pkg1/C10.java
langtools/test/com/sun/javadoc/testUseOption/pkg1/C9.java
langtools/test/com/sun/javadoc/testUseOption/pkg1/UsedInterface.java
langtools/test/com/sun/javadoc/testUseOption/pkg1/UsedInterfaceA.java
--- a/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java	Tue Jun 24 10:51:00 2014 -0700
+++ b/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java	Tue Jun 24 15:15:22 2014 -0700
@@ -36,21 +36,20 @@
 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();
-
         checkOutput("pkg1/C1.html", true,
             "<html lang=\"" + defaultLanguage + "\">");
 
--- a/langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java	Tue Jun 24 10:51:00 2014 -0700
+++ b/langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java	Tue Jun 24 15:15:22 2014 -0700
@@ -79,6 +79,23 @@
                 "<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
--- a/langtools/test/com/sun/javadoc/testUseOption/pkg1/C1.java	Tue Jun 24 10:51:00 2014 -0700
+++ b/langtools/test/com/sun/javadoc/testUseOption/pkg1/C1.java	Tue Jun 24 15:15:22 2014 -0700
@@ -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 UsedClass methodInC1(UsedClass p) {
         return p;
     }
+
+    public List<UsedClass> methodInC1ReturningType() {
+        return null;
+    }
+
+    /*
+     * this must not appear anywhere.
+     */
+    UsedClass methodInC1Protected(List<UsedClass> p){
+        return p;
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testUseOption/pkg1/C10.java	Tue Jun 24 15:15:22 2014 -0700
@@ -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() {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testUseOption/pkg1/C9.java	Tue Jun 24 15:15:22 2014 -0700
@@ -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(){}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testUseOption/pkg1/UsedInterface.java	Tue Jun 24 15:15:22 2014 -0700
@@ -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();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testUseOption/pkg1/UsedInterfaceA.java	Tue Jun 24 15:15:22 2014 -0700
@@ -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();
+}