--- a/test/langtools/jdk/javadoc/doclet/5093723/T5093723.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/5093723/T5093723.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,14 @@
* @test
* @bug 5093723
* @summary REGRESSION: ClassCastException in SingleIndexWriter
- * @library ../lib
- * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @library ../../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build javadoc.tester.*
* @run main T5093723
*/
+import javadoc.tester.JavadocTester;
+
public class T5093723 extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void test() {
+ public void test() {
setAutomaticCheckLinks(false); // @ignore JDK-8202617
javadoc("-d", "out",
"-Xdoclint:none",
--- a/test/langtools/jdk/javadoc/doclet/AccessAsciiArt/AccessAsciiArt.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/AccessAsciiArt/AccessAsciiArt.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 4706779 4956908
* @summary Add text equivalent of class tree ASCII art for accessibility
* @author dkramer
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main AccessAsciiArt
*/
+import javadoc.tester.JavadocTester;
+
public class AccessAsciiArt extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"p1", "p1.subpkg");
--- a/test/langtools/jdk/javadoc/doclet/AccessFrameTitle/AccessFrameTitle.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/AccessFrameTitle/AccessFrameTitle.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 4636655 8196202
* @summary Add title attribute to <FRAME> tags for accessibility
* @author dkramer
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main AccessFrameTitle
*/
+import javadoc.tester.JavadocTester;
+
public class AccessFrameTitle extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"--frames",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/AccessH1/AccessH1.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/AccessH1/AccessH1.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,13 +26,15 @@
* @bug 4636667 7052425 8016549 8196202
* @summary Use <H1, <H2>, and <H3> in proper sequence for accessibility
* @author dkramer
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main AccessH1
*/
+import javadoc.tester.JavadocTester;
+
public class AccessH1 extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-doctitle", "Document Title",
"--frames",
--- a/test/langtools/jdk/javadoc/doclet/AccessSkipNav/AccessSkipNav.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/AccessSkipNav/AccessSkipNav.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 4638136 7198273 8025633 8081854 8182765
* @summary Add ability to skip over nav bar for accessibility
* @author dkramer
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main AccessSkipNav
*/
+import javadoc.tester.JavadocTester;
+
public class AccessSkipNav extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"p1", "p2");
@@ -63,7 +65,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/AccessSummary/AccessSummary.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/AccessSummary/AccessSummary.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 4637604 4775148 8183037 8182765 8196202
* @summary Test the tables for summary attribute
* @author dkramer
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main AccessSummary
*/
+import javadoc.tester.JavadocTester;
+
public class AccessSummary extends JavadocTester {
/**
* The entry point of the test.
@@ -44,7 +46,7 @@
}
@Test
- void testAccessSummary() {
+ public void testAccessSummary() {
javadoc("-d", "out",
"--frames",
"-sourcepath", testSrc,
@@ -54,7 +56,7 @@
}
@Test
- void testAccessSummary_html4() {
+ public void testAccessSummary_html4() {
javadoc("-d", "out-html4",
"-html4",
"--frames",
--- a/test/langtools/jdk/javadoc/doclet/AuthorDD/AuthorDD.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/AuthorDD/AuthorDD.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -26,15 +26,17 @@
* @bug 4651598 8026567
* @summary Javadoc wrongly inserts </DD> tags when using multiple @author tags
* @author dkramer
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main AuthorDD
*/
/**
* Runs javadoc and runs regression tests on the resulting HTML.
*/
+import javadoc.tester.JavadocTester;
+
public class AuthorDD extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
}
@Test
- void test() {
+ public void test() {
// Test for all cases except the split index page
javadoc("-d", "out",
"-author",
--- a/test/langtools/jdk/javadoc/doclet/DocRootSlash/DocRootSlash.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/DocRootSlash/DocRootSlash.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,9 +26,9 @@
* @bug 4524350 4662945 4633447 8196202
* @summary stddoclet: {@docRoot} inserts an extra trailing "/"
* @author dkramer
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main DocRootSlash
*/
@@ -39,6 +39,8 @@
* It reads each file, complete with newlines, into a string to easily
* find strings that contain newlines.
*/
+import javadoc.tester.JavadocTester;
+
public class DocRootSlash extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -47,7 +49,7 @@
}
@Test
- void test() {
+ public void test() {
// Directory that contains source files that javadoc runs on
String srcdir = System.getProperty("test.src", ".");
--- a/test/langtools/jdk/javadoc/doclet/InheritDocForUserTags/DocTest.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/InheritDocForUserTags/DocTest.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -26,9 +26,9 @@
* @bug 8008768
* @summary Using {@inheritDoc} in simple tag defined via -tag fails
* @author Mike Duigou
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main DocTest
*/
@@ -39,6 +39,8 @@
* @implSpec DocTest implementation spec.
* @implNote DocTest implementation note.
*/
+import javadoc.tester.JavadocTester;
+
public class DocTest extends JavadocTester {
public static void main(String... args) throws Exception {
DocTest tester = new DocTest();
@@ -46,7 +48,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-verbose",
"-d", "DocTest",
"-tag", "apiNote:optcm:<em>API Note</em>",
--- a/test/langtools/jdk/javadoc/doclet/JavascriptWinTitle/JavascriptWinTitle.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/JavascriptWinTitle/JavascriptWinTitle.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* @summary Javascript IE load error when linked by -linkoffline
* Window title shouldn't change when loading left frames (javascript)
* @author dkramer
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main JavascriptWinTitle
*/
+import javadoc.tester.JavadocTester;
+
public class JavascriptWinTitle extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-source", "8",
"--frames",
--- a/test/langtools/jdk/javadoc/doclet/MetaTag/MetaTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/MetaTag/MetaTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,15 +27,17 @@
* @summary Add support for HTML keywords via META tag for
* class and member names to improve API search
* @author dkramer
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main MetaTag
*/
import java.text.SimpleDateFormat;
import java.util.Date;
+import javadoc.tester.JavadocTester;
+
public class MetaTag extends JavadocTester {
/**
@@ -49,7 +51,7 @@
}
@Test
- void testStandard() {
+ public void testStandard() {
javadoc("-d", "out-1",
"-sourcepath", testSrc,
"-keywords",
@@ -63,7 +65,7 @@
}
@Test
- void testNoTimestamp() {
+ public void testNoTimestamp() {
javadoc("-d", "out-2",
"-sourcepath", testSrc,
"-notimestamp",
@@ -77,7 +79,7 @@
}
@Test
- void testStandard_html4() {
+ public void testStandard_html4() {
javadoc("-d", "out-1-html4",
"-html4",
"-sourcepath", testSrc,
@@ -92,7 +94,7 @@
}
@Test
- void testNoTimestamp_html4() {
+ public void testNoTimestamp_html4() {
javadoc("-d", "out-2-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/PackagesHeader/PackagesHeader.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/PackagesHeader/PackagesHeader.java Fri Dec 21 10:38:33 2018 -0800
@@ -28,12 +28,14 @@
* is present for three sets of options: (1) -header,
* (2) -packagesheader, and (3) -header -packagesheader
* @author dkramer
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main PackagesHeader
*/
+import javadoc.tester.JavadocTester;
+
public class PackagesHeader extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
}
@Test
- void testHeader() {
+ public void testHeader() {
// First test with -header only
javadoc("-d", "out-header",
"-header", "Main Frame Header",
@@ -57,7 +59,7 @@
}
@Test
- void testPackagesHeader() {
+ public void testPackagesHeader() {
// Second test with -packagesheader only
javadoc("-d", "out-packages-header",
"-packagesheader", "Packages Frame Header",
@@ -73,7 +75,7 @@
}
@Test
- void testBothHeaders() {
+ public void testBothHeaders() {
// Third test with both -packagesheader and -header
javadoc("-d", "out-both",
"-packagesheader", "Packages Frame Header",
--- a/test/langtools/jdk/javadoc/doclet/T6735320/T6735320.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/T6735320/T6735320.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -25,12 +25,14 @@
* @test
* @bug 6735320
* @summary javadoc throws exception if serialField value is missing
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main T6735320
*/
+import javadoc.tester.JavadocTester;
+
public class T6735320 extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
testSrc("SerialFieldTest.java"));
checkExit(Exit.ERROR);
--- a/test/langtools/jdk/javadoc/doclet/ValidHtml/ValidHtml.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/ValidHtml/ValidHtml.java Fri Dec 21 10:38:33 2018 -0800
@@ -29,12 +29,14 @@
* Missing whitespace in DOCTYPE declaration
* HTML table tags inserted in wrong place in pakcage use page
* @author dkramer
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main ValidHtml
*/
+import javadoc.tester.JavadocTester;
+
public class ValidHtml extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
}
@Test
- void test() {
+ public void test() {
// Test for all cases except the split index page
javadoc("-d", "out",
"-doctitle", "Document Title",
@@ -66,7 +68,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
// Test for all cases except the split index page
javadoc("-d", "out-html4",
"-html4",
--- a/test/langtools/jdk/javadoc/doclet/VersionNumber/VersionNumber.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/VersionNumber/VersionNumber.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -26,9 +26,9 @@
* @bug 4720849
* @summary Standard doclet contains hard-coded version number
* @author dkramer
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main VersionNumber
*/
@@ -36,6 +36,8 @@
/**
* Runs javadoc and runs regression tests on the resulting HTML.
*/
+import javadoc.tester.JavadocTester;
+
public class VersionNumber extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -44,7 +46,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"p1");
checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/WindowTitles/WindowTitles.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/WindowTitles/WindowTitles.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,15 +26,17 @@
* @bug 4530730 8196202
* @summary stddoclet: With frames off, window titles have "()" appended
* @author dkramer
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main WindowTitles
*/
/**
* Runs javadoc and runs regression tests on the resulting HTML.
*/
+import javadoc.tester.JavadocTester;
+
public class WindowTitles extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
}
@Test
- void test() {
+ public void test() {
// Test for all cases except the split index page
javadoc("-d", "out-1",
"-use",
@@ -71,7 +73,7 @@
}
@Test
- void test2() {
+ public void test2() {
// Test only for the split-index case (and run on only one package)
javadoc("-d", "out-2",
"-splitindex",
--- a/test/langtools/jdk/javadoc/doclet/_template/Template.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/_template/Template.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -31,6 +31,8 @@
* @ run main <CLASS NAME>
*/
+import javadoc.tester.JavadocTester;
+
public class Template extends JavadocTester {
//Javadoc arguments.
--- a/test/langtools/jdk/javadoc/doclet/_template/TemplateComplete.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/_template/TemplateComplete.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -31,6 +31,8 @@
* @ run main <CLASS NAME>
*/
+import javadoc.tester.JavadocTester;
+
public class TemplateComplete extends JavadocTester {
//Javadoc arguments.
--- a/test/langtools/jdk/javadoc/doclet/constantValues/TestConstantValuesDriver.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/constantValues/TestConstantValuesDriver.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -26,11 +26,13 @@
* @bug 4504730 4526070 5077317 8162363
* @summary Test the generation of constant-values.html.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestConstantValuesDriver
*/
+import javadoc.tester.JavadocTester;
+
public class TestConstantValuesDriver extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
testSrc("TestConstantValues.java"),
testSrc("TestConstantValues2.java"),
--- a/test/langtools/jdk/javadoc/doclet/dupThrowsTags/TestDupThrowsTags.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/dupThrowsTags/TestDupThrowsTags.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -26,11 +26,13 @@
* @bug 4525364
* @summary Determine if duplicate throws tags can be used.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestDupThrowsTags
*/
+import javadoc.tester.JavadocTester;
+
public class TestDupThrowsTags extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
testSrc("TestDupThrowsTags.java"));
checkExit(Exit.ERROR);
--- a/test/langtools/jdk/javadoc/doclet/lib/JavadocTester.java Fri Dec 21 16:56:40 2018 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1798 +0,0 @@
-/*
- * Copyright (c) 2002, 2018, 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.
- */
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileWriter;
-import java.io.FilenameFilter;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.lang.annotation.Annotation;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.ref.SoftReference;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CodingErrorAction;
-import java.nio.charset.UnsupportedCharsetException;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.SimpleFileVisitor;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-import java.util.function.Function;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-
-
-/**
- * Test framework for running javadoc and performing tests on the resulting output.
- *
- * <p>
- * Tests are typically written as subtypes of JavadocTester, with a main
- * method that creates an instance of the test class and calls the runTests()
- * method. The runTests() methods calls all the test methods declared in the class,
- * and then calls a method to print a summary, and throw an exception if
- * any of the test methods reported a failure.
- *
- * <p>
- * Test methods are identified with a @Test annotation. They have no parameters.
- * The name of the method is not important, but if you have more than one, it is
- * recommended that the names be meaningful and suggestive of the test case
- * contained therein.
- *
- * <p>
- * Typically, a test method will invoke javadoc, and then perform various
- * checks on the results. The standard checks are:
- *
- * <dl>
- * <dt>checkExitCode
- * <dd>Check the exit code returned from javadoc.
- * <dt>checkOutput
- * <dd>Perform a series of checks on the contents on a file or output stream
- * generated by javadoc.
- * The checks can be either that a series of strings are found or are not found.
- * <dt>checkFiles
- * <dd>Perform a series of checks on the files generated by javadoc.
- * The checks can be that a series of files are found or are not found.
- * </dl>
- *
- * <pre><code>
- * public class MyTester extends JavadocTester {
- * public static void main(String... args) throws Exception {
- * MyTester tester = new MyTester();
- * tester.runTests();
- * }
- *
- * // test methods...
- * @Test
- * void test() {
- * javadoc(<i>args</i>);
- * checkExit(Exit.OK);
- * checkOutput(<i>file</i>, true,
- * <i>strings-to-find</i>);
- * checkOutput(<i>file</i>, false,
- * <i>strings-to-not-find</i>);
- * }
- * }
- * </code></pre>
- *
- * <p>
- * If javadoc is run more than once in a test method, you can compare the
- * results that are generated with the diff method. Since files written by
- * javadoc typically contain a timestamp, you may want to use the -notimestamp
- * option if you are going to compare the results from two runs of javadoc.
- *
- * <p>
- * If you have many calls of checkOutput that are very similar, you can write
- * your own check... method to reduce the amount of duplication. For example,
- * if you want to check that many files contain the same string, you could
- * write a method that takes a varargs list of files and calls checkOutput
- * on each file in turn with the string to be checked.
- *
- * <p>
- * You can also write you own custom check methods, which can use
- * readFile to get the contents of a file generated by javadoc,
- * and then use pass(...) or fail(...) to report whether the check
- * succeeded or not.
- *
- * <p>
- * You can have many separate test methods, each identified with a @Test
- * annotation. However, you should <b>not</b> assume they will be called
- * in the order declared in your source file. If the order of a series
- * of javadoc invocations is important, do that within a single method.
- * If the invocations are independent, for better clarity, use separate
- * test methods, each with their own set of checks on the results.
- *
- * @author Doug Kramer
- * @author Jamie Ho
- * @author Jonathan Gibbons (rewrite)
- */
-public abstract class JavadocTester {
-
- public static final String FS = System.getProperty("file.separator");
- public static final String PS = System.getProperty("path.separator");
- public static final String NL = System.getProperty("line.separator");
- public static final Path currDir = Paths.get(".").toAbsolutePath().normalize();
-
- public enum Output {
- /** The name of the output stream from javadoc. */
- OUT,
- /** The name for any output written to System.out. */
- STDOUT,
- /** The name for any output written to System.err. */
- STDERR
- }
-
- /** The output directory used in the most recent call of javadoc. */
- protected File outputDir;
-
- /** The output charset used in the most recent call of javadoc. */
- protected Charset charset = Charset.defaultCharset();
-
- /** The exit code of the most recent call of javadoc. */
- private int exitCode;
-
- /** The output generated by javadoc to the various writers and streams. */
- private final Map<Output, String> outputMap = new EnumMap<>(Output.class);
-
- /** A cache of file content, to avoid reading files unnecessarily. */
- private final Map<File,SoftReference<String>> fileContentCache = new HashMap<>();
- /** The charset used for files in the fileContentCache. */
- private Charset fileContentCacheCharset = null;
-
- /** Stream used for logging messages. */
- protected final PrintStream out = System.out;
-
- /** The directory containing the source code for the test. */
- public static final String testSrc = System.getProperty("test.src");
-
- /**
- * Get the path for a source file in the test source directory.
- * @param path the path of a file or directory in the source directory
- * @return the full path of the specified file
- */
- public static String testSrc(String path) {
- return new File(testSrc, path).getPath();
- }
-
- /**
- * Alternatives for checking the contents of a directory.
- */
- public enum DirectoryCheck {
- /**
- * Check that the directory is empty.
- */
- EMPTY((file, name) -> true),
- /**
- * Check that the directory does not contain any HTML files,
- * such as may have been generated by a prior run of javadoc
- * using this directory.
- * For now, the check is only performed on the top level directory.
- */
- NO_HTML_FILES((file, name) -> name.endsWith(".html")),
- /**
- * No check is performed on the directory contents.
- */
- NONE(null) { @Override void check(File dir) { } };
-
- /** The filter used to detect that files should <i>not</i> be present. */
- FilenameFilter filter;
-
- DirectoryCheck(FilenameFilter f) {
- filter = f;
- }
-
- void check(File dir) {
- if (dir.isDirectory()) {
- String[] contents = dir.list(filter);
- if (contents == null)
- throw new Error("cannot list directory: " + dir);
- if (contents.length > 0) {
- System.err.println("Found extraneous files in dir:" + dir.getAbsolutePath());
- for (String x : contents) {
- System.err.println(x);
- }
- throw new Error("directory has unexpected content: " + dir);
- }
- }
- }
- }
-
- private DirectoryCheck outputDirectoryCheck = DirectoryCheck.EMPTY;
-
- private boolean automaticCheckLinks = true;
-
- /** The current subtest number. Incremented when checking(...) is called. */
- private int numTestsRun = 0;
-
- /** The number of subtests passed. Incremented when passed(...) is called. */
- private int numTestsPassed = 0;
-
- /** The current run of javadoc. Incremented when javadoc is called. */
- private int javadocRunNum = 0;
-
- /** The current subtest number for this run of javadoc. Incremented when checking(...) is called. */
- private int javadocTestNum = 0;
-
- /** Marker annotation for test methods to be invoked by runTests. */
- @Retention(RetentionPolicy.RUNTIME)
- @interface Test { }
-
- /**
- * Run all methods annotated with @Test, followed by printSummary.
- * Typically called on a tester object in main()
- * @throws Exception if any errors occurred
- */
- public void runTests() throws Exception {
- runTests(m -> new Object[0]);
- }
-
- /**
- * Run all methods annotated with @Test, followed by printSummary.
- * Typically called on a tester object in main()
- * @param f a function which will be used to provide arguments to each
- * invoked method
- * @throws Exception if any errors occurred
- */
- public void runTests(Function<Method, Object[]> f) throws Exception {
- for (Method m: getClass().getDeclaredMethods()) {
- Annotation a = m.getAnnotation(Test.class);
- if (a != null) {
- try {
- out.println("Running test " + m.getName());
- m.invoke(this, f.apply(m));
- } catch (InvocationTargetException e) {
- Throwable cause = e.getCause();
- throw (cause instanceof Exception) ? ((Exception) cause) : e;
- }
- out.println();
- }
- }
- printSummary();
- }
-
- /**
- * Run javadoc.
- * The output directory used by this call and the final exit code
- * will be saved for later use.
- * To aid the reader, it is recommended that calls to this method
- * put each option and the arguments it takes on a separate line.
- *
- * Example:
- * <pre><code>
- * javadoc("-d", "out",
- * "-sourcepath", testSrc,
- * "-notimestamp",
- * "pkg1", "pkg2", "pkg3/C.java");
- * </code></pre>
- *
- * @param args the arguments to pass to javadoc
- */
- public void javadoc(String... args) {
- outputMap.clear();
- fileContentCache.clear();
-
- javadocRunNum++;
- javadocTestNum = 0; // reset counter for this run of javadoc
- if (javadocRunNum == 1) {
- out.println("Running javadoc...");
- } else {
- out.println("Running javadoc (run "+ javadocRunNum + ")...");
- }
-
- outputDir = new File(".");
- String charsetArg = null;
- String docencodingArg = null;
- String encodingArg = null;
- for (int i = 0; i < args.length - 2; i++) {
- switch (args[i]) {
- case "-d":
- outputDir = new File(args[++i]);
- break;
- case "-charset":
- charsetArg = args[++i];
- break;
- case "-docencoding":
- docencodingArg = args[++i];
- break;
- case "-encoding":
- encodingArg = args[++i];
- break;
- }
- }
-
- // The following replicates HtmlConfiguration.finishOptionSettings0
- // and sets up the charset used to read files.
- String cs;
- if (docencodingArg == null) {
- if (charsetArg == null) {
- cs = (encodingArg == null) ? "UTF-8" : encodingArg;
- } else {
- cs = charsetArg;
- }
- } else {
- cs = docencodingArg;
- }
- try {
- charset = Charset.forName(cs);
- } catch (UnsupportedCharsetException e) {
- charset = Charset.defaultCharset();
- }
-
- out.println("args: " + Arrays.toString(args));
-// log.setOutDir(outputDir);
-
- outputDirectoryCheck.check(outputDir);
-
- // This is the sole stream used by javadoc
- WriterOutput outOut = new WriterOutput();
-
- // These are to catch output to System.out and System.err,
- // in case these are used instead of the primary streams
- StreamOutput sysOut = new StreamOutput(System.out, System::setOut);
- StreamOutput sysErr = new StreamOutput(System.err, System::setErr);
-
- try {
- exitCode = jdk.javadoc.internal.tool.Main.execute(args, outOut.pw);
- } finally {
- outputMap.put(Output.STDOUT, sysOut.close());
- outputMap.put(Output.STDERR, sysErr.close());
- outputMap.put(Output.OUT, outOut.close());
- }
-
- outputMap.forEach((name, text) -> {
- if (!text.isEmpty()) {
- out.println("javadoc " + name + ":");
- out.println(text);
- }
- });
-
- if (automaticCheckLinks && exitCode == Exit.OK.code && outputDir.exists()) {
- checkLinks();
- }
- }
-
- /**
- * Set the kind of check for the initial contents of the output directory
- * before javadoc is run.
- * The filter should return true for files that should <b>not</b> appear.
- * @param c the kind of check to perform
- */
- public void setOutputDirectoryCheck(DirectoryCheck c) {
- outputDirectoryCheck = c;
- }
-
- /**
- * Set whether or not to perform an automatic call of checkLinks.
- */
- public void setAutomaticCheckLinks(boolean b) {
- automaticCheckLinks = b;
- }
-
- /**
- * The exit codes returned by the javadoc tool.
- * @see jdk.javadoc.internal.tool.Main.Result
- */
- public enum Exit {
- OK(0), // Javadoc completed with no errors.
- ERROR(1), // Completed but reported errors.
- CMDERR(2), // Bad command-line arguments
- SYSERR(3), // System error or resource exhaustion.
- ABNORMAL(4); // Javadoc terminated abnormally
-
- Exit(int code) {
- this.code = code;
- }
-
- final int code;
-
- @Override
- public String toString() {
- return name() + '(' + code + ')';
- }
- }
-
- /**
- * Check the exit code of the most recent call of javadoc.
- *
- * @param expected the exit code that is required for the test
- * to pass.
- */
- public void checkExit(Exit expected) {
- checking("check exit code");
- if (exitCode == expected.code) {
- passed("return code " + exitCode);
- } else {
- failed("return code " + exitCode +"; expected " + expected);
- }
- }
-
- /**
- * Check for content in (or not in) the generated output.
- * Within the search strings, the newline character \n
- * will be translated to the platform newline character sequence.
- * @param path a path within the most recent output directory
- * or the name of one of the output buffers, identifying
- * where to look for the search strings.
- * @param expectedFound true if all of the search strings are expected
- * to be found, or false if the file is not expected to be found
- * @param strings the strings to be searched for
- */
- public void checkFileAndOutput(String path, boolean expectedFound, String... strings) {
- if (expectedFound) {
- checkOutput(path, true, strings);
- } else {
- checkFiles(false, path);
- }
- }
-
- /**
- * Check for content in (or not in) the generated output.
- * Within the search strings, the newline character \n
- * will be translated to the platform newline character sequence.
- * @param path a path within the most recent output directory, identifying
- * where to look for the search strings.
- * @param expectedFound true if all of the search strings are expected
- * to be found, or false if all of the strings are expected to be
- * not found
- * @param strings the strings to be searched for
- */
- public void checkOutput(String path, boolean expectedFound, String... strings) {
- // Read contents of file
- try {
- String fileString = readFile(outputDir, path);
- checkOutput(new File(outputDir, path).getPath(), fileString, expectedFound, strings);
- } catch (Error e) {
- checking("Read file");
- failed("Error reading file: " + e);
- }
- }
-
- /**
- * Check for content in (or not in) the one of the output streams written by
- * javadoc. Within the search strings, the newline character \n
- * will be translated to the platform newline character sequence.
- * @param output the output stream to check
- * @param expectedFound true if all of the search strings are expected
- * to be found, or false if all of the strings are expected to be
- * not found
- * @param strings the strings to be searched for
- */
- public void checkOutput(Output output, boolean expectedFound, String... strings) {
- checkOutput(output.toString(), outputMap.get(output), expectedFound, strings);
- }
-
- // NOTE: path may be the name of an Output stream as well as a file path
- private void checkOutput(String path, String fileString, boolean expectedFound, String... strings) {
- for (String stringToFind : strings) {
-// log.logCheckOutput(path, expectedFound, stringToFind);
- checking("checkOutput");
- // Find string in file's contents
- boolean isFound = findString(fileString, stringToFind);
- if (isFound == expectedFound) {
- passed(path + ": following text " + (isFound ? "found:" : "not found:") + "\n"
- + stringToFind);
- } else {
- failed(path + ": following text " + (isFound ? "found:" : "not found:") + "\n"
- + stringToFind + '\n' +
- "found \n" +
- fileString);
- }
- }
- }
-
- public void checkLinks() {
- checking("Check links");
- LinkChecker c = new LinkChecker(out, this::readFile);
- try {
- c.checkDirectory(outputDir.toPath());
- c.report();
- int errors = c.getErrorCount();
- if (errors == 0) {
- passed("Links are OK");
- } else {
- failed(errors + " errors found when checking links");
- }
- } catch (IOException e) {
- failed("exception thrown when reading files: " + e);
- }
- }
-
- /**
- * Get the content of the one of the output streams written by javadoc.
- * @param output the name of the output stream
- * @return the content of the output stream
- */
- public String getOutput(Output output) {
- return outputMap.get(output);
- }
-
- /**
- * Get the content of the one of the output streams written by javadoc.
- * @param output the name of the output stream
- * @return the content of the output stream, as a line of lines
- */
- public List<String> getOutputLines(Output output) {
- String text = outputMap.get(output);
- return (text == null) ? Collections.emptyList() : Arrays.asList(text.split(NL));
- }
-
- /**
- * Check for files in (or not in) the generated output.
- * @param expectedFound true if all of the files are expected
- * to be found, or false if all of the files are expected to be
- * not found
- * @param paths the files to check, within the most recent output directory.
- * */
- public void checkFiles(boolean expectedFound, String... paths) {
- checkFiles(expectedFound, Arrays.asList(paths));
- }
-
- /**
- * Check for files in (or not in) the generated output.
- * @param expectedFound true if all of the files are expected
- * to be found, or false if all of the files are expected to be
- * not found
- * @param paths the files to check, within the most recent output directory.
- * */
- public void checkFiles(boolean expectedFound, Collection<String> paths) {
- for (String path: paths) {
-// log.logCheckFile(path, expectedFound);
- checking("checkFile");
- File file = new File(outputDir, path);
- boolean isFound = file.exists();
- if (isFound == expectedFound) {
- passed(file, "file " + (isFound ? "found:" : "not found:") + "\n");
- } else {
- failed(file, "file " + (isFound ? "found:" : "not found:") + "\n");
- }
- }
- }
-
- /**
- * Check that a series of strings are found in order in a file in
- * the generated output.
- * @param path the file to check
- * @param strings the strings whose order to check
- */
- public void checkOrder(String path, String... strings) {
- File file = new File(outputDir, path);
- String fileString = readOutputFile(path);
- int prevIndex = -1;
- for (String s : strings) {
- s = s.replace("\n", NL); // normalize new lines
- int currentIndex = fileString.indexOf(s, prevIndex + 1);
- checking("file: " + file + ": " + s + " at index " + currentIndex);
- if (currentIndex == -1) {
- failed(file, s + " not found.");
- continue;
- }
- if (currentIndex > prevIndex) {
- passed(file, s + " is in the correct order");
- } else {
- failed(file, s + " is in the wrong order.");
- }
- prevIndex = currentIndex;
- }
- }
-
- /**
- * Ensures that a series of strings appear only once, in the generated output,
- * noting that, this test does not exhaustively check for all other possible
- * duplicates once one is found.
- * @param path the file to check
- * @param strings ensure each are unique
- */
- public void checkUnique(String path, String... strings) {
- File file = new File(outputDir, path);
- String fileString = readOutputFile(path);
- for (String s : strings) {
- int currentIndex = fileString.indexOf(s);
- checking(s + " at index " + currentIndex);
- if (currentIndex == -1) {
- failed(file, s + " not found.");
- continue;
- }
- int nextindex = fileString.indexOf(s, currentIndex + s.length());
- if (nextindex == -1) {
- passed(file, s + " is unique");
- } else {
- failed(file, s + " is not unique, found at " + nextindex);
- }
- }
- }
-
- /**
- * Compare a set of files in each of two directories.
- *
- * @param baseDir1 the directory containing the first set of files
- * @param baseDir2 the directory containing the second set of files
- * @param files the set of files to be compared
- */
- public void diff(String baseDir1, String baseDir2, String... files) {
- File bd1 = new File(baseDir1);
- File bd2 = new File(baseDir2);
- for (String file : files) {
- diff(bd1, bd2, file);
- }
- }
-
- /**
- * A utility to copy a directory from one place to another.
- *
- * @param targetDir the directory to copy.
- * @param destDir the destination to copy the directory to.
- */
- // TODO: convert to using java.nio.Files.walkFileTree
- public void copyDir(String targetDir, String destDir) {
- try {
- File targetDirObj = new File(targetDir);
- File destDirParentObj = new File(destDir);
- File destDirObj = new File(destDirParentObj, targetDirObj.getName());
- if (! destDirParentObj.exists()) {
- destDirParentObj.mkdir();
- }
- if (! destDirObj.exists()) {
- destDirObj.mkdir();
- }
- String[] files = targetDirObj.list();
- for (String file : files) {
- File srcFile = new File(targetDirObj, file);
- File destFile = new File(destDirObj, file);
- if (srcFile.isFile()) {
- out.println("Copying " + srcFile + " to " + destFile);
- copyFile(destFile, srcFile);
- } else if(srcFile.isDirectory()) {
- copyDir(srcFile.getAbsolutePath(), destDirObj.getAbsolutePath());
- }
- }
- } catch (IOException exc) {
- throw new Error("Could not copy " + targetDir + " to " + destDir);
- }
- }
-
- /**
- * Copy source file to destination file.
- *
- * @param destfile the destination file
- * @param srcfile the source file
- * @throws IOException
- */
- public void copyFile(File destfile, File srcfile) throws IOException {
- Files.copy(srcfile.toPath(), destfile.toPath());
- }
-
- /**
- * Read a file from the output directory.
- *
- * @param fileName the name of the file to read
- * @return the file in string format
- */
- public String readOutputFile(String fileName) throws Error {
- return readFile(outputDir, fileName);
- }
-
- protected String readFile(String fileName) throws Error {
- return readFile(outputDir, fileName);
- }
-
- protected String readFile(String baseDir, String fileName) throws Error {
- return readFile(new File(baseDir), fileName);
- }
-
- private String readFile(Path file) {
- File baseDir;
- if (file.startsWith(outputDir.toPath())) {
- baseDir = outputDir;
- } else if (file.startsWith(currDir)) {
- baseDir = currDir.toFile();
- } else {
- baseDir = file.getParent().toFile();
- }
- String fileName = baseDir.toPath().relativize(file).toString();
- return readFile(baseDir, fileName);
- }
-
- /**
- * Read the file and return it as a string.
- *
- * @param baseDir the directory in which to locate the file
- * @param fileName the name of the file to read
- * @return the file in string format
- */
- private String readFile(File baseDir, String fileName) throws Error {
- if (!Objects.equals(fileContentCacheCharset, charset)) {
- fileContentCache.clear();
- fileContentCacheCharset = charset;
- }
- try {
- File file = new File(baseDir, fileName);
- SoftReference<String> ref = fileContentCache.get(file);
- String content = (ref == null) ? null : ref.get();
- if (content != null)
- return content;
-
- // charset defaults to a value inferred from latest javadoc run
- content = new String(Files.readAllBytes(file.toPath()), charset);
- fileContentCache.put(file, new SoftReference<>(content));
- return content;
- } catch (FileNotFoundException e) {
- throw new Error("File not found: " + fileName + ": " + e);
- } catch (IOException e) {
- throw new Error("Error reading file: " + fileName + ": " + e);
- }
- }
-
- protected void checking(String message) {
- numTestsRun++;
- javadocTestNum++;
- print("Starting subtest " + javadocRunNum + "." + javadocTestNum, message);
- }
-
- protected void passed(File file, String message) {
- passed(file + ": " + message);
- }
-
- protected void passed(String message) {
- numTestsPassed++;
- print("Passed", message);
- out.println();
- }
-
- protected void failed(File file, String message) {
- failed(file + ": " + message);
- }
-
- protected void failed(String message) {
- print("FAILED", message);
- StackWalker.getInstance().walk(s -> {
- s.dropWhile(f -> f.getMethodName().equals("failed"))
- .takeWhile(f -> !f.getMethodName().equals("runTests"))
- .forEach(f -> out.println(" at "
- + f.getClassName() + "." + f.getMethodName()
- + "(" + f.getFileName() + ":" + f.getLineNumber() + ")"));
- return null;
- });
- out.println();
- }
-
- private void print(String prefix, String message) {
- if (message.isEmpty())
- out.println(prefix);
- else {
- out.print(prefix);
- out.print(": ");
- out.print(message.replace("\n", NL));
- if (!(message.endsWith("\n") || message.endsWith(NL))) {
- out.println();
- }
- }
- }
-
- /**
- * Print a summary of the test results.
- */
- protected void printSummary() {
- String javadocRuns = (javadocRunNum <= 1) ? ""
- : ", in " + javadocRunNum + " runs of javadoc";
-
- if (numTestsRun != 0 && numTestsPassed == numTestsRun) {
- // Test passed
- out.println();
- out.println("All " + numTestsPassed + " subtests passed" + javadocRuns);
- } else {
- // Test failed
- throw new Error((numTestsRun - numTestsPassed)
- + " of " + (numTestsRun)
- + " subtests failed"
- + javadocRuns);
- }
- }
-
- /**
- * Search for the string in the given file and return true
- * if the string was found.
- *
- * @param fileString the contents of the file to search through
- * @param stringToFind the string to search for
- * @return true if the string was found
- */
- private boolean findString(String fileString, String stringToFind) {
- // javadoc (should) always use the platform newline sequence,
- // but in the strings to find it is more convenient to use the Java
- // newline character. So we translate \n to NL before we search.
- stringToFind = stringToFind.replace("\n", NL);
- return fileString.contains(stringToFind);
- }
-
- /**
- * Compare the two given files.
- *
- * @param baseDir1 the directory in which to locate the first file
- * @param baseDir2 the directory in which to locate the second file
- * @param file the file to compare in the two base directories
- * @param throwErrorIFNoMatch flag to indicate whether or not to throw
- * an error if the files do not match.
- * @return true if the files are the same and false otherwise.
- */
- private void diff(File baseDir1, File baseDir2, String file) {
- String file1Contents = readFile(baseDir1, file);
- String file2Contents = readFile(baseDir2, file);
- checking("diff " + new File(baseDir1, file) + ", " + new File(baseDir2, file));
- if (file1Contents.trim().compareTo(file2Contents.trim()) == 0) {
- passed("files are equal");
- } else {
- failed("files differ");
- }
- }
-
- /**
- * Utility class to simplify the handling of temporarily setting a
- * new stream for System.out or System.err.
- */
- private static class StreamOutput {
- // functional interface to set a stream.
- private interface Initializer {
- void set(PrintStream s);
- }
-
- private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- private final PrintStream ps = new PrintStream(baos);
- private final PrintStream prev;
- private final Initializer init;
-
- StreamOutput(PrintStream s, Initializer init) {
- prev = s;
- init.set(ps);
- this.init = init;
- }
-
- String close() {
- init.set(prev);
- ps.close();
- return baos.toString();
- }
- }
-
- /**
- * Utility class to simplify the handling of creating an in-memory PrintWriter.
- */
- private static class WriterOutput {
- private final StringWriter sw = new StringWriter();
- final PrintWriter pw = new PrintWriter(sw);
- String close() {
- pw.close();
- return sw.toString();
- }
- }
-
-
-// private final Logger log = new Logger();
-
- //--------- Logging --------------------------------------------------------
- //
- // This class writes out the details of calls to checkOutput and checkFile
- // in a canonical way, so that the resulting file can be checked against
- // similar files from other versions of JavadocTester using the same logging
- // facilities.
-
- static class Logger {
- private static final int PREFIX = 40;
- private static final int SUFFIX = 20;
- private static final int MAX = PREFIX + SUFFIX;
- List<String> tests = new ArrayList<>();
- String outDir;
- String rootDir = rootDir();
-
- static String rootDir() {
- File f = new File(".").getAbsoluteFile();
- while (!new File(f, ".hg").exists())
- f = f.getParentFile();
- return f.getPath();
- }
-
- void setOutDir(File outDir) {
- this.outDir = outDir.getPath();
- }
-
- void logCheckFile(String file, boolean positive) {
- // Strip the outdir because that will typically not be the same
- if (file.startsWith(outDir + "/"))
- file = file.substring(outDir.length() + 1);
- tests.add(file + " " + positive);
- }
-
- void logCheckOutput(String file, boolean positive, String text) {
- // Compress the string to be displayed in the log file
- String simpleText = text.replaceAll("\\s+", " ").replace(rootDir, "[ROOT]");
- if (simpleText.length() > MAX)
- simpleText = simpleText.substring(0, PREFIX)
- + "..." + simpleText.substring(simpleText.length() - SUFFIX);
- // Strip the outdir because that will typically not be the same
- if (file.startsWith(outDir + "/"))
- file = file.substring(outDir.length() + 1);
- // The use of text.hashCode ensure that all of "text" is taken into account
- tests.add(file + " " + positive + " " + text.hashCode() + " " + simpleText);
- }
-
- void write() {
- // sort the log entries because the subtests may not be executed in the same order
- tests.sort((a, b) -> a.compareTo(b));
- try (BufferedWriter bw = new BufferedWriter(new FileWriter("tester.log"))) {
- for (String t: tests) {
- bw.write(t);
- bw.newLine();
- }
- } catch (IOException e) {
- throw new Error("problem writing log: " + e);
- }
- }
- }
-
- // Support classes for checkLinks
-
- /**
- * A basic HTML parser. Override the protected methods as needed to get notified
- * of significant items in any file that is read.
- */
- static abstract class HtmlParser {
-
- protected final PrintStream out;
- protected final Function<Path,String> fileReader;
-
- private Path file;
- private StringReader in;
- private int ch;
- private int lineNumber;
- private boolean inScript;
- private boolean xml;
-
- HtmlParser(PrintStream out, Function<Path,String> fileReader) {
- this.out = out;
- this.fileReader = fileReader;
- }
-
- /**
- * Read a file.
- * @param file the file to be read
- * @throws IOException if an error occurs while reading the file
- */
- void read(Path file) throws IOException {
- try (StringReader r = new StringReader(fileReader.apply(file))) {
- this.file = file;
- this.in = r;
-
- startFile(file);
- try {
- lineNumber = 1;
- xml = false;
- nextChar();
-
- while (ch != -1) {
- switch (ch) {
-
- case '<':
- html();
- break;
-
- default:
- nextChar();
- }
- }
- } finally {
- endFile();
- }
- } catch (IOException e) {
- error(file, lineNumber, e);
- } catch (Throwable t) {
- error(file, lineNumber, t);
- t.printStackTrace(out);
- }
- }
-
-
- int getLineNumber() {
- return lineNumber;
- }
-
- /**
- * Called when a file has been opened, before parsing begins.
- * This is always the first notification when reading a file.
- * This implementation does nothing.
- *
- * @param file the file
- */
- protected void startFile(Path file) { }
-
- /**
- * Called when the parser has finished reading a file.
- * This is always the last notification when reading a file,
- * unless any errors occur while closing the file.
- * This implementation does nothing.
- */
- protected void endFile() { }
-
- /**
- * Called when a doctype declaration is found, at the beginning of the file.
- * This implementation does nothing.
- * @param s the doctype declaration
- */
- protected void docType(String s) { }
-
- /**
- * Called when the opening tag of an HTML element is encountered.
- * This implementation does nothing.
- * @param name the name of the tag
- * @param attrs the attribute
- * @param selfClosing whether or not this is a self-closing tag
- */
- protected void startElement(String name, Map<String,String> attrs, boolean selfClosing) { }
-
- /**
- * Called when the closing tag of an HTML tag is encountered.
- * This implementation does nothing.
- * @param name the name of the tag
- */
- protected void endElement(String name) { }
-
- /**
- * Called when an error has been encountered.
- * @param file the file being read
- * @param lineNumber the line number of line containing the error
- * @param message a description of the error
- */
- protected void error(Path file, int lineNumber, String message) {
- out.println(file + ":" + lineNumber + ": " + message);
- }
-
- /**
- * Called when an exception has been encountered.
- * @param file the file being read
- * @param lineNumber the line number of the line being read when the exception was found
- * @param t the exception
- */
- protected void error(Path file, int lineNumber, Throwable t) {
- out.println(file + ":" + lineNumber + ": " + t);
- }
-
- private void nextChar() throws IOException {
- ch = in.read();
- if (ch == '\n')
- lineNumber++;
- }
-
- /**
- * Read the start or end of an HTML tag, or an HTML comment
- * {@literal <identifier attrs> } or {@literal </identifier> }
- * @throws java.io.IOException if there is a problem reading the file
- */
- private void html() throws IOException {
- nextChar();
- if (isIdentifierStart((char) ch)) {
- String name = readIdentifier().toLowerCase(Locale.US);
- Map<String,String> attrs = htmlAttrs();
- if (attrs != null) {
- boolean selfClosing = false;
- if (ch == '/') {
- nextChar();
- selfClosing = true;
- }
- if (ch == '>') {
- nextChar();
- startElement(name, attrs, selfClosing);
- if (name.equals("script")) {
- inScript = true;
- }
- return;
- }
- }
- } else if (ch == '/') {
- nextChar();
- if (isIdentifierStart((char) ch)) {
- String name = readIdentifier().toLowerCase(Locale.US);
- skipWhitespace();
- if (ch == '>') {
- nextChar();
- endElement(name);
- if (name.equals("script")) {
- inScript = false;
- }
- return;
- }
- }
- } else if (ch == '!') {
- nextChar();
- if (ch == '-') {
- nextChar();
- if (ch == '-') {
- nextChar();
- while (ch != -1) {
- int dash = 0;
- while (ch == '-') {
- dash++;
- nextChar();
- }
- // Strictly speaking, a comment should not contain "--"
- // so dash > 2 is an error, dash == 2 implies ch == '>'
- // See http://www.w3.org/TR/html-markup/syntax.html#syntax-comments
- // for more details.
- if (dash >= 2 && ch == '>') {
- nextChar();
- return;
- }
-
- nextChar();
- }
- }
- } else if (ch == '[') {
- nextChar();
- if (ch == 'C') {
- nextChar();
- if (ch == 'D') {
- nextChar();
- if (ch == 'A') {
- nextChar();
- if (ch == 'T') {
- nextChar();
- if (ch == 'A') {
- nextChar();
- if (ch == '[') {
- while (true) {
- nextChar();
- if (ch == ']') {
- nextChar();
- if (ch == ']') {
- nextChar();
- if (ch == '>') {
- nextChar();
- return;
- }
- }
- }
- }
-
- }
- }
- }
- }
- }
- }
- } else {
- StringBuilder sb = new StringBuilder();
- while (ch != -1 && ch != '>') {
- sb.append((char) ch);
- nextChar();
- }
- Pattern p = Pattern.compile("(?is)doctype\\s+html\\s?.*");
- String s = sb.toString();
- if (p.matcher(s).matches()) {
- docType(s);
- return;
- }
- }
- } else if (ch == '?') {
- nextChar();
- if (ch == 'x') {
- nextChar();
- if (ch == 'm') {
- nextChar();
- if (ch == 'l') {
- Map<String,String> attrs = htmlAttrs();
- if (ch == '?') {
- nextChar();
- if (ch == '>') {
- nextChar();
- xml = true;
- return;
- }
- }
- }
- }
-
- }
- }
-
- if (!inScript) {
- error(file, lineNumber, "bad html");
- }
- }
-
- /**
- * Read a series of HTML attributes, terminated by {@literal > }.
- * Each attribute is of the form {@literal identifier[=value] }.
- * "value" may be unquoted, single-quoted, or double-quoted.
- */
- private Map<String,String> htmlAttrs() throws IOException {
- Map<String, String> map = new LinkedHashMap<>();
- skipWhitespace();
-
- loop:
- while (isIdentifierStart((char) ch)) {
- String name = readAttributeName().toLowerCase(Locale.US);
- skipWhitespace();
- String value = null;
- if (ch == '=') {
- nextChar();
- skipWhitespace();
- if (ch == '\'' || ch == '"') {
- char quote = (char) ch;
- nextChar();
- StringBuilder sb = new StringBuilder();
- while (ch != -1 && ch != quote) {
- sb.append((char) ch);
- nextChar();
- }
- value = sb.toString() // hack to replace common entities
- .replace("<", "<")
- .replace(">", ">")
- .replace("&", "&");
- nextChar();
- } else {
- StringBuilder sb = new StringBuilder();
- while (ch != -1 && !isUnquotedAttrValueTerminator((char) ch)) {
- sb.append((char) ch);
- nextChar();
- }
- value = sb.toString();
- }
- skipWhitespace();
- }
- map.put(name, value);
- }
-
- return map;
- }
-
- private boolean isIdentifierStart(char ch) {
- return Character.isUnicodeIdentifierStart(ch);
- }
-
- private String readIdentifier() throws IOException {
- StringBuilder sb = new StringBuilder();
- sb.append((char) ch);
- nextChar();
- while (ch != -1 && Character.isUnicodeIdentifierPart(ch)) {
- sb.append((char) ch);
- nextChar();
- }
- return sb.toString();
- }
-
- private String readAttributeName() throws IOException {
- StringBuilder sb = new StringBuilder();
- sb.append((char) ch);
- nextChar();
- while (ch != -1 && Character.isUnicodeIdentifierPart(ch)
- || ch == '-'
- || xml && ch == ':') {
- sb.append((char) ch);
- nextChar();
- }
- return sb.toString();
- }
-
- private boolean isWhitespace(char ch) {
- return Character.isWhitespace(ch);
- }
-
- private void skipWhitespace() throws IOException {
- while (isWhitespace((char) ch)) {
- nextChar();
- }
- }
-
- private boolean isUnquotedAttrValueTerminator(char ch) {
- switch (ch) {
- case '\f': case '\n': case '\r': case '\t':
- case ' ':
- case '"': case '\'': case '`':
- case '=': case '<': case '>':
- return true;
- default:
- return false;
- }
- }
- }
-
- /**
- * A class to check the links in a set of HTML files.
- */
- static class LinkChecker extends HtmlParser {
- private final Map<Path, IDTable> allFiles;
- private final Map<URI, IDTable> allURIs;
-
- private int files;
- private int links;
- private int badSchemes;
- private int duplicateIds;
- private int missingIds;
-
- private Path currFile;
- private IDTable currTable;
- private boolean html5;
- private boolean xml;
-
- private int errors;
-
- LinkChecker(PrintStream out, Function<Path,String> fileReader) {
- super(out, fileReader);
- allFiles = new HashMap<>();
- allURIs = new HashMap<>();
- }
-
- void checkDirectory(Path dir) throws IOException {
- checkFiles(List.of(dir), false, Collections.emptySet());
- }
-
- void checkFiles(List<Path> files, boolean skipSubdirs, Set<Path> excludeFiles) throws IOException {
- for (Path file : files) {
- Files.walkFileTree(file, new SimpleFileVisitor<Path>() {
- int depth = 0;
-
- @Override
- public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
- if ((skipSubdirs && depth > 0) || excludeFiles.contains(dir)) {
- return FileVisitResult.SKIP_SUBTREE;
- }
- depth++;
- return FileVisitResult.CONTINUE;
- }
-
- @Override
- public FileVisitResult visitFile(Path p, BasicFileAttributes attrs) {
- if (excludeFiles.contains(p)) {
- return FileVisitResult.CONTINUE;
- }
-
- if (Files.isRegularFile(p) && p.getFileName().toString().endsWith(".html")) {
- checkFile(p);
- }
- return FileVisitResult.CONTINUE;
- }
-
- @Override
- public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException {
- depth--;
- return super.postVisitDirectory(dir, e);
- }
- });
- }
- }
-
- void checkFile(Path file) {
- try {
- read(file);
- } catch (IOException e) {
- error(file, 0, e);
- }
- }
-
- int getErrorCount() {
- return errors;
- }
-
- public void report() {
- List<Path> missingFiles = getMissingFiles();
- if (!missingFiles.isEmpty()) {
- report("Missing files: (" + missingFiles.size() + ")");
- missingFiles.stream()
- .sorted()
- .forEach(this::reportMissingFile);
-
- }
-
- if (!allURIs.isEmpty()) {
- report(false, "External URLs:");
- allURIs.keySet().stream()
- .sorted(new URIComparator())
- .forEach(uri -> report(false, " %s", uri.toString()));
- }
-
- int anchors = 0;
- for (IDTable t : allFiles.values()) {
- anchors += t.map.values().stream()
- .filter(e -> !e.getReferences().isEmpty())
- .count();
- }
- for (IDTable t : allURIs.values()) {
- anchors += t.map.values().stream()
- .filter(e -> !e.references.isEmpty())
- .count();
- }
-
- report(false, "Checked " + files + " files.");
- report(false, "Found " + links + " references to " + anchors + " anchors "
- + "in " + allFiles.size() + " files and " + allURIs.size() + " other URIs.");
- report(!missingFiles.isEmpty(), "%6d missing files", missingFiles.size());
- report(duplicateIds > 0, "%6d duplicate ids", duplicateIds);
- report(missingIds > 0, "%6d missing ids", missingIds);
-
- Map<String, Integer> schemeCounts = new TreeMap<>();
- Map<String, Integer> hostCounts = new TreeMap<>(new HostComparator());
- for (URI uri : allURIs.keySet()) {
- String scheme = uri.getScheme();
- if (scheme != null) {
- schemeCounts.put(scheme, schemeCounts.computeIfAbsent(scheme, s -> 0) + 1);
- }
- String host = uri.getHost();
- if (host != null) {
- hostCounts.put(host, hostCounts.computeIfAbsent(host, h -> 0) + 1);
- }
- }
-
- if (schemeCounts.size() > 0) {
- report(false, "Schemes");
- schemeCounts.forEach((s, n) -> report(!isSchemeOK(s), "%6d %s", n, s));
- }
-
- if (hostCounts.size() > 0) {
- report(false, "Hosts");
- hostCounts.forEach((h, n) -> report(false, "%6d %s", n, h));
- }
- }
-
- private void report(String message, Object... args) {
- out.println(String.format(message, args));
- }
-
- private void report(boolean highlight, String message, Object... args) {
- out.print(highlight ? "* " : " ");
- out.println(String.format(message, args));
- }
-
- private void reportMissingFile(Path file) {
- report("%s", relativePath(file));
- IDTable table = allFiles.get(file);
- Set<Path> refs = new TreeSet<>();
- for (ID id : table.map.values()) {
- if (id.references != null) {
- for (Position p : id.references) {
- refs.add(p.path);
- }
- }
- }
- int n = 0;
- int MAX_REFS = 10;
- for (Path ref : refs) {
- report(" in " + relativePath(ref));
- if (++n == MAX_REFS) {
- report(" ... and %d more", refs.size() - n);
- break;
- }
- }
- }
-
- @Override
- public void startFile(Path path) {
- currFile = path.toAbsolutePath().normalize();
- currTable = allFiles.computeIfAbsent(currFile, p -> new IDTable(p));
- html5 = false;
- files++;
- }
-
- @Override
- public void endFile() {
- currTable.check();
- }
-
- @Override
- public void docType(String doctype) {
- html5 = doctype.matches("(?i)<\\?doctype\\s+html>");
- }
-
- @Override @SuppressWarnings("fallthrough")
- public void startElement(String name, Map<String, String> attrs, boolean selfClosing) {
- int line = getLineNumber();
- switch (name) {
- case "a":
- String nameAttr = html5 ? null : attrs.get("name");
- if (nameAttr != null) {
- foundAnchor(line, nameAttr);
- }
- // fallthrough
- case "link":
- String href = attrs.get("href");
- if (href != null) {
- foundReference(line, href);
- }
- break;
- }
-
- String idAttr = attrs.get("id");
- if (idAttr != null) {
- foundAnchor(line, idAttr);
- }
- }
-
- @Override
- public void endElement(String name) { }
-
- private void foundAnchor(int line, String name) {
- currTable.addID(line, name);
- }
-
- private void foundReference(int line, String ref) {
- links++;
- try {
- URI uri = new URI(ref);
- if (uri.isAbsolute()) {
- foundReference(line, uri);
- } else {
- Path p;
- String uriPath = uri.getPath();
- if (uriPath == null || uriPath.isEmpty()) {
- p = currFile;
- } else {
- p = currFile.getParent().resolve(uriPath).normalize();
- }
- foundReference(line, p, uri.getFragment());
- }
- } catch (URISyntaxException e) {
- error(currFile, line, "invalid URI: " + e);
- }
- }
-
- private void foundReference(int line, Path p, String fragment) {
- IDTable t = allFiles.computeIfAbsent(p, key -> new IDTable(key));
- t.addReference(fragment, currFile, line);
- }
-
- private void foundReference(int line, URI uri) {
- if (!isSchemeOK(uri.getScheme())) {
- error(currFile, line, "bad scheme in URI");
- badSchemes++;
- }
-
- String fragment = uri.getFragment();
- try {
- URI noFrag = new URI(uri.toString().replaceAll("#\\Q" + fragment + "\\E$", ""));
- IDTable t = allURIs.computeIfAbsent(noFrag, key -> new IDTable(key.toString()));
- t.addReference(fragment, currFile, line);
- } catch (URISyntaxException e) {
- throw new Error(e);
- }
- }
-
- private boolean isSchemeOK(String uriScheme) {
- if (uriScheme == null) {
- return true;
- }
-
- switch (uriScheme) {
- case "file":
- case "ftp":
- case "http":
- case "https":
- case "javascript":
- case "mailto":
- return true;
-
- default:
- return false;
- }
- }
-
- private List<Path> getMissingFiles() {
- return allFiles.entrySet().stream()
- .filter(e -> !Files.exists(e.getKey()))
- .map(e -> e.getKey())
- .collect(Collectors.toList());
- }
-
- @Override
- protected void error(Path file, int lineNumber, String message) {
- super.error(relativePath(file), lineNumber, message);
- errors++;
- }
-
- @Override
- protected void error(Path file, int lineNumber, Throwable t) {
- super.error(relativePath(file), lineNumber, t);
- errors++;
- }
-
- private Path relativePath(Path path) {
- return path.startsWith(currDir) ? currDir.relativize(path) : path;
- }
-
- /**
- * A position in a file, as identified by a file name and line number.
- */
- static class Position implements Comparable<Position> {
- Path path;
- int line;
-
- Position(Path path, int line) {
- this.path = path;
- this.line = line;
- }
-
- @Override
- public int compareTo(Position o) {
- int v = path.compareTo(o.path);
- return v != 0 ? v : Integer.compare(line, o.line);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- } else if (obj == null || getClass() != obj.getClass()) {
- return false;
- } else {
- final Position other = (Position) obj;
- return Objects.equals(this.path, other.path)
- && this.line == other.line;
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(path) * 37 + line;
- }
- }
-
- /**
- * Infor for an ID within an HTML file, and a set of positions that reference it.
- */
- static class ID {
- boolean declared;
- Set<Position> references;
-
- Set<Position> getReferences() {
- return (references) == null ? Collections.emptySet() : references;
- }
- }
-
- /**
- * A table for the set of IDs in an HTML file.
- */
- class IDTable {
- private String name;
- private boolean checked;
- private final Map<String, ID> map = new HashMap<>();
-
- IDTable(Path p) {
- this(relativePath(p).toString());
- }
-
- IDTable(String name) {
- this.name = name;
- }
-
- void addID(int line, String name) {
- if (checked) {
- throw new IllegalStateException("Adding ID after file has been read");
- }
- Objects.requireNonNull(name);
- ID id = map.computeIfAbsent(name, x -> new ID());
- if (id.declared) {
- error(currFile, line, "name already declared: " + name);
- duplicateIds++;
- } else {
- id.declared = true;
- }
- }
-
- void addReference(String name, Path from, int line) {
- if (checked) {
- if (name != null) {
- ID id = map.get(name);
- if (id == null || !id.declared) {
- error(from, line, "id not found: " + this.name + "#" + name);
- }
- }
- } else {
- ID id = map.computeIfAbsent(name, x -> new ID());
- if (id.references == null) {
- id.references = new TreeSet<>();
- }
- id.references.add(new Position(from, line));
- }
- }
-
- void check() {
- map.forEach((name, id) -> {
- if (name != null && !id.declared) {
- //log.error(currFile, 0, "id not declared: " + name);
- for (Position ref : id.references) {
- error(ref.path, ref.line, "id not found: " + this.name + "#" + name);
- }
- missingIds++;
- }
- });
- checked = true;
- }
- }
-
- static class URIComparator implements Comparator<URI> {
- final HostComparator hostComparator = new HostComparator();
-
- @Override
- public int compare(URI o1, URI o2) {
- if (o1.isOpaque() || o2.isOpaque()) {
- return o1.compareTo(o2);
- }
- String h1 = o1.getHost();
- String h2 = o2.getHost();
- String s1 = o1.getScheme();
- String s2 = o2.getScheme();
- if (h1 == null || h1.isEmpty() || s1 == null || s1.isEmpty()
- || h2 == null || h2.isEmpty() || s2 == null || s2.isEmpty()) {
- return o1.compareTo(o2);
- }
- int v = hostComparator.compare(h1, h2);
- if (v != 0) {
- return v;
- }
- v = s1.compareTo(s2);
- if (v != 0) {
- return v;
- }
- return o1.compareTo(o2);
- }
- }
-
- static class HostComparator implements Comparator<String> {
- @Override
- public int compare(String h1, String h2) {
- List<String> l1 = new ArrayList<>(Arrays.asList(h1.split("\\.")));
- Collections.reverse(l1);
- String r1 = String.join(".", l1);
- List<String> l2 = new ArrayList<>(Arrays.asList(h2.split("\\.")));
- Collections.reverse(l2);
- String r2 = String.join(".", l2);
- return r1.compareTo(r2);
- }
- }
-
- }
-}
--- a/test/langtools/jdk/javadoc/doclet/testAbsLinkPath/TestAbsLinkPath.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testAbsLinkPath/TestAbsLinkPath.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -26,12 +26,14 @@
* @bug 4640745
* @summary This test verifys that the -link option handles absolute paths.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestAbsLinkPath
*/
+import javadoc.tester.JavadocTester;
+
public class TestAbsLinkPath extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test1() {
+ public void test1() {
String out1 = "out1";
javadoc("-d", out1, "-sourcepath", testSrc, "pkg2");
checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/testAbstractMethod/TestAbstractMethod.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testAbstractMethod/TestAbstractMethod.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* @summary Make sure that the abstract method is identified correctly
* if the abstract modifier is present explicitly or implicitly.
* @author bpatel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestAbstractMethod
*/
+import javadoc.tester.JavadocTester;
+
public class TestAbstractMethod extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
--- a/test/langtools/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testAnchorNames/TestAnchorNames.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,9 +26,9 @@
* @bug 8025633 8025524 8081854 8187521 8182765
* @summary Test for valid name attribute in HTML anchors.
* @author Bhavesh Patel
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build toolbox.ToolBox JavadocTester
+ * @build toolbox.ToolBox javadoc.tester.*
* @run main TestAnchorNames
*/
@@ -36,7 +36,8 @@
import java.nio.file.Path;
import java.nio.file.Paths;
-import toolbox.*;
+import javadoc.tester.JavadocTester;
+import toolbox.ToolBox;
public class TestAnchorNames extends JavadocTester {
@@ -51,7 +52,7 @@
}
@Test
- void testHtml4(Path ignore) {
+ public void testHtml4(Path ignore) {
setAutomaticCheckLinks(false); // @ignore JDK-8202622
javadoc("-d", "out-html4",
"-html4",
@@ -172,7 +173,7 @@
}
@Test
- void testHtml5(Path ignore) {
+ public void testHtml5(Path ignore) {
javadoc("-d", "out-html5",
"-sourcepath", testSrc,
"-source", "8", //so that '_' can be used as an identifier
@@ -289,7 +290,7 @@
* @throws IOException if there is a problem generating the source files
*/
@Test
- void testNonAscii(Path base) throws IOException {
+ public void testNonAscii(Path base) throws IOException {
Path src = base.resolve("src");
tb.writeJavaFiles(src,
"package p; public class Def {\n"
--- a/test/langtools/jdk/javadoc/doclet/testAnnotationOptional/TestAnnotationOptional.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testAnnotationOptional/TestAnnotationOptional.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* @summary Make sure that annotations types with optional elements have
* element headers
* @author Mahmood Ali
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestAnnotationOptional
*/
+import javadoc.tester.JavadocTester;
+
public class TestAnnotationOptional extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
@@ -52,7 +54,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* @summary Make sure that annotation types with 0 members does not have
* extra HR tags.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestAnnotationTypes
*/
+import javadoc.tester.JavadocTester;
+
public class TestAnnotationTypes extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out-1",
"-sourcepath", testSrc,
"pkg");
@@ -92,7 +94,7 @@
}
@Test
- void testLinkSource() {
+ public void testLinkSource() {
javadoc("-d", "out-2",
"-linksource",
"-sourcepath", testSrc,
@@ -117,7 +119,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testAuthor/TestAuthor.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testAuthor/TestAuthor.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,9 +25,9 @@
* @test
* @bug 8202947
* @summary test the at-author tag, and corresponding option
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build toolbox.ToolBox JavadocTester
+ * @build toolbox.ToolBox javadoc.tester.*
* @run main TestAuthor
*/
@@ -35,6 +35,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
+import javadoc.tester.JavadocTester;
import toolbox.ToolBox;
public class TestAuthor extends JavadocTester {
@@ -58,7 +59,7 @@
}
@Test
- void testAuthor() {
+ public void testAuthor() {
javadoc("-d", "out-author",
"-sourcepath", src.toString(),
"-author",
@@ -69,7 +70,7 @@
}
@Test
- void testNoAuthor() {
+ public void testNoAuthor() {
javadoc("-d", "out-noauthor",
"-sourcepath", src.toString(),
"pkg");
--- a/test/langtools/jdk/javadoc/doclet/testBackSlashInLink/TestBackSlashInLink.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testBackSlashInLink/TestBackSlashInLink.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -27,12 +27,14 @@
* @summary Test to make sure that the link to source documentation
* has a forward slash. It would be wrong to use a back slash.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestBackSlashInLink
*/
+import javadoc.tester.JavadocTester;
+
public class TestBackSlashInLink extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-linksource",
--- a/test/langtools/jdk/javadoc/doclet/testBadHtml/TestBadHtml.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testBadHtml/TestBadHtml.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -25,12 +25,14 @@
* @test
* @bug 8176901
* @summary The doclet should cope with bad HTML form
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestBadHtml
*/
+import javadoc.tester.JavadocTester;
+
public class TestBadHtml extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void testNegative() {
+ public void testNegative() {
javadoc("-d", "out1",
"-sourcepath", testSrc,
"pkg1");
--- a/test/langtools/jdk/javadoc/doclet/testBadPackageFileInJar/TestBadPackageFileInJar.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testBadPackageFileInJar/TestBadPackageFileInJar.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -27,9 +27,9 @@
* @summary Make sure that Javadoc emits a useful warning
* when a bad package.html exists in a JAR archive.
* @author jamieh
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox toolbox.JarTask
+ * @build javadoc.tester.* toolbox.ToolBox toolbox.JarTask
* @run main TestBadPackageFileInJar
*/
@@ -41,6 +41,8 @@
import java.nio.file.Path;
import java.nio.file.Paths;
+import javadoc.tester.JavadocTester;
+
public class TestBadPackageFileInJar extends JavadocTester {
final ToolBox tb = new ToolBox();
@@ -51,7 +53,7 @@
}
@Test
- void test() throws IOException {
+ public void test() throws IOException {
// create the file
Path pkgDir = Paths.get("pkg");
tb.createDirectories(pkgDir);
--- a/test/langtools/jdk/javadoc/doclet/testBadSourceFile/TestBadSourceFile.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testBadSourceFile/TestBadSourceFile.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -27,12 +27,14 @@
* @summary Make sure exception is not thrown if there is a bad source
* file in the same directory as the file being documented.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestBadSourceFile
*/
+import javadoc.tester.JavadocTester;
+
public class TestBadSourceFile extends JavadocTester {
/**
@@ -46,7 +48,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-Xdoclint:none",
"-d", "out",
testSrc("C2.java"));
--- a/test/langtools/jdk/javadoc/doclet/testBaseClass/TestBaseClass.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testBaseClass/TestBaseClass.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -26,13 +26,15 @@
* @bug 4197513
* @summary Javadoc does not process base class.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
* @build BaseClass
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestBaseClass
*/
+import javadoc.tester.JavadocTester;
+
public class TestBaseClass extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-sourcepath", testSrc,
"-docletpath", System.getProperty("test.classes", "."),
"-doclet", "BaseClass",
--- a/test/langtools/jdk/javadoc/doclet/testBreakIterator/TestBreakIterator.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testBreakIterator/TestBreakIterator.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -29,12 +29,14 @@
* Correct Answer: "This is a class (i.e. it is indeed a class)."
* Wrong Answer: "This is a class (i.e."
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestBreakIterator
*/
+import javadoc.tester.JavadocTester;
+
public class TestBreakIterator extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-breakiterator",
--- a/test/langtools/jdk/javadoc/doclet/testCRLineSeparator/TestCRLineSeparator.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testCRLineSeparator/TestCRLineSeparator.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, 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
@@ -26,15 +26,17 @@
* @bug 4979486
* @summary Make sure tool parses CR line separators properly.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestCRLineSeparator
*/
import java.io.*;
import java.util.*;
+import javadoc.tester.JavadocTester;
+
public class TestCRLineSeparator extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
}
@Test
- void test() throws IOException {
+ public void test() throws IOException {
initFiles(new File(testSrc), new File("src"), "pkg");
javadoc("-d", "out",
"-sourcepath", "src",
--- a/test/langtools/jdk/javadoc/doclet/testCharset/TestCharset.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testCharset/TestCharset.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -27,12 +27,14 @@
* @summary Run a test on -charset to make sure the charset gets generated as a
* part of the meta tag.
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestCharset
*/
+import javadoc.tester.JavadocTester;
+
public class TestCharset extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-charset", "ISO-8859-1",
"-sourcepath", testSrc,
@@ -60,7 +62,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out-1",
"-sourcepath", testSrc,
"pkg");
--- a/test/langtools/jdk/javadoc/doclet/testCharsetDocencodingOptions/TestCharsetDocencodingOptions.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testCharsetDocencodingOptions/TestCharsetDocencodingOptions.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -25,12 +25,14 @@
* @test
* @bug 8183582
* @summary Rationalize doclet -docencoding and -charset options.
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestCharsetDocencodingOptions
*/
+import javadoc.tester.JavadocTester;
+
public class TestCharsetDocencodingOptions extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void testWithNoOptions() {
+ public void testWithNoOptions() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
@@ -49,7 +51,7 @@
}
@Test
- void testWithDocencoding() {
+ public void testWithDocencoding() {
javadoc("-d", "out-1",
"-docencoding", "ISO-8859-1",
"-sourcepath", testSrc,
@@ -60,7 +62,7 @@
}
@Test
- void testWithCharset() {
+ public void testWithCharset() {
javadoc("-d", "out-2",
"-charset", "ISO-8859-1",
"-sourcepath", testSrc,
@@ -71,7 +73,7 @@
}
@Test
- void testDocencodingWithCharsetSimilar() {
+ public void testDocencodingWithCharsetSimilar() {
javadoc("-d", "out-3",
"-docencoding", "ISO-8859-1",
"-charset", "ISO-8859-1",
@@ -83,7 +85,7 @@
}
@Test
- void testDocencodingWithCharsetDifferent() {
+ public void testDocencodingWithCharsetDifferent() {
javadoc("-d", "out-4",
"-charset", "UTF-8",
"-docencoding", "ISO-8859-1",
@@ -96,7 +98,7 @@
}
@Test
- void testWithEncoding() {
+ public void testWithEncoding() {
javadoc("-d", "out-5",
"-sourcepath", testSrc,
"-encoding", "ISO-8859-1",
--- a/test/langtools/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testClassCrossReferences/TestClassCrossReferences.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,13 +26,15 @@
* @bug 4652655 4857717 8025633 8026567 8071982 8164407 8182765 8205593
* @summary This test verifies that class cross references work properly.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @build TestClassCrossReferences
* @run main TestClassCrossReferences
*/
+import javadoc.tester.JavadocTester;
+
public class TestClassCrossReferences extends JavadocTester {
static final String uri = "http://docs.oracle.com/javase/8/docs/api/";
@@ -43,7 +45,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-source", "8",
"-Xdoclint:none",
@@ -70,7 +72,7 @@
}
@Test
- void test_error() {
+ public void test_error() {
javadoc("-d", "out-error",
"-Xdoclint:none",
"-sourcepath", testSrc,
@@ -83,7 +85,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-source", "8",
"-html4",
--- a/test/langtools/jdk/javadoc/doclet/testClassDocCatalog/TestClassDocCatalog.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testClassDocCatalog/TestClassDocCatalog.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,14 @@
* @test
* @bug 8071982 8196202
* @summary Test for package-frame.html.
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestClassDocCatalog
*/
+import javadoc.tester.JavadocTester;
+
public class TestClassDocCatalog extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"--frames",
testSrc("pkg1/EmptyAnnotation.java"),
--- a/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,13 +25,15 @@
* @test
* @bug 8163800 8175200 8186332 8182765
* @summary The fix for JDK-8072052 shows up other minor incorrect use of styles
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @build TestClassLinks
* @run main TestClassLinks
*/
+import javadoc.tester.JavadocTester;
+
public class TestClassLinks extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-Xdoclint:none",
@@ -85,7 +87,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
--- a/test/langtools/jdk/javadoc/doclet/testClassTree/TestClassTree.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testClassTree/TestClassTree.java Fri Dec 21 10:38:33 2018 -0800
@@ -29,12 +29,14 @@
* Make sure class tree includes heirarchy for enums and annotation
* types.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestClassTree
*/
+import javadoc.tester.JavadocTester;
+
public class TestClassTree extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
--- a/test/langtools/jdk/javadoc/doclet/testCmndLineClass/TestCmndLineClass.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testCmndLineClass/TestCmndLineClass.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -28,12 +28,14 @@
* when specifying packages on the command line and specifying individual
* classes.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestCmndLineClass
*/
+import javadoc.tester.JavadocTester;
+
public class TestCmndLineClass extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
}
@Test
- void test() {
+ public void test() {
String outdir1 = "out-1";
String outdir2 = "out-2";
--- a/test/langtools/jdk/javadoc/doclet/testCompletionFailure/TestCompletionFailure.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testCompletionFailure/TestCompletionFailure.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -26,12 +26,14 @@
* @bug 8027977
* @summary Test to verify javadoc executes without CompletionFailure exception.
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestCompletionFailure
*/
+import javadoc.tester.JavadocTester;
+
public class TestCompletionFailure extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg1");
--- a/test/langtools/jdk/javadoc/doclet/testConstantValuesPage/TestConstantValuesPage.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testConstantValuesPage/TestConstantValuesPage.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -27,12 +27,14 @@
* @summary Test to make sure that constant values page does not get
* generated when doclet has nothing to document.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestConstantValuesPage
*/
+import javadoc.tester.JavadocTester;
+
public class TestConstantValuesPage extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"foo");
--- a/test/langtools/jdk/javadoc/doclet/testConstructorIndent/TestConstructorIndent.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testConstructorIndent/TestConstructorIndent.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -27,12 +27,14 @@
* @summary The constructor comments should be surrounded by
* <dl></dl>. Check for this in the output.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestConstructorIndent
*/
+import javadoc.tester.JavadocTester;
+
public class TestConstructorIndent extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
testSrc("C.java"));
--- a/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 8025524 8031625 8081854 8175200 8186332 8182765
* @summary Test for constructor name which should be a non-qualified name.
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestConstructors
*/
+import javadoc.tester.JavadocTester;
+
public class TestConstructors extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg1");
@@ -90,7 +92,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,14 @@
* @test
* @bug 8157349 8185985 8194953
* @summary test copy of doc-files, and its contents for HTML meta content.
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestCopyFiles
*/
+import javadoc.tester.JavadocTester;
+
public class TestCopyFiles extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void testDocFilesInModulePackages() {
+ public void testDocFilesInModulePackages() {
javadoc("-d", "modules-out",
"-top", "phi-TOP-phi",
"-bottom", "phi-BOTTOM-phi",
@@ -75,7 +77,7 @@
}
@Test
- void testDocFilesInMultiModulePackagesWithRecursiveCopy() {
+ public void testDocFilesInMultiModulePackagesWithRecursiveCopy() {
javadoc("-d", "multi-modules-out-recursive",
"-docfilessubdirs",
"-top", "phi-TOP-phi",
@@ -134,7 +136,7 @@
}
@Test
- void testDocFilesInModulePackagesWithRecursiveCopy() {
+ public void testDocFilesInModulePackagesWithRecursiveCopy() {
javadoc("-d", "modules-out-recursive",
"-docfilessubdirs",
"--module-source-path", testSrc("modules"),
@@ -147,7 +149,7 @@
}
@Test
- void testDocFilesInModulePackagesWithRecursiveCopyWithExclusion() {
+ public void testDocFilesInModulePackagesWithRecursiveCopyWithExclusion() {
javadoc("-d", "modules-out-recursive-with-exclusion",
"-docfilessubdirs",
"-excludedocfilessubdir", "sub-dir",
@@ -161,7 +163,7 @@
}
@Test
- void testDocFilesInPackages() {
+ public void testDocFilesInPackages() {
javadoc("-d", "packages-out",
"-sourcepath", testSrc("packages"),
"p1");
@@ -172,7 +174,7 @@
}
@Test
- void testDocFilesInPackagesWithRecursiveCopy() {
+ public void testDocFilesInPackagesWithRecursiveCopy() {
javadoc("-d", "packages-out-recursive",
"-docfilessubdirs",
"-sourcepath", testSrc("packages"),
@@ -190,7 +192,7 @@
}
@Test
- void testDocFilesInPackagesWithRecursiveCopyWithExclusion() {
+ public void testDocFilesInPackagesWithRecursiveCopyWithExclusion() {
javadoc("-d", "packages-out-recursive-with-exclusion",
"-docfilessubdirs",
"-excludedocfilessubdir", "sub-dir",
@@ -204,7 +206,7 @@
}
@Test
- void testDocFilesInUnnamedPackages() {
+ public void testDocFilesInUnnamedPackages() {
javadoc("-d", "unnamed-out",
"-windowtitle", "phi-WINDOW-TITLE-phi",
"-sourcepath", testSrc("unnamed"),
@@ -218,7 +220,7 @@
}
@Test
- void testDocFilesInUnnamedPackagesWithRecursiveCopy() {
+ public void testDocFilesInUnnamedPackagesWithRecursiveCopy() {
javadoc("-d", "unnamed-out-recursive",
"-docfilessubdirs",
"-windowtitle", "phi-WINDOW-TITLE-phi",
@@ -237,7 +239,7 @@
}
@Test
- void testDocFilesInPackagesSource7() {
+ public void testDocFilesInPackagesSource7() {
javadoc("-d", "packages-out-src7",
"-source", "7",
"-sourcepath", testSrc("packages"),
@@ -249,7 +251,7 @@
}
@Test
- void testDocFilesInPackagesSource7UsingClassPath() {
+ public void testDocFilesInPackagesSource7UsingClassPath() {
javadoc("-d", "packages-out-src7-cp",
"-source", "7",
"-classpath", testSrc("packages"),
@@ -261,7 +263,7 @@
}
@Test
- void testCopyThrough() {
+ public void testCopyThrough() {
javadoc("-d", "copy",
"-sourcepath", testSrc("packages"),
"p2");
--- a/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* 8169819 8074407 8191030 8182765 8184205
* @summary test generated docs for deprecated items
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestDeprecatedDocs
*/
+import javadoc.tester.JavadocTester;
+
public class TestDeprecatedDocs extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
@@ -299,7 +301,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testDocEncoding/TestDocEncoding.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testDocEncoding/TestDocEncoding.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -31,14 +31,16 @@
* @summary Run tests on -docencoding to see if the value is
used for stylesheet as well.
* @author jayashree viswanathan
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestDocEncoding
*/
import java.nio.charset.Charset;
+import javadoc.tester.JavadocTester;
+
public class TestDocEncoding extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -47,7 +49,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-docencoding", "Cp930",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testDocErrorReporter/TestDocErrorReporter.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testDocErrorReporter/TestDocErrorReporter.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -27,12 +27,14 @@
* @summary Make sure that option validation errors and sent to the
* DocErrorReporter.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestDocErrorReporter
*/
+import javadoc.tester.JavadocTester;
+
public class TestDocErrorReporter extends JavadocTester {
/**
@@ -46,7 +48,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-encoding", "xyz",
--- a/test/langtools/jdk/javadoc/doclet/testDocFileDir/TestDocFileDir.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testDocFileDir/TestDocFileDir.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -29,12 +29,14 @@
* directory.
* Also test that -docfilessubdirs and -excludedocfilessubdir both work.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestDocFileDir
*/
+import javadoc.tester.JavadocTester;
+
public class TestDocFileDir extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -44,7 +46,7 @@
// Output dir = "", Input dir = ""
@Test
- void test1() {
+ public void test1() {
copyDir(testSrc("pkg"), ".");
setOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES);
javadoc("pkg/C.java");
@@ -55,7 +57,7 @@
// Output dir = Input Dir
@Test
- void test2() {
+ public void test2() {
String outdir = "out2";
copyDir(testSrc("pkg"), outdir);
setOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES);
@@ -69,7 +71,7 @@
// Exercising -docfilessubdirs and -excludedocfilessubdir
@Test
- void test3() {
+ public void test3() {
String outdir = "out3";
setOutputDirectoryCheck(DirectoryCheck.NONE);
javadoc("-d", outdir,
--- a/test/langtools/jdk/javadoc/doclet/testDocFiles/TestDocFiles.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testDocFiles/TestDocFiles.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -25,12 +25,14 @@
* @test
* @bug 8008949
* @summary verify that doc-files get copied
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestDocFiles
*/
+import javadoc.tester.JavadocTester;
+
public class TestDocFiles extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
--- a/test/langtools/jdk/javadoc/doclet/testDocRootInlineTag/TestDocRootInlineTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testDocRootInlineTag/TestDocRootInlineTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -28,12 +28,14 @@
* If docRoot performs as documented, the test passes.
* Make sure that the docRoot tag works with the -bottom option.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestDocRootInlineTag
*/
+import javadoc.tester.JavadocTester;
+
public class TestDocRootInlineTag extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
}
@Test
- void test() {
+ public void test() {
String uri = "http://www.java.sun.com/j2se/1.4/docs/api";
javadoc("-bottom", "The value of @docRoot is \"{@docRoot}\"",
--- a/test/langtools/jdk/javadoc/doclet/testDocRootLink/TestDocRootLink.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testDocRootLink/TestDocRootLink.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -26,11 +26,13 @@
* @bug 6553182 8025416 8029504
* @summary This test verifies the -Xdocrootparent option.
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestDocRootLink
*/
+import javadoc.tester.JavadocTester;
+
public class TestDocRootLink extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out-1",
"-sourcepath", testSrc,
"pkg1", "pkg2");
@@ -71,7 +73,7 @@
}
@Test
- void test2() {
+ public void test2() {
javadoc("-d", "out-2",
"-Xdocrootparent", "http://download.oracle.com/javase/7/docs",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testDupParamWarn/TestDupParamWarn.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testDupParamWarn/TestDupParamWarn.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -27,12 +27,14 @@
* @summary Test to ensure that the doclet does not print out bad
* warning messages about duplicate param tags.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestDupParamWarn
*/
+import javadoc.tester.JavadocTester;
+
public class TestDupParamWarn extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
--- a/test/langtools/jdk/javadoc/doclet/testEmptyClass/TestEmptyClass.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testEmptyClass/TestEmptyClass.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, 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
@@ -27,12 +27,14 @@
* @summary Test to make sure that Javadoc behaves properly when
* run on a completely empty class (no comments or members).
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestEmptyClass
*/
+import javadoc.tester.JavadocTester;
+
public class TestEmptyClass extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-classpath", testSrc("src"),
"-d", "out",
"-sourcepath", testSrc("src"),
--- a/test/langtools/jdk/javadoc/doclet/testEnclosingClass/TestEnclosingClass.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testEnclosingClass/TestEnclosingClass.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, 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
@@ -26,12 +26,14 @@
* @bug 5008230
* @summary Check the outer class when documenting enclosing class/interface.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestEnclosingClass
*/
+import javadoc.tester.JavadocTester;
+
public class TestEnclosingClass extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
--- a/test/langtools/jdk/javadoc/doclet/testEncoding/TestEncoding.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testEncoding/TestEncoding.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -27,12 +27,14 @@
* @summary This test determines if the value of the -encoding option is
* properly passed from Javadoc to the source file parser.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestEncoding
*/
+import javadoc.tester.JavadocTester;
+
public class TestEncoding extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-encoding", "iso-8859-1",
--- a/test/langtools/jdk/javadoc/doclet/testEnumConstructor/TestEnumConstructor.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testEnumConstructor/TestEnumConstructor.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,9 +25,9 @@
* @test
* @bug 8202624
* @summary javadoc generates references to enum constructors, which are not documented
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestEnumConstructor
*/
@@ -37,6 +37,8 @@
import toolbox.ToolBox;
+import javadoc.tester.JavadocTester;
+
public class TestEnumConstructor extends JavadocTester {
final ToolBox tb;
@@ -51,7 +53,7 @@
}
@Test
- void test1(Path base) throws Exception {
+ public void test1(Path base) throws Exception {
Path srcDir = base.resolve("src");
createEnum(srcDir);
@@ -72,7 +74,7 @@
}
@Test
- void test2(Path base) throws Exception {
+ public void test2(Path base) throws Exception {
Path srcDir = base.resolve("src");
createEnum(srcDir);
--- a/test/langtools/jdk/javadoc/doclet/testExternalOverridenMethod/TestExternalOverridenMethod.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testExternalOverridenMethod/TestExternalOverridenMethod.java Fri Dec 21 10:38:33 2018 -0800
@@ -28,11 +28,13 @@
* are documented properly. The method should still include "implements" or
* "overrides" documentation even though the method is external.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester TestExternalOverridenMethod
+ * @build javadoc.tester.* TestExternalOverridenMethod
* @run main TestExternalOverridenMethod
*/
+import javadoc.tester.JavadocTester;
+
public class TestExternalOverridenMethod extends JavadocTester {
static final String uri = "http://java.sun.com/j2se/1.4.1/docs/api";
@@ -43,7 +45,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-source","8",
"-sourcepath", testSrc,
@@ -66,7 +68,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-source", "8",
"-html4",
--- a/test/langtools/jdk/javadoc/doclet/testFramesNoFrames/TestFramesNoFrames.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testFramesNoFrames/TestFramesNoFrames.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,13 +25,13 @@
* @test
* @bug 8162353 8164747 8173707 8196202 8204303 8184205
* @summary javadoc should provide a way to disable use of frames
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.javadoc/jdk.javadoc.internal.tool
* @build toolbox.ModuleBuilder toolbox.ToolBox
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestFramesNoFrames
*/
@@ -46,6 +46,8 @@
import toolbox.ModuleBuilder;
import toolbox.ToolBox;
+import javadoc.tester.JavadocTester;
+
public class TestFramesNoFrames extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -156,7 +158,7 @@
}
@Test
- void testClass(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws Exception {
+ public void testClass(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws Exception {
javadoc(base, fKind, oKind, hKind,
gensrcPackages.resolve("p1/P1C1.java").toString());
@@ -166,7 +168,7 @@
}
@Test
- void testClasses(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
+ public void testClasses(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
javadoc(base, fKind, oKind, hKind,
gensrcPackages.resolve("p1/P1C1.java").toString(),
gensrcPackages.resolve("p1/P1C2.java").toString(),
@@ -178,7 +180,7 @@
}
@Test
- void testPackage(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
+ public void testPackage(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
javadoc(base, fKind, oKind, hKind,
"-sourcepath", gensrcPackages.toString(),
"p1");
@@ -189,7 +191,7 @@
}
@Test
- void testPackages(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
+ public void testPackages(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
javadoc(base, fKind, oKind, hKind,
"-sourcepath", gensrcPackages.toString(),
"p1", "p2", "p3");
@@ -202,7 +204,7 @@
}
@Test
- void testModules(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
+ public void testModules(Path base, FrameKind fKind, OverviewKind oKind, HtmlKind hKind) throws IOException {
javadoc(base, fKind, oKind, hKind,
"--module-source-path", gensrcModules.toString(),
"--module", "m1,m2,m3");
--- a/test/langtools/jdk/javadoc/doclet/testGeneratedBy/TestGeneratedBy.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testGeneratedBy/TestGeneratedBy.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,14 @@
* @test
* @bug 8000418 8024288 8196202
* @summary Verify that files use a common Generated By string
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestGeneratedBy
*/
+import javadoc.tester.JavadocTester;
+
public class TestGeneratedBy extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void testTimestamp() {
+ public void testTimestamp() {
javadoc("-d", "out-timestamp",
"--frames",
"-sourcepath", testSrc,
@@ -51,7 +53,7 @@
}
@Test
- void testNoTimestamp() {
+ public void testNoTimestamp() {
javadoc("-d", "out-notimestamp",
"-notimestamp",
"--frames",
--- a/test/langtools/jdk/javadoc/doclet/testGenericMethodLinkTaglet/TestGenericMethodLinkTaglet.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testGenericMethodLinkTaglet/TestGenericMethodLinkTaglet.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,9 +25,9 @@
* @test
* @bug 8188248
* @summary NullPointerException on generic methods
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox builder.ClassBuilder
+ * @build javadoc.tester.* toolbox.ToolBox builder.ClassBuilder
* @run main TestGenericMethodLinkTaglet
*/
@@ -38,6 +38,8 @@
import builder.ClassBuilder.MethodBuilder;
import toolbox.ToolBox;
+import javadoc.tester.JavadocTester;
+
public class TestGenericMethodLinkTaglet extends JavadocTester {
final ToolBox tb;
@@ -52,7 +54,7 @@
}
@Test
- void test(Path base) throws Exception {
+ public void test(Path base) throws Exception {
Path srcDir = base.resolve("src");
createTestClass(srcDir);
--- a/test/langtools/jdk/javadoc/doclet/testGrandParentTypes/TestGrandParentTypes.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testGrandParentTypes/TestGrandParentTypes.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -26,12 +26,14 @@
* @bug 8182108
* @summary Verify that grand parent interface types are correct, and
* various interface related sections are correctly generated.
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestGrandParentTypes
*/
+import javadoc.tester.JavadocTester;
+
public class TestGrandParentTypes extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out-1",
"-package",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testGroupName/TestGroupName.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testGroupName/TestGroupName.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,9 +25,9 @@
* @test
* @bug 8190003 8196201 8196202 8184205
* @summary Special characters in group names should be escaped
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build toolbox.ToolBox JavadocTester
+ * @build toolbox.ToolBox javadoc.tester.*
* @run main TestGroupName
*/
@@ -35,7 +35,8 @@
import java.nio.file.Path;
import java.nio.file.Paths;
-import toolbox.*;
+import javadoc.tester.JavadocTester;
+import toolbox.ToolBox;
public class TestGroupName extends JavadocTester {
--- a/test/langtools/jdk/javadoc/doclet/testGroupOption/TestGroupOption.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testGroupOption/TestGroupOption.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* @summary Test to make sure the -group option works correctly
* with the given pattern usages.
* @author jamieh
- * @library ../lib
- * @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @library ../../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @build javadoc.tester.*
* @run main TestGroupOption
*/
+import javadoc.tester.JavadocTester;
+
public class TestGroupOption extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test1() {
+ public void test1() {
// Make sure the warning is not printed when -group is used correctly.
javadoc("-d", "out-1",
"-sourcepath", testSrc,
@@ -58,7 +60,7 @@
@Test
// Make sure the "Other packages" section is printed and the header for empty section is not.
// Make sure that the headers of group that is defined using patterns are printed.
- void test2() {
+ public void test2() {
javadoc("-d", "out-2",
"--frames",
"-sourcepath", testSrc,
@@ -74,7 +76,7 @@
}
@Test
- void test3() {
+ public void test3() {
// Make sure the warning is printed when -group is not used correctly.
javadoc("-d", "out-3",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testHeadTag/TestHeadTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHeadTag/TestHeadTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,9 +25,9 @@
* @test
* @bug 8203792
* @summary Remove "compatibility" features from Head.java
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox builder.ClassBuilder
+ * @build javadoc.tester.* toolbox.ToolBox builder.ClassBuilder
* @run main TestHeadTag
*/
@@ -39,6 +39,8 @@
import builder.ClassBuilder;
import toolbox.ToolBox;
+import javadoc.tester.JavadocTester;
+
public class TestHeadTag extends JavadocTester {
final ToolBox tb;
@@ -53,7 +55,7 @@
}
@Test
- void test(Path base) throws Exception {
+ public void test(Path base) throws Exception {
Path srcDir = base.resolve("src");
createTestClass(srcDir);
@@ -70,7 +72,7 @@
}
@Test
- void testWithNoTimestamp(Path base) throws Exception {
+ public void testWithNoTimestamp(Path base) throws Exception {
Path srcDir = base.resolve("src");
createTestClass(srcDir);
--- a/test/langtools/jdk/javadoc/doclet/testHeadings/TestHeadings.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHeadings/TestHeadings.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,13 +26,15 @@
* @bug 4905786 6259611 8162363 8196202
* @summary Make sure that headings use the TH tag instead of the TD tag.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @build TestHeadings
* @run main TestHeadings
*/
+import javadoc.tester.JavadocTester;
+
public class TestHeadings extends JavadocTester {
private static final String[][] TEST = {
@@ -58,7 +60,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-use",
--- a/test/langtools/jdk/javadoc/doclet/testHelpFile/TestHelpFile.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHelpFile/TestHelpFile.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -26,12 +26,14 @@
* @bug 7132631
* @summary Make sure that the help file is generated correctly.
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestHelpFile
*/
+import javadoc.tester.JavadocTester;
+
public class TestHelpFile extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
testSrc("TestHelpFile.java"));
--- a/test/langtools/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,15 +26,17 @@
* @bug 4934778 4777599 6553182 8146427 8146475 8175055 8185371
* @summary Make sure that --help, -helpfile and -nohelp options work correctly.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester TestHelpOption
+ * @build javadoc.tester.* TestHelpOption
* @run main TestHelpOption
*/
import java.util.*;
import java.util.stream.*;
+import javadoc.tester.JavadocTester;
+
public class TestHelpOption extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
}
@Test
- void testLineLengths() {
+ public void testLineLengths() {
javadoc("-d", "out1",
"-sourcepath", testSrc,
"-X",
@@ -63,7 +65,7 @@
}
@Test
- void testWithOption() {
+ public void testWithOption() {
javadoc("-d", "out1",
"-sourcepath", testSrc,
"--help",
@@ -74,7 +76,7 @@
}
@Test
- void testWithoutOption() {
+ public void testWithoutOption() {
javadoc("-d", "out2",
"-sourcepath", testSrc,
testSrc("Sample.java"));
@@ -82,7 +84,7 @@
}
@Test
- void testNohelpOption() {
+ public void testNohelpOption() {
javadoc("-d", "out3",
"-sourcepath", testSrc,
"-nohelp",
@@ -92,7 +94,7 @@
}
@Test
- void testHelpfileOption() {
+ public void testHelpfileOption() {
javadoc("-d", "out4",
"-sourcepath", testSrc,
"-helpfile", testSrc("test-help.html"),
@@ -105,7 +107,7 @@
}
@Test
- void testHelpfileReuseOption() {
+ public void testHelpfileReuseOption() {
javadoc("-d", "out5",
"-sourcepath", testSrc,
"-helpfile", testSrc("test-help.html"),
@@ -115,7 +117,7 @@
}
@Test
- void testHelpfileNohelpConflict() {
+ public void testHelpfileNohelpConflict() {
javadoc("-d", "out6",
"-sourcepath", testSrc,
"-helpfile", testSrc("test-help.html"),
--- a/test/langtools/jdk/javadoc/doclet/testHiddenMembers/TestHiddenMembers.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHiddenMembers/TestHiddenMembers.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -27,12 +27,14 @@
* @summary Test to make sure that hidden overriden members are not
* documented as inherited.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestHiddenMembers
*/
+import javadoc.tester.JavadocTester;
+
public class TestHiddenMembers extends JavadocTester {
private static final String[][] NEGATED_TEST = {
@@ -49,7 +51,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
--- a/test/langtools/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,14 @@
* @test
* @bug 8073100 8182765 8196202
* @summary ensure the hidden tag works as intended
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestHiddenTag
*/
+import javadoc.tester.JavadocTester;
+
public class TestHiddenTag extends JavadocTester {
public static void main(String... args) throws Exception {
--- a/test/langtools/jdk/javadoc/doclet/testHref/TestHref.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHref/TestHref.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 4663254 8016328 8025633 8026567 8081854 8182765 8205593
* @summary Verify that spaces do not appear in hrefs and anchors.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestHref
*/
+import javadoc.tester.JavadocTester;
+
public class TestHref extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-Xdoclint:none",
"-d", "out",
"-source", "8",
@@ -83,7 +85,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-Xdoclint:none",
"-d", "out-html4",
"-source", "8",
--- a/test/langtools/jdk/javadoc/doclet/testHrefInDocComment/TestHrefInDocComment.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHrefInDocComment/TestHrefInDocComment.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -27,12 +27,14 @@
* @summary Determine if Hrefs are processed properly when they
* appear in doc comments.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestHrefInDocComment
*/
+import javadoc.tester.JavadocTester;
+
public class TestHrefInDocComment extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc, "pkg");
checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/testHtmlComments/TestHtmlComments.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlComments/TestHtmlComments.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -27,12 +27,14 @@
* @summary The field detail comment should not show up in the output if there
* are no fields to document.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestHtmlComments
*/
+import javadoc.tester.JavadocTester;
+
public class TestHtmlComments extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void run() {
+ public void run() {
javadoc("-d", "out",
"-sourcepath", testSrc,
testSrc("C.java"));
--- a/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,9 +26,9 @@
* @bug 6786690 6820360 8025633 8026567 8175200 8183511 8186332 8074407 8182765
* @summary This test verifies the nesting of definition list tags.
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestHtmlDefinitionListTag
*/
@@ -36,6 +36,8 @@
import java.util.Arrays;
import java.util.List;
+import javadoc.tester.JavadocTester;
+
public class TestHtmlDefinitionListTag extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -44,7 +46,7 @@
}
@Test
- void test_Comment_Deprecated() {
+ public void test_Comment_Deprecated() {
// tester.run(ARGS1, TEST_ALL, NEGATED_TEST_NO_C5);
// tester.runTestsOnHTML(NO_TEST, NEGATED_TEST_C5);
// tester.runTestsOnHTML(TEST_CMNT_DEPR, NO_TEST);
@@ -58,7 +60,7 @@
}
@Test
- void test_Comment_Deprecated_html4() {
+ public void test_Comment_Deprecated_html4() {
javadoc("-Xdoclint:none",
"-d", "out-1-html4",
"-html4",
@@ -69,7 +71,7 @@
}
@Test
- void test_NoComment_Deprecated() {
+ public void test_NoComment_Deprecated() {
// tester.run(ARGS2, TEST_ALL, NEGATED_TEST_NO_C5);
// tester.runTestsOnHTML(NO_TEST, NEGATED_TEST_C5);
// tester.runTestsOnHTML(NO_TEST, TEST_CMNT_DEPR);
@@ -84,7 +86,7 @@
}
@Test
- void test_NoComment_Deprecated_html4() {
+ public void test_NoComment_Deprecated_html4() {
javadoc("-Xdoclint:none",
"-d", "out-2-html4",
"-html4",
@@ -96,7 +98,7 @@
}
@Test
- void test_Comment_NoDeprecated() {
+ public void test_Comment_NoDeprecated() {
// tester.run(ARGS3, TEST_ALL, NEGATED_TEST_NO_C5);
// tester.runTestsOnHTML(TEST_NODEPR, TEST_NOCMNT_NODEPR);
javadoc("-Xdoclint:none",
@@ -111,7 +113,7 @@
}
@Test
- void test_Comment_NoDeprecated_html4() {
+ public void test_Comment_NoDeprecated_html4() {
javadoc("-Xdoclint:none",
"-d", "out-3-html4",
"-html4",
@@ -124,7 +126,7 @@
}
@Test
- void testNoCommentNoDeprecated() {
+ public void testNoCommentNoDeprecated() {
// tester.run(ARGS4, TEST_ALL, NEGATED_TEST_NO_C5);
// tester.runTestsOnHTML(TEST_NOCMNT_NODEPR, TEST_CMNT_DEPR);
javadoc("-Xdoclint:none",
@@ -140,7 +142,7 @@
}
@Test
- void testNoCommentNoDeprecated_html4() {
+ public void testNoCommentNoDeprecated_html4() {
javadoc("-Xdoclint:none",
"-d", "out-4-html4",
"-html4",
--- a/test/langtools/jdk/javadoc/doclet/testHtmlDocument/TestHtmlDocument.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlDocument/TestHtmlDocument.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, 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
@@ -25,11 +25,11 @@
* @test
* @bug 6851834
* @summary This test verifies the HTML document generation for javadoc output.
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.markup
* jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.util
* jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @author Bhavesh Patel
* @run main TestHtmlDocument
*/
@@ -43,6 +43,8 @@
* The class reads each file, complete with newlines, into a string to easily
* compare the existing markup with the generated markup.
*/
+import javadoc.tester.JavadocTester;
+
public class TestHtmlDocument extends JavadocTester {
// Entry point
@@ -52,7 +54,7 @@
}
@Test
- void test() {
+ public void test() {
checking("markup");
// Check whether the generated markup is same as the existing markup.
String expected = readFile(testSrc, "testMarkup.html").replace("\n", NL);
--- a/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLankmarkRegions.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLankmarkRegions.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,12 @@
* @test
* @bug 8210047
* @summary some pages contains content outside of landmark region
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules
* jdk.javadoc/jdk.javadoc.internal.tool
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestHtmlLankmarkRegions
*/
@@ -42,6 +42,8 @@
import toolbox.ModuleBuilder;
import toolbox.ToolBox;
+import javadoc.tester.JavadocTester;
+
public class TestHtmlLankmarkRegions extends JavadocTester {
final ToolBox tb;
@@ -56,7 +58,7 @@
}
@Test
- void testModules(Path base) throws Exception {
+ public void testModules(Path base) throws Exception {
Path srcDir = base.resolve("src");
createModules(srcDir);
@@ -100,7 +102,7 @@
}
@Test
- void testModulesHtml4(Path base) throws Exception {
+ public void testModulesHtml4(Path base) throws Exception {
Path srcDir = base.resolve("src");
createModules(srcDir);
@@ -136,7 +138,7 @@
}
@Test
- void testPackages(Path base) throws Exception {
+ public void testPackages(Path base) throws Exception {
Path srcDir = base.resolve("src");
createPackages(srcDir);
@@ -170,7 +172,7 @@
}
@Test
- void testPackagesHtml4(Path base) throws Exception {
+ public void testPackagesHtml4(Path base) throws Exception {
Path srcDir = base.resolve("src");
createPackages(srcDir);
--- a/test/langtools/jdk/javadoc/doclet/testHtmlStrongTag/TestHtmlStrongTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlStrongTag/TestHtmlStrongTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, 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
@@ -26,12 +26,14 @@
* @bug 6786028 8026567
* @summary This test verifies the use of <strong> HTML tag instead of <B> by Javadoc std doclet.
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestHtmlStrongTag
*/
+import javadoc.tester.JavadocTester;
+
public class TestHtmlStrongTag extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out-1",
"-sourcepath", testSrc,
"pkg1");
@@ -58,7 +60,7 @@
}
@Test
- void test2() {
+ public void test2() {
javadoc("-d", "out-2",
"-sourcepath", testSrc,
"pkg2");
--- a/test/langtools/jdk/javadoc/doclet/testHtmlTableStyles/TestHtmlTableStyles.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlTableStyles/TestHtmlTableStyles.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 8008164 8169819 8183037 8182765 8196202 8184205
* @summary Test styles on HTML tables generated by javadoc.
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestHtmlTableStyles
*/
+import javadoc.tester.JavadocTester;
+
public class TestHtmlTableStyles extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-use",
@@ -77,7 +79,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 6786688 8008164 8162363 8169819 8183037 8182765 8184205
* @summary HTML tables should have table summary, caption and table headers.
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestHtmlTableTags
*/
+import javadoc.tester.JavadocTester;
+
public class TestHtmlTableTags extends JavadocTester {
//Javadoc arguments.
@@ -46,7 +48,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-use",
@@ -60,7 +62,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,14 +26,16 @@
* @bug 6786682 4649116 8182765
* @summary This test verifies the use of lang attribute by <HTML>.
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestHtmlTag
*/
import java.util.Locale;
+import javadoc.tester.JavadocTester;
+
public class TestHtmlTag extends JavadocTester {
private static final String defaultLanguage = Locale.getDefault().getLanguage();
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
tester.runTests();
}
@Test
- void test_default() {
+ public void test_default() {
javadoc("-locale", defaultLanguage,
"-d", "out-default",
"-sourcepath", testSrc,
@@ -60,7 +62,7 @@
}
@Test
- void test_ja() {
+ public void test_ja() {
// TODO: why does this test need/use pkg2; why can't it use pkg1
// like the other two tests, so that we can share the check methods?
javadoc("-locale", "ja",
@@ -80,7 +82,7 @@
}
@Test
- void test_en_US() {
+ public void test_en_US() {
javadoc("-locale", "en_US",
"-d", "out-en_US",
"-sourcepath", testSrc,
@@ -98,7 +100,7 @@
}
@Test
- void test_other() {
+ public void test_other() {
javadoc("-locale", "en_US",
"-d", "out-other",
"-sourcepath", testSrc,
@@ -195,7 +197,7 @@
}
@Test
- void test_other_html4() {
+ public void test_other_html4() {
javadoc("-locale", "en_US",
"-d", "out-other-html4",
"-html4",
--- a/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* 8202624 8210047 8184205
* @summary Test the version of HTML generated by the javadoc tool.
* @author bpatel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestHtmlVersion
*/
+import javadoc.tester.JavadocTester;
+
public class TestHtmlVersion extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out-1",
"-private",
"-linksource",
@@ -56,7 +58,7 @@
}
@Test
- void test2() {
+ public void test2() {
javadoc("-d", "out-2",
"-html4",
"-private",
@@ -72,7 +74,7 @@
}
@Test
- void test3() {
+ public void test3() {
javadoc("-d", "out-3",
"-html4",
"-private",
@@ -88,7 +90,7 @@
}
@Test
- void test4() {
+ public void test4() {
javadoc("-d", "out-4",
"-private",
"-linksource",
--- a/test/langtools/jdk/javadoc/doclet/testHtmlWarning/TestHtmlWarning.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlWarning/TestHtmlWarning.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,9 +25,9 @@
* @test
* @bug 8194955 8182765
* @summary Warn when default HTML version is used.
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestHtmlWarning
*/
@@ -36,6 +36,8 @@
import java.nio.file.Paths;
import java.util.List;
+import javadoc.tester.JavadocTester;
+
public class TestHtmlWarning extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -54,7 +56,7 @@
+ "in your comments are valid in HTML5, and remove the -html4 option.";
@Test
- void testHtml4() {
+ public void testHtml4() {
javadoc("-d", "out-4",
"-html4",
testFile.toString());
@@ -64,7 +66,7 @@
}
@Test
- void testHtml5() {
+ public void testHtml5() {
javadoc("-d", "out-5",
"-html5",
testFile.toString());
@@ -74,7 +76,7 @@
}
@Test
- void testDefault() {
+ public void testDefault() {
javadoc("-d", "out-default",
testFile.toString());
checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/testIOException/TestIOException.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testIOException/TestIOException.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -25,15 +25,17 @@
* @test
* @bug 8164130
* @summary test IOException handling
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestIOException
*/
import java.io.File;
import java.io.FileWriter;
+import javadoc.tester.JavadocTester;
+
public class TestIOException extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
}
@Test
- void testReadOnlyDirectory() {
+ public void testReadOnlyDirectory() {
File outDir = new File("out1");
if (!outDir.mkdir()) {
throw new Error("Cannot create directory");
@@ -66,7 +68,7 @@
}
@Test
- void testReadOnlyFile() throws Exception {
+ public void testReadOnlyFile() throws Exception {
File outDir = new File("out2");
if (!outDir.mkdir()) {
throw new Error("Cannot create directory");
@@ -95,7 +97,7 @@
}
@Test
- void testReadOnlySubdirectory() throws Exception {
+ public void testReadOnlySubdirectory() throws Exception {
// init source file
File srcDir = new File("src4");
File src_p = new File(srcDir, "p");
@@ -133,7 +135,7 @@
}
@Test
- void testReadOnlyDocFilesDir() throws Exception {
+ public void testReadOnlyDocFilesDir() throws Exception {
// init source files
File srcDir = new File("src4");
File src_p = new File(srcDir, "p");
--- a/test/langtools/jdk/javadoc/doclet/testIncluded/TestIncluded.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testIncluded/TestIncluded.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -25,12 +25,14 @@
* @test
* @bug 8149842
* @summary Verify that non included classes are not inspected.
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestIncluded
*/
+import javadoc.tester.JavadocTester;
+
public class TestIncluded extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -44,7 +46,7 @@
* an error, if doc comments are inspected.
*/
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-Xdoclint:all",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testIndentation/TestIndentation.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testIndentation/TestIndentation.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -25,12 +25,14 @@
* @test
* @bug 8011288 8062647 8175200
* @summary Erratic/inconsistent indentation of signatures
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestIndentation
*/
+import javadoc.tester.JavadocTester;
+
public class TestIndentation extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"p");
--- a/test/langtools/jdk/javadoc/doclet/testIndex/TestIndex.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testIndex/TestIndex.java Fri Dec 21 10:38:33 2018 -0800
@@ -28,12 +28,14 @@
* Also test that index-all.html has the appropriate output.
* Test for unnamed package in index.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestIndex
*/
+import javadoc.tester.JavadocTester;
+
public class TestIndex extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"--frames",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testIndexFiles/TestIndexFiles.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testIndexFiles/TestIndexFiles.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 8170825 8196027
* @summary Perform tests on index files generated by javadoc.
* @author bpatel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestIndexFiles
*/
+import javadoc.tester.JavadocTester;
+
public class TestIndexFiles extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void testIndexFiles() {
+ public void testIndexFiles() {
javadoc("-d", "out", "-splitindex", "-Xdoclint:none", "-sourcepath", testSrc,
"-use", "pkg");
checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/testIndexInPackageFiles/TestIndexInPackageFiles.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testIndexInPackageFiles/TestIndexInPackageFiles.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,14 +25,16 @@
* @test
* @bug 8213957 8213958
* @summary Test use of at-index in package-iinfo and doc-files
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build toolbox.ToolBox JavadocTester
+ * @build toolbox.ToolBox javadoc.tester.*
* @run main TestIndexInPackageFiles
*/
import java.io.IOException;
import java.nio.file.Path;
+
+import javadoc.tester.JavadocTester;
import toolbox.ToolBox;
public class TestIndexInPackageFiles extends JavadocTester {
--- a/test/langtools/jdk/javadoc/doclet/testIndexTaglet/TestIndexTaglet.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testIndexTaglet/TestIndexTaglet.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,9 +25,9 @@
* @test
* @bug 8202462
* @summary {@index} may cause duplicate labels
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox builder.ClassBuilder
+ * @build javadoc.tester.* toolbox.ToolBox builder.ClassBuilder
* @run main TestIndexTaglet
*/
@@ -39,6 +39,8 @@
import builder.ClassBuilder.MethodBuilder;
import toolbox.ToolBox;
+import javadoc.tester.JavadocTester;
+
public class TestIndexTaglet extends JavadocTester {
final ToolBox tb;
@@ -53,7 +55,7 @@
}
@Test
- void test(Path base) throws Exception {
+ public void test(Path base) throws Exception {
Path srcDir = base.resolve("src");
Path outDir = base.resolve("out");
@@ -83,7 +85,7 @@
}
@Test
- void testIndexWithinATag(Path base) throws Exception {
+ public void testIndexWithinATag(Path base) throws Exception {
Path srcDir = base.resolve("src");
Path outDir = base.resolve("out");
--- a/test/langtools/jdk/javadoc/doclet/testIndexWithModules/TestIndexWithModules.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testIndexWithModules/TestIndexWithModules.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,12 @@
* @test
* @bug 8190875
* @summary modules not listed in overview/index page
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules
* jdk.javadoc/jdk.javadoc.internal.tool
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestIndexWithModules
*/
@@ -42,6 +42,8 @@
import toolbox.ToolBox;
+import javadoc.tester.JavadocTester;
+
public class TestIndexWithModules extends JavadocTester {
final ToolBox tb;
@@ -59,7 +61,7 @@
}
@Test
- void testIndexWithOverviewPath(Path base) throws Exception {
+ public void testIndexWithOverviewPath(Path base) throws Exception {
Path out = base.resolve("out");
tb.writeFile("overview.html",
@@ -80,7 +82,7 @@
//multiple modules with frames
@Test
- void testIndexWithMultipleModules1(Path base) throws Exception {
+ public void testIndexWithMultipleModules1(Path base) throws Exception {
Path out = base.resolve("out");
javadoc("-d", out.toString(),
"--module-source-path", src.toString(),
@@ -100,7 +102,7 @@
//multiple modules with out frames
@Test
- void testIndexWithMultipleModules2(Path base) throws Exception {
+ public void testIndexWithMultipleModules2(Path base) throws Exception {
Path out = base.resolve("out");
javadoc("-d", out.toString(),
"--module-source-path", src.toString(),
@@ -116,7 +118,7 @@
}
@Test
- void testIndexWithSingleModule(Path base) throws Exception {
+ public void testIndexWithSingleModule(Path base) throws Exception {
Path out = base.resolve("out");
javadoc("-d", out.toString(),
"--module-source-path", src.toString(),
@@ -129,7 +131,7 @@
//no modules and multiple packages
@Test
- void testIndexWithNoModules1(Path base) throws Exception{
+ public void testIndexWithNoModules1(Path base) throws Exception{
Path out = base.resolve("out");
new ClassBuilder(tb, "P1.A1")
.setModifiers("public","class")
@@ -154,7 +156,7 @@
//no modules and one package
@Test
- void testIndexWithNoModules2(Path base) throws Exception{
+ public void testIndexWithNoModules2(Path base) throws Exception{
Path out = base.resolve("out");
new ClassBuilder(tb, "P1.A1")
.setModifiers("public","class")
--- a/test/langtools/jdk/javadoc/doclet/testInlineLinkLabel/TestInlineLinkLabel.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testInlineLinkLabel/TestInlineLinkLabel.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 4524136
* @summary Test to make sure label is used for inline links.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestInlineLinkLabel
*/
+import javadoc.tester.JavadocTester;
+
public class TestInlineLinkLabel extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
--- a/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java Fri Dec 21 10:38:33 2018 -0800
@@ -30,9 +30,9 @@
* If A implements I and B extends A, B should be in the list of
* implementing classes in the documentation for I.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestInterface
*/
@@ -50,6 +50,8 @@
and Child<CE>
*/
+import javadoc.tester.JavadocTester;
+
public class TestInterface extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -58,7 +60,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
@@ -156,7 +158,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
@@ -199,7 +201,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out-1",
"-sourcepath", testSrc,
"pkg1");
@@ -215,7 +217,7 @@
}
@Test
- void test1_html4() {
+ public void test1_html4() {
javadoc("-d", "out-1-html4",
"-html4",
"-sourcepath", testSrc,
@@ -232,7 +234,7 @@
}
@Test
- void test2() {
+ public void test2() {
javadoc("-d", "out-2",
"-sourcepath", testSrc,
"pkg2");
--- a/test/langtools/jdk/javadoc/doclet/testJavaFX/TestFxProperties.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testJavaFX/TestFxProperties.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,9 +26,9 @@
* @bug 8025091
* @summary Tests the basic selection of FX related property methods, fields,
* setters and getters, by executing this test in the strict mode.
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester propgen.PropGen
+ * @build javadoc.tester.* propgen.PropGen
* @run main TestFxProperties
*/
@@ -36,6 +36,8 @@
import java.nio.file.Path;
import java.nio.file.Paths;
+import javadoc.tester.JavadocTester;
+
public class TestFxProperties extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -59,7 +61,7 @@
}
@Test
- void test1() throws Exception {
+ public void test1() throws Exception {
Path srcdir = Paths.get("src-propgen");
Files.createDirectory(srcdir);
new propgen.PropGen(srcdir).run();
--- a/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java Fri Dec 21 10:38:33 2018 -0800
@@ -28,12 +28,14 @@
* 8203791 8184205
* @summary Test of the JavaFX doclet features.
* @author jvalenta
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestJavaFX
*/
+import javadoc.tester.JavadocTester;
+
public class TestJavaFX extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out1",
"-sourcepath", testSrc,
"-javafx",
@@ -175,7 +177,7 @@
}
@Test
- void test1_html4() {
+ public void test1_html4() {
javadoc("-d", "out1-html4",
"-html4",
"-sourcepath", testSrc,
@@ -203,7 +205,7 @@
* are treated correctly.
*/
@Test
- void test2() {
+ public void test2() {
javadoc("-d", "out2a",
"-sourcepath", testSrc,
"-javafx",
@@ -262,7 +264,7 @@
}
@Test
- void test2_html4() {
+ public void test2_html4() {
javadoc("-d", "out2a-html4",
"-html4",
"-sourcepath", testSrc,
@@ -313,7 +315,7 @@
* are treated just like any other java method.
*/
@Test
- void test3() {
+ public void test3() {
javadoc("-d", "out2b",
"-sourcepath", testSrc,
"-package",
@@ -355,7 +357,7 @@
}
@Test
- void test3_html4() {
+ public void test3_html4() {
javadoc("-d", "out2b-html4",
"-html4",
"-sourcepath", testSrc,
@@ -402,7 +404,7 @@
* --javafx flag.
*/
@Test
- void test4() {
+ public void test4() {
javadoc("-d", "out4",
"--javafx",
"--disable-javafx-strict-checks",
--- a/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFxMode.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFxMode.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,9 +25,9 @@
* @test
* @bug 8208531
* @summary -javafx mode should be on by default when JavaFX is available.
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestJavaFxMode
*/
@@ -36,6 +36,8 @@
import java.nio.file.Path;
import java.nio.file.Paths;
+import javadoc.tester.JavadocTester;
+
public class TestJavaFxMode extends JavadocTester {
final ToolBox tb;
@@ -63,7 +65,7 @@
}
@Test
- void test(Path base) throws Exception {
+ public void test(Path base) throws Exception {
Path src = base.resolve("src");
createTestClass(src);
Path outDir = base.resolve("out");
--- a/test/langtools/jdk/javadoc/doclet/testJavascript/TestJavascript.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testJavascript/TestJavascript.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 4665566 4855876 7025314 8012375 8015997 8016328 8024756 8148985 8151921 8151743 8196202
* @summary Verify that the output has the right javascript.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestJavascript
*/
+import javadoc.tester.JavadocTester;
+
public class TestJavascript extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"--frames",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testLambdaFeature/TestLambdaFeature.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testLambdaFeature/TestLambdaFeature.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -27,9 +27,9 @@
* @summary Make sure that the lambda feature changes work fine in
* javadoc.
* @author bpatel
- * @library ../lib/
+ * @library ../../lib/
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester TestLambdaFeature
+ * @build javadoc.tester.* TestLambdaFeature
* @run main TestLambdaFeature
*/
@@ -39,6 +39,8 @@
* removed [ 8022738 ]
*/
+import javadoc.tester.JavadocTester;
+
public class TestLambdaFeature extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -47,7 +49,7 @@
}
@Test
- void testDefault() {
+ public void testDefault() {
javadoc("-d", "out-default",
"-sourcepath", testSrc,
"pkg", "pkg1");
@@ -101,7 +103,7 @@
}
@Test
- void testSource7() {
+ public void testSource7() {
javadoc("-d", "out-7",
"-sourcepath", testSrc,
"-source", "1.7",
--- a/test/langtools/jdk/javadoc/doclet/testLeadingSpaces/LeadingSpaces.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testLeadingSpaces/LeadingSpaces.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, 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
@@ -29,12 +29,14 @@
* begin their comment without a leading star without leading
* spaces stripped
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main LeadingSpaces
*/
+import javadoc.tester.JavadocTester;
+
public class LeadingSpaces extends JavadocTester {
/**
* The entry point of the test.
@@ -47,7 +49,7 @@
}
@Test
- void testLeadingSpaces() {
+ public void testLeadingSpaces() {
javadoc("-d", "out", "-sourcepath", testSrc,
testSrc("LeadingSpaces.java"));
checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/testLegacyTaglet/TestLegacyTaglet.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testLegacyTaglet/TestLegacyTaglet.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -27,12 +27,14 @@
* @summary Test to ensure that the refactored version of the standard
* doclet still works with Taglets that implement the 1.4.0 interface.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester ToDoTaglet UnderlineTaglet Check
+ * @build javadoc.tester.* ToDoTaglet UnderlineTaglet Check
* @run main TestLegacyTaglet
*/
+import javadoc.tester.JavadocTester;
+
public class TestLegacyTaglet extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-tagletpath", System.getProperty("test.classes", "."),
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestBadLinkOption.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestBadLinkOption.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -26,12 +26,14 @@
* @bug 4625883 8180019
* @summary Make sure that bad -link arguments trigger errors.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestBadLinkOption
*/
+import javadoc.tester.JavadocTester;
+
public class TestBadLinkOption extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
String out = "out";
javadoc("-d", out,
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,14 +27,16 @@
* @summary Test to make sure that -link and -linkoffline link to
* right files, and URLs with and without trailing slash are accepted.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestLinkOption
*/
import java.io.File;
+import javadoc.tester.JavadocTester;
+
public class TestLinkOption extends JavadocTester {
/**
* The entry point of the test.
@@ -50,7 +52,7 @@
// it generates. Therefore we run everything serially in a single @Test
// method and not in independent @Test methods.
@Test
- void test() {
+ public void test() {
String mylib = "mylib";
String[] javacArgs = {
"-d", mylib, testSrc + "/extra/StringBuilder.java"
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithModule.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithModule.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,12 @@
* @test
* @bug 8205593
* @summary Javadoc -link makes broken links if module name matches package name
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules
* jdk.javadoc/jdk.javadoc.internal.tool
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestLinkOptionWithModule
*/
@@ -43,6 +43,8 @@
import toolbox.ToolBox;
+import javadoc.tester.JavadocTester;
+
public class TestLinkOptionWithModule extends JavadocTester {
final ToolBox tb;
@@ -60,7 +62,7 @@
}
@Test
- void testModuleLinkedToModule(Path base) throws Exception {
+ public void testModuleLinkedToModule(Path base) throws Exception {
Path out1 = base.resolve("out1a"), out2 = base.resolve("out1b");
javadoc("-d", out1.toString(),
@@ -79,7 +81,7 @@
}
@Test
- void testPackageLinkedToPackage(Path base) throws Exception {
+ public void testPackageLinkedToPackage(Path base) throws Exception {
Path out1 = base.resolve("out2a"), out2 = base.resolve("out2b");
javadoc("-d", out1.toString(),
@@ -98,7 +100,7 @@
}
@Test
- void testModuleLinkedToPackage(Path base) throws Exception {
+ public void testModuleLinkedToPackage(Path base) throws Exception {
Path out1 = base.resolve("out3a"), out2 = base.resolve("out3b");
javadoc("-d", out1.toString(),
@@ -117,7 +119,7 @@
}
@Test
- void testPackageLinkedToModule(Path base) throws Exception {
+ public void testPackageLinkedToModule(Path base) throws Exception {
Path out1 = base.resolve("out4a"), out2 = base.resolve("out4b");
javadoc("-d", out1.toString(),
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestNewLineInLink.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestNewLineInLink.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -27,12 +27,14 @@
* @summary Make sure that a new line may act as a separator between
* link and label.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestNewLineInLink
*/
+import javadoc.tester.JavadocTester;
+
public class TestNewLineInLink extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-source", "8",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,12 @@
* @test
* @bug 8190312
* @summary test redirected URLs for -link
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.javadoc/jdk.javadoc.internal.api
* jdk.javadoc/jdk.javadoc.internal.tool
- * @build toolbox.ToolBox toolbox.JavacTask JavadocTester
+ * @build toolbox.ToolBox toolbox.JavacTask javadoc.tester.*
* @run main TestRedirectLinks
*/
@@ -59,10 +59,10 @@
import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsServer;
+import javadoc.tester.JavadocTester;
import toolbox.JavacTask;
import toolbox.ToolBox;
-
public class TestRedirectLinks extends JavadocTester {
/**
* The entry point of the test.
@@ -103,6 +103,7 @@
out.println("Header: " + httpConn.getHeaderFieldKey(n) + ": " + httpConn.getHeaderField(n));
n++;
}
+ httpConn.disconnect();
}
} catch (Exception e) {
out.println("Exception occurred: " + e);
--- a/test/langtools/jdk/javadoc/doclet/testLinkTaglet/TestLinkTaglet.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testLinkTaglet/TestLinkTaglet.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* @summary Make sure that you can link from one member to another using
* non-qualified name, furthermore, ensure the right one is linked.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestLinkTaglet
*/
+import javadoc.tester.JavadocTester;
+
public class TestLinkTaglet extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-Xdoclint:none",
"-d", "out",
"-sourcepath", testSrc,
@@ -75,7 +77,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-Xdoclint:none",
"-d", "out-html4",
"-html4",
--- a/test/langtools/jdk/javadoc/doclet/testLinkToSerialForm/TestLinkToSerialForm.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testLinkToSerialForm/TestLinkToSerialForm.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* @summary Test to make sure that there is a link with a proper anchor
* from a serializable class to serialized-form.html.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestLinkToSerialForm
*/
+import javadoc.tester.JavadocTester;
+
public class TestLinkToSerialForm extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
@@ -54,7 +56,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testLinksWithNoDeprecatedOption/TestLinksWithNoDeprecatedOption.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testLinksWithNoDeprecatedOption/TestLinksWithNoDeprecatedOption.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,12 @@
* @test
* @bug 8202627
* @summary javadoc generates broken links to deprecated items when -nodeprecated is used
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules
* jdk.javadoc/jdk.javadoc.internal.tool
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestLinksWithNoDeprecatedOption
*/
@@ -43,6 +43,8 @@
import builder.ClassBuilder.MethodBuilder;
import toolbox.ToolBox;
+import javadoc.tester.JavadocTester;
+
public class TestLinksWithNoDeprecatedOption extends JavadocTester {
final ToolBox tb;
@@ -57,7 +59,7 @@
}
@Test
- void test(Path base) throws Exception {
+ public void test(Path base) throws Exception {
Path srcDir = base.resolve("src");
createTestClass(base, srcDir);
--- a/test/langtools/jdk/javadoc/doclet/testLiteralCodeInPre/TestLiteralCodeInPre.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testLiteralCodeInPre/TestLiteralCodeInPre.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -25,12 +25,14 @@
* @test
* @bug 8002387 8014636 8078320 8175200 8186332
* @summary Improve rendered HTML formatting for {@code}
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestLiteralCodeInPre
*/
+import javadoc.tester.JavadocTester;
+
public class TestLiteralCodeInPre extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-Xdoclint:none",
--- a/test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java Fri Dec 21 10:38:33 2018 -0800
@@ -28,12 +28,14 @@
* @summary Test to make sure that members are inherited properly in the Javadoc.
* Verify that inheritance labels are correct.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestMemberInheritance
*/
+import javadoc.tester.JavadocTester;
+
public class TestMemberInheritance extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg", "diamond", "inheritDist", "pkg1");
@@ -105,7 +107,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java Fri Dec 21 10:38:33 2018 -0800
@@ -28,12 +28,14 @@
* type than the method in the child class. Make sure the
* documentation is inherited but the return type isn't.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestMemberSummary
*/
+import javadoc.tester.JavadocTester;
+
public class TestMemberSummary extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-private",
"-sourcepath", testSrc,
@@ -76,7 +78,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-private",
--- a/test/langtools/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 8002304 8024096 8193671 8196201 8203791 8184205
* @summary Test for various method type tabs in the method summary table
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestMethodTypes
*/
+import javadoc.tester.JavadocTester;
+
public class TestMethodTypes extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg1");
--- a/test/langtools/jdk/javadoc/doclet/testMissingType/TestMissingType.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testMissingType/TestMissingType.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -25,12 +25,14 @@
* @test
* @bug 8173804
* @summary make sure doclet can handle missing types
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestMissingType
*/
+import javadoc.tester.JavadocTester;
+
public class TestMissingType extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-use",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testModifierEx/TestModifierEx.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testModifierEx/TestModifierEx.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, 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
@@ -24,12 +24,14 @@
/*
* @test
* @summary Ensure the modifiers are correct
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestModifierEx
*/
+import javadoc.tester.JavadocTester;
+
public class TestModifierEx extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -38,7 +40,7 @@
}
@Test
- void test1(){
+ public void test1(){
javadoc("-d", "out-1",
"-sourcepath", testSrc,
"-package", "pkg1");
--- a/test/langtools/jdk/javadoc/doclet/testModuleDirs/TestModuleDirs.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testModuleDirs/TestModuleDirs.java Fri Dec 21 10:38:33 2018 -0800
@@ -30,8 +30,8 @@
* jdk.javadoc/jdk.javadoc.internal.tool
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
- * @library ../lib /tools/lib
- * @build toolbox.ToolBox toolbox.ModuleBuilder JavadocTester
+ * @library ../../lib /tools/lib
+ * @build toolbox.ToolBox toolbox.ModuleBuilder javadoc.tester.*
* @run main TestModuleDirs
*/
@@ -39,6 +39,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
+import javadoc.tester.JavadocTester;
import toolbox.ModuleBuilder;
import toolbox.ToolBox;
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestEmptyModule.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestEmptyModule.java Fri Dec 21 10:38:33 2018 -0800
@@ -29,17 +29,18 @@
* jdk.javadoc/jdk.javadoc.internal.tool
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
- * @library ../lib /tools/lib
- * @build toolbox.ToolBox toolbox.ModuleBuilder JavadocTester
+ * @library ../../lib /tools/lib
+ * @build toolbox.ToolBox toolbox.ModuleBuilder javadoc.tester.*
* @run main TestEmptyModule
*/
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import javadoc.tester.JavadocTester;
import toolbox.ModuleBuilder;
import toolbox.ToolBox;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
public class TestEmptyModule extends JavadocTester {
public final ToolBox tb;
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestIndirectExportsOpens.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestIndirectExportsOpens.java Fri Dec 21 10:38:33 2018 -0800
@@ -29,15 +29,17 @@
* jdk.javadoc/jdk.javadoc.internal.tool
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
- * @library ../lib /tools/lib
- * @build toolbox.ToolBox toolbox.ModuleBuilder JavadocTester
+ * @library ../../lib /tools/lib
+ * @build toolbox.ToolBox toolbox.ModuleBuilder javadoc.tester.*
* @run main TestIndirectExportsOpens
*/
import java.nio.file.Path;
import java.nio.file.Paths;
-import toolbox.*;
+import javadoc.tester.JavadocTester;
+import toolbox.ModuleBuilder;
+import toolbox.ToolBox;
public class TestIndirectExportsOpens extends JavadocTester {
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,11 +25,11 @@
* @test
* @bug 8178070 8196201 8184205
* @summary Test packages table in module summary pages
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
* jdk.javadoc/jdk.javadoc.internal.tool
- * @build toolbox.ModuleBuilder toolbox.ToolBox JavadocTester
+ * @build toolbox.ModuleBuilder toolbox.ToolBox javadoc.tester.*
* @run main TestModulePackages
*/
@@ -38,6 +38,7 @@
import java.nio.file.Paths;
import java.util.Set;
+import javadoc.tester.JavadocTester;
import toolbox.ModuleBuilder;
import toolbox.ToolBox;
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServices.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServices.java Fri Dec 21 10:38:33 2018 -0800
@@ -29,8 +29,8 @@
* jdk.javadoc/jdk.javadoc.internal.tool
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
- * @library ../lib /tools/lib
- * @build toolbox.ToolBox toolbox.ModuleBuilder JavadocTester
+ * @library ../../lib /tools/lib
+ * @build toolbox.ToolBox toolbox.ModuleBuilder javadoc.tester.*
* @run main TestModuleServices
*/
@@ -38,7 +38,9 @@
import java.nio.file.Path;
import java.nio.file.Paths;
-import toolbox.*;
+import javadoc.tester.JavadocTester;
+import toolbox.ModuleBuilder;
+import toolbox.ToolBox;
public class TestModuleServices extends JavadocTester {
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServicesLink.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServicesLink.java Fri Dec 21 10:38:33 2018 -0800
@@ -29,15 +29,17 @@
* jdk.compiler/com.sun.tools.javac.main
* jdk.javadoc/jdk.javadoc.internal.api
* jdk.javadoc/jdk.javadoc.internal.tool
- * @library ../lib /tools/lib
- * @build toolbox.ToolBox toolbox.ModuleBuilder JavadocTester
+ * @library ../../lib /tools/lib
+ * @build toolbox.ToolBox toolbox.ModuleBuilder javadoc.tester.*
* @run main TestModuleServicesLink
*/
import java.nio.file.Path;
import java.nio.file.Paths;
-import toolbox.*;
+import javadoc.tester.JavadocTester;
+import toolbox.ModuleBuilder;
+import toolbox.ToolBox;
public class TestModuleServicesLink extends JavadocTester {
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java Fri Dec 21 10:38:33 2018 -0800
@@ -30,11 +30,13 @@
8184205
* @summary Test modules support in javadoc.
* @author bpatel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestModules
*/
+import javadoc.tester.JavadocTester;
+
public class TestModules extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -46,7 +48,7 @@
* Test generated module pages for HTML 4.
*/
@Test
- void testHtml4() {
+ public void testHtml4() {
javadoc("-d", "out",
"-html4",
"-use",
@@ -73,7 +75,7 @@
* Test generated module pages for HTML 5.
*/
@Test
- void testHtml5() {
+ public void testHtml5() {
javadoc("-d", "out-html5",
"-use",
"-Xdoclint:none",
@@ -99,7 +101,7 @@
* Test generated module pages for HTML 4 with -nocomment option.
*/
@Test
- void testHtml4NoComment() {
+ public void testHtml4NoComment() {
javadoc("-d", "out-nocomment",
"-html4",
"-nocomment",
@@ -122,7 +124,7 @@
* Test generated module pages for HTML 5 with -nocomment option.
*/
@Test
- void testHtml5NoComment() {
+ public void testHtml5NoComment() {
javadoc("-d", "out-html5-nocomment",
"-nocomment",
"-use",
@@ -144,7 +146,7 @@
* Test generated pages, in an unnamed module, for HTML 4.
*/
@Test
- void testHtml4UnnamedModule() {
+ public void testHtml4UnnamedModule() {
javadoc("-d", "out-nomodule",
"-html4",
"-use",
@@ -164,7 +166,7 @@
* Test generated pages, in an unnamed module, for HTML 5.
*/
@Test
- void testHtml5UnnamedModule() {
+ public void testHtml5UnnamedModule() {
javadoc("-d", "out-html5-nomodule",
"-use",
"--frames",
@@ -182,7 +184,7 @@
* Test generated module pages with javadoc tags.
*/
@Test
- void testJDTagsInModules() {
+ public void testJDTagsInModules() {
javadoc("-d", "out-mdltags",
"-author",
"-version",
@@ -200,7 +202,7 @@
* Test generated module pages with javadoc tags.
*/
@Test
- void testJDTagsInModules_html4() {
+ public void testJDTagsInModules_html4() {
javadoc("-d", "out-mdltags-html4",
"-html4",
"-author",
@@ -219,7 +221,7 @@
* Test generated module summary page.
*/
@Test
- void testModuleSummary() {
+ public void testModuleSummary() {
javadoc("-d", "out-moduleSummary",
"-use",
"-Xdoclint:none",
@@ -235,7 +237,7 @@
* Test generated module summary page.
*/
@Test
- void testModuleSummary_html4() {
+ public void testModuleSummary_html4() {
javadoc("-d", "out-moduleSummary-html4",
"-html4",
"-use",
@@ -252,7 +254,7 @@
* Test generated module summary page of an aggregating module.
*/
@Test
- void testAggregatorModuleSummary() {
+ public void testAggregatorModuleSummary() {
javadoc("-d", "out-aggregatorModuleSummary",
"-use",
"--module-source-path", testSrc,
@@ -266,7 +268,7 @@
* Test generated module pages and pages with link to modules.
*/
@Test
- void testModuleFilesAndLinks() {
+ public void testModuleFilesAndLinks() {
javadoc("-d", "out-modulelinks",
"-Xdoclint:none",
"--frames",
@@ -282,7 +284,7 @@
* Test generated module pages for a deprecated module.
*/
@Test
- void testModuleDeprecation() {
+ public void testModuleDeprecation() {
javadoc("-d", "out-moduledepr",
"-Xdoclint:none",
"-tag", "regular:a:Regular Tag:",
@@ -298,7 +300,7 @@
* Test annotations on modules.
*/
@Test
- void testModuleAnnotation() {
+ public void testModuleAnnotation() {
javadoc("-d", "out-moduleanno",
"-Xdoclint:none",
"--module-source-path", testSrc,
@@ -312,7 +314,7 @@
* Test annotations on modules.
*/
@Test
- void testModuleAnnotation_html4() {
+ public void testModuleAnnotation_html4() {
javadoc("-d", "out-moduleanno-html4",
"-html4",
"-Xdoclint:none",
@@ -327,7 +329,7 @@
* Test module summary pages in "api" mode.
*/
@Test
- void testApiMode() {
+ public void testApiMode() {
javadoc("-d", "out-api",
"-use",
"--show-module-contents=api",
@@ -352,7 +354,7 @@
* Test module summary pages in "all" mode.
*/
@Test
- void testAllMode() {
+ public void testAllMode() {
javadoc("-d", "out-all",
"-use",
"--show-module-contents=all",
@@ -377,7 +379,7 @@
* Test module summary pages in "all" mode.
*/
@Test
- void testAllModeHtml4() {
+ public void testAllModeHtml4() {
javadoc("-d", "out-all-html4",
"-html4",
"-use",
@@ -400,7 +402,7 @@
* Test generated module summary page of a module with no exported package.
*/
@Test
- void testModuleSummaryNoExportedPkgAll() {
+ public void testModuleSummaryNoExportedPkgAll() {
javadoc("-d", "out-ModuleSummaryNoExportedPkgAll",
"-use",
"--show-module-contents=all",
@@ -415,7 +417,7 @@
* Test generated module summary page of a module with no exported package.
*/
@Test
- void testModuleSummaryNoExportedPkgAll_html4() {
+ public void testModuleSummaryNoExportedPkgAll_html4() {
javadoc("-d", "out-ModuleSummaryNoExportedPkgAll-html4",
"-html4",
"-use",
@@ -431,7 +433,7 @@
* Test generated module summary page of a module with no exported package.
*/
@Test
- void testModuleSummaryNoExportedPkgApi() {
+ public void testModuleSummaryNoExportedPkgApi() {
javadoc("-d", "out-ModuleSummaryNoExportedPkgApi",
"-use",
"-sourcepath", testSrc + "/moduleNoExport",
@@ -445,7 +447,7 @@
* Test generated module summary page of a module with no exported package.
*/
@Test
- void testModuleSummaryNoExportedPkgApi_html4() {
+ public void testModuleSummaryNoExportedPkgApi_html4() {
javadoc("-d", "out-ModuleSummaryNoExportedPkgApi-html4",
"-html4",
"-use",
@@ -460,7 +462,7 @@
* Test generated module pages for javadoc run for a single module having a single package.
*/
@Test
- void testSingleModuleSinglePkg() {
+ public void testSingleModuleSinglePkg() {
javadoc("-d", "out-singlemod",
"--frames",
"--module-source-path", testSrc,
@@ -474,7 +476,7 @@
* Test generated module pages for javadoc run for a single module having multiple packages.
*/
@Test
- void testSingleModuleMultiplePkg() {
+ public void testSingleModuleMultiplePkg() {
javadoc("-d", "out-singlemodmultiplepkg",
"--show-module-contents=all",
"-Xdoclint:none",
@@ -490,7 +492,7 @@
* Test -group option for modules. The overview-summary.html page should group the modules accordingly.
*/
@Test
- void testGroupOption() {
+ public void testGroupOption() {
javadoc("-d", "out-group",
"--show-module-contents=all",
"-Xdoclint:none",
@@ -512,7 +514,7 @@
* Test -group option for modules. The overview-summary.html page should group the modules accordingly.
*/
@Test
- void testGroupOption_html4() {
+ public void testGroupOption_html4() {
javadoc("-d", "out-group-html4",
"-html4",
"--show-module-contents=all",
@@ -537,7 +539,7 @@
* the order it was provided on the command-line.
*/
@Test
- void testGroupOptionOrdering() {
+ public void testGroupOptionOrdering() {
javadoc("-d", "out-groupOrder",
"--show-module-contents=all",
"-Xdoclint:none",
@@ -560,7 +562,7 @@
* Test -group option for unnamed modules. The overview-summary.html page should group the packages accordingly.
*/
@Test
- void testUnnamedModuleGroupOption() {
+ public void testUnnamedModuleGroupOption() {
javadoc("-d", "out-groupnomodule",
"-use",
"-Xdoclint:none",
@@ -578,7 +580,7 @@
* Test -group option for unnamed modules. The overview-summary.html page should group the packages accordingly.
*/
@Test
- void testUnnamedModuleGroupOption_html4() {
+ public void testUnnamedModuleGroupOption_html4() {
javadoc("-d", "out-groupnomodule-html4",
"-html4",
"-use",
@@ -599,7 +601,7 @@
* the order it was provided on the command-line.
*/
@Test
- void testGroupOptionPackageOrdering() {
+ public void testGroupOptionPackageOrdering() {
javadoc("-d", "out-groupPkgOrder",
"-use",
"-Xdoclint:none",
@@ -617,7 +619,7 @@
* Test -group option for a single module.
*/
@Test
- void testGroupOptionSingleModule() {
+ public void testGroupOptionSingleModule() {
javadoc("-d", "out-groupsinglemodule",
"-use",
"-Xdoclint:none",
@@ -634,7 +636,7 @@
* Test -group option for a single module.
*/
@Test
- void testGroupOptionSingleModule_html4() {
+ public void testGroupOptionSingleModule_html4() {
javadoc("-d", "out-groupsinglemodule-html4",
"-html4",
"-use",
@@ -652,7 +654,7 @@
* Test -group option for a single module.
*/
@Test
- void testModuleName() {
+ public void testModuleName() {
javadoc("-d", "out-modulename",
"-use",
"-Xdoclint:none",
@@ -668,7 +670,7 @@
* Test -linkoffline option.
*/
@Test
- void testLinkOffline() {
+ public void testLinkOffline() {
String url = "https://docs.oracle.com/javase/9/docs/api/";
javadoc("-d", "out-linkoffline",
"-use",
--- a/test/langtools/jdk/javadoc/doclet/testNavigation/TestModuleNavigation.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testNavigation/TestModuleNavigation.java Fri Dec 21 10:38:33 2018 -0800
@@ -29,8 +29,8 @@
* jdk.compiler/com.sun.tools.javac.main
* jdk.javadoc/jdk.javadoc.internal.api
* jdk.javadoc/jdk.javadoc.internal.tool
- * @library ../lib /tools/lib
- * @build toolbox.ToolBox toolbox.ModuleBuilder JavadocTester
+ * @library ../../lib /tools/lib
+ * @build toolbox.ToolBox toolbox.ModuleBuilder javadoc.tester.*
* @run main TestModuleNavigation
*/
@@ -38,7 +38,9 @@
import java.nio.file.Path;
import java.nio.file.Paths;
-import toolbox.*;
+import javadoc.tester.JavadocTester;
+import toolbox.ModuleBuilder;
+import toolbox.ToolBox;
public class TestModuleNavigation extends JavadocTester {
--- a/test/langtools/jdk/javadoc/doclet/testNavigation/TestNavigation.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testNavigation/TestNavigation.java Fri Dec 21 10:38:33 2018 -0800
@@ -28,9 +28,9 @@
* @summary Make sure the Next/Prev Class links iterate through all types.
* Make sure the navagation is 2 columns, not 3.
* @author jamieh
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build toolbox.ToolBox JavadocTester
+ * @build toolbox.ToolBox javadoc.tester.*
* @run main TestNavigation
*/
@@ -38,7 +38,8 @@
import java.nio.file.Path;
import java.nio.file.Paths;
-import toolbox.*;
+import javadoc.tester.JavadocTester;
+import toolbox.ToolBox;
public class TestNavigation extends JavadocTester {
@@ -53,7 +54,7 @@
}
@Test
- void test(Path ignore) {
+ public void test(Path ignore) {
javadoc("-d", "out",
"-overview", testSrc("overview.html"),
"--frames",
@@ -110,7 +111,7 @@
}
@Test
- void test_html4(Path ignore) {
+ public void test_html4(Path ignore) {
javadoc("-d", "out-html4",
"-html4",
"-overview", testSrc("overview.html"),
@@ -151,7 +152,7 @@
// Test for checking additional padding to offset the fixed navigation bar in HTML5.
@Test
- void test1(Path ignore) {
+ public void test1(Path ignore) {
javadoc("-d", "out-1",
"-html5",
"--frames",
@@ -185,7 +186,7 @@
// Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML4.
@Test
- void test2(Path ignore) {
+ public void test2(Path ignore) {
javadoc("-d", "out-2",
"-nonavbar",
"--frames",
@@ -217,7 +218,7 @@
// Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML5.
@Test
- void test3(Path ignore) {
+ public void test3(Path ignore) {
javadoc("-d", "out-3",
"-html5",
"-nonavbar",
@@ -251,7 +252,7 @@
}
@Test
- void test4(Path base) throws IOException {
+ public void test4(Path base) throws IOException {
Path src = base.resolve("src");
tb.writeJavaFiles(src,
"package pkg1; public class A {\n"
--- a/test/langtools/jdk/javadoc/doclet/testNestedGenerics/TestNestedGenerics.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testNestedGenerics/TestNestedGenerics.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 6758050 8025633 8182765
* @summary Test HTML output for nested generic types.
* @author bpatel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestNestedGenerics
*/
+import javadoc.tester.JavadocTester;
+
public class TestNestedGenerics extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
@@ -53,7 +55,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java Fri Dec 21 10:38:33 2018 -0800
@@ -29,12 +29,14 @@
* language features. Check the output to ensure that the new
* language features are properly documented.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestNewLanguageFeatures
*/
+import javadoc.tester.JavadocTester;
+
public class TestNewLanguageFeatures extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-Xdoclint:none",
"-d", "out",
"-use",
@@ -59,7 +61,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-Xdoclint:none",
"-d", "out-html4",
"-html4",
--- a/test/langtools/jdk/javadoc/doclet/testNoPackagesFile/TestNoPackagesFile.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testNoPackagesFile/TestNoPackagesFile.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -27,12 +27,14 @@
* @summary Verify that packages.html is no longer generated since it is no
* longer used.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestNoPackagesFile
*/
+import javadoc.tester.JavadocTester;
+
public class TestNoPackagesFile extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
testSrc("C.java"));
--- a/test/langtools/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -25,12 +25,14 @@
* @test
* @bug 8048628 8174715 8182765
* @summary Verify html inline tags are removed correctly in the first sentence.
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestNonInlineHtmlTagRemoval
*/
+import javadoc.tester.JavadocTester;
+
public class TestNonInlineHtmlTagRemoval extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void testPositive() {
+ public void testPositive() {
javadoc("-d", "out1",
"-sourcepath", testSrc,
testSrc("C.java"));
@@ -64,7 +66,7 @@
}
@Test
- void testPositive_html4() {
+ public void testPositive_html4() {
javadoc("-d", "out1-html4",
"-html4",
"-sourcepath", testSrc,
@@ -73,7 +75,7 @@
}
@Test
- void testNegative() {
+ public void testNegative() {
javadoc("-d", "out2",
"-sourcepath", testSrc,
testSrc("Negative.java"));
--- a/test/langtools/jdk/javadoc/doclet/testNotifications/TestNotifications.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testNotifications/TestNotifications.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -28,12 +28,14 @@
* be created.
* Make sure classname is not include in javadoc usage message.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestNotifications
*/
+import javadoc.tester.JavadocTester;
+
public class TestNotifications extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
}
@Test
- void test1() {
+ public void test1() {
String outDir = "out";
// Notify that the destination directory must be created.
@@ -61,7 +63,7 @@
}
@Test
- void test() {
+ public void test() {
//Make sure classname is not include in javadoc usage message.
setOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES);
javadoc("-help");
--- a/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,14 +27,16 @@
* @summary Test the output for -header, -footer, -nooverview, -nodeprecatedlist, -nonavbar, -notree,
* -stylesheetfile, --main-stylesheet, --add-stylesheet options.
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestOptions
*/
import java.io.File;
+import javadoc.tester.JavadocTester;
+
public class TestOptions extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
}
@Test
- void testHeaderFooter() {
+ public void testHeaderFooter() {
javadoc("-d", "out-1",
"-header", "Test header",
"-footer", "Test footer",
@@ -57,7 +59,7 @@
}
@Test
- void testNoOverview() {
+ public void testNoOverview() {
javadoc("-d", "out-4",
"-nooverview",
"-sourcepath", testSrc,
@@ -69,7 +71,7 @@
}
@Test
- void testNoDeprecatedList() {
+ public void testNoDeprecatedList() {
javadoc("-d", "out-5",
"-nodeprecatedlist",
"-sourcepath", testSrc,
@@ -80,7 +82,7 @@
}
@Test
- void testNoNavbar() {
+ public void testNoNavbar() {
javadoc("-d", "out-6",
"-nonavbar",
"-bottom", "Bottom text",
@@ -93,7 +95,7 @@
}
@Test
- void testNoTree() {
+ public void testNoTree() {
javadoc("-d", "out-7",
"-notree",
"-sourcepath", testSrc,
@@ -106,7 +108,7 @@
}
@Test
- void testStylesheetFile() {
+ public void testStylesheetFile() {
javadoc("-d", "out-8",
"-stylesheetfile", new File(testSrc, "custom-stylesheet.css").getAbsolutePath(),
"-sourcepath", testSrc,
@@ -119,7 +121,7 @@
}
@Test
- void testStylesheetFileAltOption() {
+ public void testStylesheetFileAltOption() {
javadoc("-d", "out-stylesheet-file",
"--main-stylesheet", new File(testSrc, "custom-stylesheet.css").getAbsolutePath(),
"-sourcepath", testSrc,
@@ -132,7 +134,7 @@
}
@Test
- void testAdditionalStylesheetFile() {
+ public void testAdditionalStylesheetFile() {
javadoc("-d", "out-additional-css",
"--add-stylesheet", new File(testSrc, "additional-stylesheet-1.css").getAbsolutePath(),
"--add-stylesheet", new File(testSrc, "additional-stylesheet-2.css").getAbsolutePath(),
@@ -151,7 +153,7 @@
}
@Test
- void testInvalidStylesheetFile() {
+ public void testInvalidStylesheetFile() {
javadoc("-d", "out-invalid-css",
"--main-stylesheet", new File(testSrc, "custom-stylesheet-1.css").getAbsolutePath(),
"-sourcepath", testSrc,
@@ -164,7 +166,7 @@
}
@Test
- void testInvalidAdditionalStylesheetFiles() {
+ public void testInvalidAdditionalStylesheetFiles() {
javadoc("-d", "out-invalid-additional-css",
"--add-stylesheet", new File(testSrc, "additional-stylesheet-4.css").getAbsolutePath(),
"-sourcepath", testSrc,
@@ -177,7 +179,7 @@
}
@Test
- void testLinkSource() {
+ public void testLinkSource() {
javadoc("-d", "out-9",
"-linksource",
"-javafx",
@@ -250,7 +252,7 @@
}
@Test
- void testLinkSource_html4() {
+ public void testLinkSource_html4() {
javadoc("-d", "out-9-html4",
"-html4",
"-linksource",
@@ -285,7 +287,7 @@
}
@Test
- void testNoQualifier() {
+ public void testNoQualifier() {
javadoc("-d", "out-10",
"-noqualifier", "pkg",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testOrdering/TestOrdering.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testOrdering/TestOrdering.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,9 +25,9 @@
* @test
* @bug 8039410 8042601 8042829 8049393 8050031 8155061 8155995 8167967 8169813 8182765 8196202
* @summary test to determine if members are ordered correctly
- * @library ../lib/
+ * @library ../../lib/
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestOrdering
*/
@@ -41,6 +41,8 @@
import static java.nio.file.StandardOpenOption.*;
+import javadoc.tester.JavadocTester;
+
public class TestOrdering extends JavadocTester {
public static void main(String[] args) throws Exception {
@@ -49,94 +51,84 @@
}
@Test
- void testUnnamedPackagesForClassUse() {
- new UnnamedPackageForClassUseTest(this).run();
+ public void testUnnamedPackagesForClassUse() {
+ new UnnamedPackageForClassUseTest().run();
}
@Test
- void testNamedPackagesForClassUse() {
- new NamedPackagesForClassUseTest(this).run();
+ public void testNamedPackagesForClassUse() {
+ new NamedPackagesForClassUseTest().run();
}
@Test
- void testIndexOrdering() throws IOException {
- new IndexOrderingTest(this).run();
+ public void testIndexOrdering() throws IOException {
+ new IndexOrderingTest().run();
}
@Test
- void testIndexTypeClustering() {
- new IndexTypeClusteringTest(this).run();
+ public void testIndexTypeClustering() {
+ new IndexTypeClusteringTest().run();
}
@Test
- void testTypeElementMemberOrdering() {
- new TypeElementMemberOrderingTest(this).run();
+ public void testTypeElementMemberOrdering() {
+ new TypeElementMemberOrderingTest().run();
}
- static class UnnamedPackageForClassUseTest {
- final JavadocTester tester;
-
- UnnamedPackageForClassUseTest(JavadocTester tester) {
- this.tester = tester;
- }
+ class UnnamedPackageForClassUseTest {
void run() {
- tester.javadoc("-d", "out",
+ javadoc("-d", "out",
"-sourcepath", testSrc,
"-use",
- tester.testSrc("C.java"), tester.testSrc("UsedInC.java"));
- tester.checkExit(Exit.OK);
+ testSrc("C.java"), testSrc("UsedInC.java"));
+ checkExit(Exit.OK);
checkExecutableMemberOrdering("class-use/UsedInC.html");
}
void checkExecutableMemberOrdering(String usePage) {
- String contents = tester.readFile(usePage);
+ String contents = readFile(usePage);
// check constructors
- tester.checking("constructors");
+ checking("constructors");
int idx1 = contents.indexOf("C.html#%3Cinit%3E(UsedInC");
int idx2 = contents.indexOf("C.html#%3Cinit%3E(UsedInC,int");
int idx3 = contents.indexOf("C.html#%3Cinit%3E(UsedInC,java.lang.String");
if (idx1 == -1 || idx2 == -1 || idx3 == -1) {
- tester.failed("ctor strings not found");
+ failed("ctor strings not found");
} else if (idx1 > idx2 || idx2 > idx3 || idx1 > idx3) {
- tester.failed("ctor strings are out of order");
+ failed("ctor strings are out of order");
} else {
- tester.passed("ctor strings are in order");
+ passed("ctor strings are in order");
}
// check methods
- tester.checking("methods");
+ checking("methods");
idx1 = contents.indexOf("C.html#ymethod(int");
idx2 = contents.indexOf("C.html#ymethod(java.lang.String");
if (idx1 == -1 || idx2 == -1) {
- tester.failed("#ymethod strings not found");
+ failed("#ymethod strings not found");
} else if (idx1 > idx2) {
- tester.failed("#ymethod strings are out of order");
+ failed("#ymethod strings are out of order");
} else {
- tester.passed("Executable Member Ordering: OK");
+ passed("Executable Member Ordering: OK");
}
}
}
- static class NamedPackagesForClassUseTest {
- final JavadocTester tester;
-
- NamedPackagesForClassUseTest(JavadocTester tester) {
- this.tester = tester;
- }
+ class NamedPackagesForClassUseTest {
public void run() {
- tester.javadoc("-d", "out-1",
- "-sourcepath", tester.testSrc,
+ javadoc("-d", "out-1",
+ "-sourcepath", testSrc,
"-use",
"--frames",
"pkg1");
- tester.checkExit(Exit.OK);
- tester.checkFiles(false, "allclasses-noframe.html");
+ checkExit(Exit.OK);
+ checkFiles(false, "allclasses-noframe.html");
checkClassUseOrdering("pkg1/class-use/UsedClass.html");
- tester.checkOrder("pkg1/class-use/UsedClass.html",
+ checkOrder("pkg1/class-use/UsedClass.html",
"../MethodOrder.html#m()",
"../MethodOrder.html#m(byte%5B%5D)",
"../MethodOrder.html#m(double)",
@@ -160,13 +152,13 @@
"../MethodOrder.html#m(java.util.Collection)",
"../MethodOrder.html#m(java.util.List)");
- tester.checkOrder("pkg1/class-use/UsedClass.html",
+ checkOrder("pkg1/class-use/UsedClass.html",
"../MethodOrder.html#tpm(pkg1.UsedClass)",
"../MethodOrder.html#tpm(pkg1.UsedClass,pkg1.UsedClass)",
"../MethodOrder.html#tpm(pkg1.UsedClass,pkg1.UsedClass%5B%5D)",
"../MethodOrder.html#tpm(pkg1.UsedClass,java.lang.String)");
- tester.checkOrder("pkg1/class-use/UsedClass.html",
+ checkOrder("pkg1/class-use/UsedClass.html",
"../A.html#%3Cinit%3E(pkg1.UsedClass)",
"../B.A.html#%3Cinit%3E(pkg1.UsedClass)",
"../B.html#%3Cinit%3E(pkg1.UsedClass)",
@@ -174,16 +166,16 @@
"../A.C.html#%3Cinit%3E(pkg1.UsedClass,java.util.Collection)",
"../A.C.html#%3Cinit%3E(pkg1.UsedClass,java.util.List)");
- tester.checkOrder("pkg1/ImplementsOrdering.html",
+ checkOrder("pkg1/ImplementsOrdering.html",
"<dd><code>close</code> in interface <code>java.lang.AutoCloseable</code></dd>",
"<dd><code>close</code> in interface <code>java.nio.channels.Channel</code></dd>",
"<dd><code>close</code> in interface <code>java.io.Closeable</code></dd>");
- tester.checkOrder("pkg1/OverrideOrdering.html",
+ checkOrder("pkg1/OverrideOrdering.html",
"<dd><code>iterator</code> in interface <code>java.util.Collection<",
"<dd><code>iterator</code> in interface <code>java.lang.Iterable<");
- tester.checkOrder("allclasses-frame.html",
+ checkOrder("allclasses-frame.html",
"pkg1/A.html\" title=\"class in pkg1",
"pkg1/A.C.html\" title=\"class in pkg1",
"pkg1/B.html\" title=\"class in pkg1",
@@ -206,40 +198,36 @@
}
void checkClassUseOrdering(String usePage, String searchString) {
- String contents = tester.readFile(usePage);
+ String contents = readFile(usePage);
int lastidx = 0;
System.out.println("testing for " + searchString);
for (int i = 1; i < 5; i++) {
String s = searchString.replaceAll("#ITERATION#", Integer.toString(i));
- tester.checking(s);
+ checking(s);
int idx = contents.indexOf(s);
if (idx < lastidx) {
- tester.failed(s + ", member ordering error, last:" + lastidx + ", got:" + idx);
+ failed(s + ", member ordering error, last:" + lastidx + ", got:" + idx);
} else {
- tester.passed("\tlast: " + lastidx + " got:" + idx);
+ passed("\tlast: " + lastidx + " got:" + idx);
}
lastidx = idx;
}
}
}
- static class IndexOrderingTest {
- private final JavadocTester tester;
+ enum ListOrder {
+ NONE, REVERSE, SHUFFLE
+ };
- IndexOrderingTest(JavadocTester tester) {
- this.tester = tester;
- }
+ class IndexOrderingTest {
- enum ListOrder {
- NONE, REVERSE, SHUFFLE
- };
/*
* By default we do not shuffle the input list, in order to keep the list deterministic,
* and the test predictable. However, we can turn on the stress mode, by setting the following
* property if required.
*/
- static final ListOrder STRESS_MODE = Boolean.getBoolean("TestOrder.STRESS")
+ final ListOrder STRESS_MODE = Boolean.getBoolean("TestOrder.STRESS")
? ListOrder.SHUFFLE
: ListOrder.REVERSE;
@@ -255,7 +243,7 @@
*/
static final int MAX_PACKAGES = 4;
- static String[] contents = {
+ String[] contents = {
"public add ADDADD;",
"public add AddAdd;",
"public add addadd;",
@@ -274,12 +262,12 @@
"public int add(Integer i) {return 0;}"
};
- static String expectedEnumOrdering[] = {
+ String expectedEnumOrdering[] = {
"Add.add.html\" title=\"enum in REPLACE_ME\"",
"Add.ADD.html\" title=\"enum in REPLACE_ME\""
};
- static String expectedFieldOrdering[] = {
+ String expectedFieldOrdering[] = {
"Add.html#addadd\"",
"add0/add/add/add/Add.html#addadd\"",
"add0/add/add/Add.html#addadd\"",
@@ -333,7 +321,7 @@
"add3/Add.html#ADDADD\""
};
- static String expectedMethodOrdering[] = {
+ String expectedMethodOrdering[] = {
"Add.html#add()",
"Add.html#add(double)",
"Add.html#add(double,byte)",
@@ -347,7 +335,7 @@
"Add.html#add(java.lang.Integer)"
};
- static String expectedPackageOrdering[] = {
+ String expectedPackageOrdering[] = {
"\"add0/package-summary.html\">add0</a> - package add0",
"\"add0/add/package-summary.html\">add0.add</a> - package add0.add",
"\"add0/add/add/package-summary.html\">add0.add.add</a> - package add0.add.add",
@@ -390,13 +378,13 @@
}
File srcDir = new File(new File("."), "src");
cmdArgs.add(new File(srcDir, clsname + ".java").getPath());
- tester.javadoc(cmdArgs.toArray(new String[cmdArgs.size()]));
- tester.checkExit(Exit.OK);
- tester.checkOrder("index-all.html", composeTestVectors());
- tester.checkOrder("add0/add/package-tree.html",
+ javadoc(cmdArgs.toArray(new String[cmdArgs.size()]));
+ checkExit(Exit.OK);
+ checkOrder("index-all.html", composeTestVectors());
+ checkOrder("add0/add/package-tree.html",
"<a href=\"Add.add.html\" title=\"enum in add0.add\">",
"<a href=\"Add.ADD.html\" title=\"enum in add0.add\">");
- tester.checkOrder("overview-tree.html",
+ checkOrder("overview-tree.html",
"<a href=\"Add.add.html\" title=\"enum in <Unnamed>\">",
"<a href=\"add0/Add.add.html\" title=\"enum in add0\">",
"<a href=\"add0/add/Add.add.html\" title=\"enum in add0.add\">",
@@ -432,7 +420,7 @@
"<a href=\"add3/add/add/Add.ADD.html\" title=\"enum in add3.add.add\">",
"<a href=\"add3/add/add/add/Add.ADD.html\" title=\"enum in add3.add.add.add\">");
- tester.checkOrder("overview-frame.html",
+ checkOrder("overview-frame.html",
"<a href=\"package-frame.html\" target=\"packageFrame\"><unnamed package></a>",
"<a href=\"add0/package-frame.html\" target=\"packageFrame\">add0</a>",
"<a href=\"add0/add/package-frame.html\" target=\"packageFrame\">add0.add</a>",
@@ -523,26 +511,20 @@
}
}
- static class IndexTypeClusteringTest {
-
- private final JavadocTester tester;
-
- IndexTypeClusteringTest(JavadocTester tester) {
- this.tester = tester;
- }
+ class IndexTypeClusteringTest {
void run() {
- tester.javadoc("-d", "out-3",
- "-sourcepath", tester.testSrc("src-2"),
+ javadoc("-d", "out-3",
+ "-sourcepath", testSrc("src-2"),
"-use",
"a",
"b",
"e",
"something");
- tester.checkExit(Exit.OK);
+ checkExit(Exit.OK);
- tester.checkOrder("index-all.html",
+ checkOrder("index-all.html",
"something</a> - package something</dt>",
"something</span></a> - Class in",
"something</span></a> - Enum in",
@@ -556,32 +538,26 @@
}
}
- static class TypeElementMemberOrderingTest {
-
- final JavadocTester tester;
-
- TypeElementMemberOrderingTest(JavadocTester tester) {
- this.tester = tester;
- }
+ class TypeElementMemberOrderingTest {
void run() {
- tester.javadoc("-d", "out-5",
+ javadoc("-d", "out-5",
"-javafx",
"--disable-javafx-strict-checks",
- "-sourcepath", tester.testSrc(new File(".").getPath()),
+ "-sourcepath", testSrc(new File(".").getPath()),
"pkg5"
);
- tester.checkExit(Exit.OK);
+ checkExit(Exit.OK);
- tester.checkOrder("pkg5/AnnoFieldTest.html",
+ checkOrder("pkg5/AnnoFieldTest.html",
"<h3>Field Detail</h3>",
"<pre>static final int one</pre>",
"<pre>static final int two</pre>",
"<pre>static final int three</pre>",
"<pre>static final int four</pre>");
- tester.checkOrder("pkg5/AnnoOptionalTest.html",
+ checkOrder("pkg5/AnnoOptionalTest.html",
"<h3>Optional Element Summary</h3>",
"<a href=\"#four()\">four</a>",
"<a href=\"#one()\">one</a>",
@@ -593,7 +569,7 @@
"<h4>three</h4>",
"<h4>four</h4>");
- tester.checkOrder("pkg5/AnnoRequiredTest.html",
+ checkOrder("pkg5/AnnoRequiredTest.html",
"<h3>Required Element Summary</h3>",
"<a href=\"#four()\">four</a>",
"<a href=\"#one()\">one</a>",
@@ -605,7 +581,7 @@
"<h4>three</h4>",
"<h4>four</h4>");
- tester.checkOrder("pkg5/CtorTest.html",
+ checkOrder("pkg5/CtorTest.html",
"<h3>Constructor Summary</h3>",
"<a href=\"#%3Cinit%3E(int)\"",
"<a href=\"#%3Cinit%3E(int,int)\"",
@@ -617,7 +593,7 @@
"<a id=\"<init>(int,int)\">",
"<a id=\"<init>(int)\">");
- tester.checkOrder("pkg5/EnumTest.html",
+ checkOrder("pkg5/EnumTest.html",
"<h3>Enum Constant Summary</h3>",
"<a href=\"#FOUR\">FOUR</a>",
"<a href=\"#ONE\">ONE</a>",
@@ -629,7 +605,7 @@
"<h4>THREE</h4>",
"<h4>FOUR</h4>");
- tester.checkOrder("pkg5/FieldTest.html",
+ checkOrder("pkg5/FieldTest.html",
"<h3>Field Summary</h3>",
"<a href=\"#four\">four</a>",
"<a href=\"#one\">one</a>",
@@ -641,7 +617,7 @@
"<h4>three</h4>",
"<h4>four</h4>");
- tester.checkOrder("pkg5/IntfTest.html",
+ checkOrder("pkg5/IntfTest.html",
"<h3>Method Summary</h3>",
"<a href=\"#four()\">four</a>",
"<a href=\"#one()\">one</a>",
@@ -653,7 +629,7 @@
"<h4>three</h4>",
"<h4>four</h4>");
- tester.checkOrder("pkg5/MethodTest.html",
+ checkOrder("pkg5/MethodTest.html",
"<h3>Method Summary</h3>",
"<a href=\"#four()\">four</a>",
"<a href=\"#one()\">one</a>",
@@ -665,7 +641,7 @@
"<h4>three</h4>",
"<h4>four</h4>");
- tester.checkOrder("pkg5/PropertyTest.html",
+ checkOrder("pkg5/PropertyTest.html",
"<h3>Property Summary</h3>",
"<a href=\"#fourProperty\">four</a>",
"<a href=\"#oneProperty\">one</a>",
@@ -677,16 +653,16 @@
"<h4>threeProperty</h4>",
"<h4>fourProperty</h4>");
- tester.javadoc("-d", "out-5-html4",
+ javadoc("-d", "out-5-html4",
"-html4",
"-javafx",
- "-sourcepath", tester.testSrc(new File(".").getPath()),
+ "-sourcepath", testSrc(new File(".").getPath()),
"pkg5"
);
- tester.checkExit(Exit.OK);
+ checkExit(Exit.OK);
- tester.checkOrder("pkg5/CtorTest.html",
+ checkOrder("pkg5/CtorTest.html",
"<a href=\"#CtorTest-int-\"",
"<a href=\"#CtorTest-int-int-\"",
"<a href=\"#CtorTest-int-int-int-\"",
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestBadOverride.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestBadOverride.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -25,12 +25,14 @@
* @test
* @bug 8174839 8175200 8186332
* @summary Bad overriding method should not crash
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestBadOverride
*/
+import javadoc.tester.JavadocTester;
+
public class TestBadOverride extends JavadocTester {
/**
@@ -43,7 +45,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg4");
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestMultiInheritance.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestMultiInheritance.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* @summary Make sure that all inherited methods from multiple extended
* interfaces are documented
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestMultiInheritance
*/
+import javadoc.tester.JavadocTester;
+
public class TestMultiInheritance extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg3");
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenDeprecatedMethods.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenDeprecatedMethods.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,14 @@
* @test
* @bug 8211901
* @summary javadoc generates broken links on deprecated items page
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestOverriddenDeprecatedMethods
*/
+import javadoc.tester.JavadocTester;
+
public class TestOverriddenDeprecatedMethods extends JavadocTester {
public static void main(String args[]) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out-deprecated",
"-sourcepath", testSrc,
"--override-methods","summary",
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenMethodDocCopy.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenMethodDocCopy.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* @summary Inherited comment should link directly to member, not just
* class
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestOverriddenMethodDocCopy
*/
+import javadoc.tester.JavadocTester;
+
public class TestOverriddenMethodDocCopy extends JavadocTester {
/**
@@ -45,7 +47,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg1", "pkg2");
@@ -58,7 +60,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethods.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethods.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* @summary Determine if overridden methods are properly documented when
* -protected (default) visibility flag is used.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestOverriddenPrivateMethods
*/
+import javadoc.tester.JavadocTester;
+
public class TestOverriddenPrivateMethods extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg1", "pkg2");
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPackageFlag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPackageFlag.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* @summary Determine if overridden methods are properly documented when
* -protected (default) visibility flag is used.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestOverriddenPrivateMethodsWithPackageFlag
*/
+import javadoc.tester.JavadocTester;
+
public class TestOverriddenPrivateMethodsWithPackageFlag extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-package",
@@ -88,7 +90,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPrivateFlag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverriddenPrivateMethodsWithPrivateFlag.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* @summary Determine if overridden methods are properly documented when
* -protected (default) visibility flag is used.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestOverriddenPrivateMethodsWithPrivateFlag
*/
+import javadoc.tester.JavadocTester;
+
public class TestOverriddenPrivateMethodsWithPrivateFlag extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-private",
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverrideMethods.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestOverrideMethods.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,14 @@
* @test
* @bug 8157000 8192850 8182765
* @summary test the behavior of --override-methods option
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestOverrideMethods
*/
+import javadoc.tester.JavadocTester;
+
public class TestOverrideMethods extends JavadocTester {
public static void main(String... args) throws Exception {
TestOverrideMethods tester = new TestOverrideMethods();
@@ -38,7 +40,7 @@
}
@Test
- void testInvalidOption() {
+ public void testInvalidOption() {
// Make sure an invalid argument fails
javadoc("-d", "out-bad-option",
"-sourcepath", testSrc,
@@ -51,7 +53,7 @@
}
@Test
- void testDetail() {
+ public void testDetail() {
// Make sure the option works
javadoc("-d", "out-detail",
"-sourcepath", testSrc,
@@ -64,7 +66,7 @@
}
@Test
- void testSummary() {
+ public void testSummary() {
javadoc("-d", "out-summary",
"-sourcepath", testSrc,
"-javafx",
@@ -257,7 +259,7 @@
}
@Test
- void testSummary_html4() {
+ public void testSummary_html4() {
javadoc("-d", "out-summary-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testOverview/TestOverview.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testOverview/TestOverview.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 8173302 8182765 8196202 8210047
* @summary make sure the overview-summary and module-summary pages don't
* don't have the See link, and the overview is copied correctly.
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestOverview
*/
+import javadoc.tester.JavadocTester;
+
public class TestOverview extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out-1",
"-doctitle", "Document Title",
"-windowtitle", "Window Title",
@@ -53,7 +55,7 @@
}
@Test
- void test1_html4() {
+ public void test1_html4() {
javadoc("-d", "out-1-html4",
"-html4",
"-doctitle", "Document Title",
@@ -67,7 +69,7 @@
}
@Test
- void test2() {
+ public void test2() {
javadoc("-d", "out-2",
"-doctitle", "Document Title",
"-windowtitle", "Window Title",
@@ -80,7 +82,7 @@
}
@Test
- void test2_html4() {
+ public void test2_html4() {
javadoc("-d", "out-2-html4",
"-html4",
"-doctitle", "Document Title",
--- a/test/langtools/jdk/javadoc/doclet/testPackageDeprecation/TestPackageDeprecation.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testPackageDeprecation/TestPackageDeprecation.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 6492694 8026567 8048351 8162363 8183511 8169819 8074407 8196202
* @summary Test package deprecation.
* @author bpatel
- * @library ../lib/
+ * @library ../../lib/
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester TestPackageDeprecation
+ * @build javadoc.tester.* TestPackageDeprecation
* @run main TestPackageDeprecation
*/
+import javadoc.tester.JavadocTester;
+
public class TestPackageDeprecation extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void testDefault() {
+ public void testDefault() {
javadoc("-d", "out-default",
"-sourcepath", testSrc,
"-use",
@@ -60,7 +62,7 @@
}
@Test
- void testNoDeprecated() {
+ public void testNoDeprecated() {
javadoc("-d", "out-nodepr",
"-sourcepath", testSrc,
"-use",
--- a/test/langtools/jdk/javadoc/doclet/testPackageDescription/TestPackageDescription.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testPackageDescription/TestPackageDescription.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,14 @@
* @test
* @bug 8185194 8182765
* @summary Test anchor for package description in package summary page
- * @library ../lib/
+ * @library ../../lib/
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester TestPackageDescription
+ * @build javadoc.tester.* TestPackageDescription
* @run main TestPackageDescription
*/
+import javadoc.tester.JavadocTester;
+
public class TestPackageDescription extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
@@ -53,7 +55,7 @@
}
@Test
- void test2() {
+ public void test2() {
javadoc("-d", "out-2",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testPackageHtml/TestPackageHtml.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testPackageHtml/TestPackageHtml.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -25,12 +25,14 @@
* @test
* @bug 8150096 8179704
* @summary test package.html handling
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestPackageHtml
*/
+import javadoc.tester.JavadocTester;
+
public class TestPackageHtml extends JavadocTester {
public static void main(String... args) throws Exception {
TestPackageHtml tester = new TestPackageHtml();
@@ -39,7 +41,7 @@
// Make sure package.html is recognized by doclint
@Test
- void testPackageHtml() {
+ public void testPackageHtml() {
javadoc("-d", "out-pkg-html-1",
"-sourcepath", testSrc,
"pkg1");
@@ -51,7 +53,7 @@
// ignore html comment in the first sentence and must
// ignore trailing whitespace in a first sentence.
@Test
- void testPackageHtmlWithEmptyBody() {
+ public void testPackageHtmlWithEmptyBody() {
javadoc("-d", "out-pkg-html-2",
"-sourcepath", testSrc,
"pkg2", "pkg3", "pkg4");
--- a/test/langtools/jdk/javadoc/doclet/testPackagePage/TestPackagePage.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testPackagePage/TestPackagePage.java Fri Dec 21 10:38:33 2018 -0800
@@ -28,12 +28,14 @@
* passed to Javadoc. Also test that the proper package links are generated
* when single or multiple packages are documented.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestPackagePage
*/
+import javadoc.tester.JavadocTester;
+
public class TestPackagePage extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
}
@Test
- void testSinglePackage() {
+ public void testSinglePackage() {
javadoc("-d", "out-1",
"-sourcepath", testSrc,
testSrc("com/pkg/C.java"));
@@ -69,7 +71,7 @@
@Test
- void testMultiplePackages() {
+ public void testMultiplePackages() {
javadoc("-d", "out-2",
"-sourcepath", testSrc,
"com.pkg", "pkg2");
--- a/test/langtools/jdk/javadoc/doclet/testPackageSummary/TestPackageSummary.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testPackageSummary/TestPackageSummary.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @test
* @bug 8189841
* @summary Error in alternate row coloring in package-summary files
- * @library ../lib/
+ * @library ../../lib/
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester TestPackageSummary
+ * @build javadoc.tester.* TestPackageSummary
* @run main TestPackageSummary
*/
+import javadoc.tester.JavadocTester;
+
public class TestPackageSummary extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void testStripes() {
+ public void testStripes() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
--- a/test/langtools/jdk/javadoc/doclet/testParamTaglet/TestParamTaglet.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testParamTaglet/TestParamTaglet.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -28,12 +28,14 @@
* match up with a real parameters.
* Make sure inheritDoc cannot be used in an invalid param tag.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestParamTaglet
*/
+import javadoc.tester.JavadocTester;
+
public class TestParamTaglet extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
--- a/test/langtools/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testPrivateClasses/TestPrivateClasses.java Fri Dec 21 10:38:33 2018 -0800
@@ -37,11 +37,13 @@
* Make sure when no modifier appear in the class signature, the
* signature is displayed correctly without extra space at the beginning.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestPrivateClasses
*/
+import javadoc.tester.JavadocTester;
+
public class TestPrivateClasses extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -50,7 +52,7 @@
}
@Test
- void testDefault() {
+ public void testDefault() {
javadoc("-d", "out-default",
"-sourcepath", testSrc,
"pkg", "pkg2");
@@ -139,7 +141,7 @@
}
@Test
- void testDefault_html4() {
+ public void testDefault_html4() {
javadoc("-d", "out-default-html4",
"-html4",
"-sourcepath", testSrc,
@@ -175,7 +177,7 @@
}
@Test
- void testPrivate() {
+ public void testPrivate() {
javadoc("-d", "out-private",
"-sourcepath", testSrc,
"-private",
@@ -269,7 +271,7 @@
}
@Test
- void testPrivate_html4() {
+ public void testPrivate_html4() {
javadoc("-d", "out-private-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testProperty/TestProperty.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testProperty/TestProperty.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,14 @@
* @test
* @bug 8176231 8189843 8182765 8203791
* @summary Test JavaFX property.
- * @library ../lib/
+ * @library ../../lib/
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester TestProperty
+ * @build javadoc.tester.* TestProperty
* @run main TestProperty
*/
+import javadoc.tester.JavadocTester;
+
public class TestProperty extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void testArrays() {
+ public void testArrays() {
javadoc("-d", "out",
"-javafx",
"--disable-javafx-strict-checks",
@@ -110,7 +112,7 @@
}
@Test
- void testArrays_html4() {
+ public void testArrays_html4() {
javadoc("-d", "out-html4",
"-html4",
"-javafx",
--- a/test/langtools/jdk/javadoc/doclet/testRecurseSubPackages/TestRecurseSubPackages.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testRecurseSubPackages/TestRecurseSubPackages.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 4074234 8196202
* @summary Make Javadoc capable of traversing/recursing all of given subpackages.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestRecurseSubPackages
*/
+import javadoc.tester.JavadocTester;
+
public class TestRecurseSubPackages extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"--frames",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testRelativeLinks/TestRelativeLinks.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testRelativeLinks/TestRelativeLinks.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* @summary Test to make sure that relative paths are redirected in the
* output so that they are not broken.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestRelativeLinks
*/
+import javadoc.tester.JavadocTester;
+
public class TestRelativeLinks extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-use",
"--frames",
@@ -97,7 +99,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-use",
--- a/test/langtools/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testRepeatedAnnotations/TestRepeatedAnnotations.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 8005092 6469562 8182765
* @summary Test repeated annotations output.
* @author bpatel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestRepeatedAnnotations
*/
+import javadoc.tester.JavadocTester;
+
public class TestRepeatedAnnotations extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg", "pkg1");
@@ -136,7 +138,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testReturnTag/TestReturnTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testReturnTag/TestReturnTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -26,12 +26,14 @@
* @bug 4490068
* @summary Warn when a return tag is used on a method without a return type.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestReturnTag
*/
+import javadoc.tester.JavadocTester;
+
public class TestReturnTag extends JavadocTester {
/**
@@ -47,7 +49,7 @@
}
@Test
- void tests() {
+ public void tests() {
javadoc("-Xdoclint:none",
"-d", "out",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java Fri Dec 21 10:38:33 2018 -0800
@@ -28,11 +28,13 @@
* 8184205 8214468
* @summary Test the search feature of javadoc.
* @author bpatel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSearch
*/
+import javadoc.tester.JavadocTester;
+
public class TestSearch extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out-1",
"-sourcepath",
"-use",
@@ -63,7 +65,7 @@
}
@Test
- void test2() {
+ public void test2() {
javadoc("-d", "out-2",
"-Xdoclint:none",
"-sourcepath", testSrc,
@@ -90,7 +92,7 @@
}
@Test
- void test2_html4() {
+ public void test2_html4() {
javadoc("-d", "out-2-html4",
"-html4",
"-Xdoclint:none",
@@ -102,7 +104,7 @@
}
@Test
- void test2a() {
+ public void test2a() {
javadoc("-d", "out-2a",
"-Xdoclint:all",
"-sourcepath", testSrc,
@@ -128,7 +130,7 @@
}
@Test
- void test2a_html4() {
+ public void test2a_html4() {
javadoc("-d", "out-2a-html4",
"-html4",
"-Xdoclint:all",
@@ -139,7 +141,7 @@
}
@Test
- void test3() {
+ public void test3() {
javadoc("-d", "out-3",
"-noindex",
"-Xdoclint:none",
@@ -165,7 +167,7 @@
}
@Test
- void test4() {
+ public void test4() {
javadoc("-d", "out-4",
"-html5",
"-Xdoclint:none",
@@ -191,7 +193,7 @@
}
@Test
- void test5() {
+ public void test5() {
javadoc("-d", "out-5",
"-html5",
"-noindex",
@@ -216,7 +218,7 @@
}
@Test
- void test6() {
+ public void test6() {
javadoc("-d", "out-6",
"-nocomment",
"-Xdoclint:none",
@@ -241,7 +243,7 @@
}
@Test
- void test7() {
+ public void test7() {
javadoc("-d", "out-7",
"-nodeprecated",
"-Xdoclint:none",
@@ -267,7 +269,7 @@
}
@Test
- void test8() {
+ public void test8() {
javadoc("-d", "out-8",
"-splitindex",
"-Xdoclint:none",
@@ -294,7 +296,7 @@
}
@Test
- void test9() {
+ public void test9() {
javadoc("-d", "out-9",
"-sourcepath", testSrc,
"-javafx",
@@ -321,7 +323,7 @@
}
@Test
- void testNoModuleDirectories() {
+ public void testNoModuleDirectories() {
javadoc("-d", "out-noMdlDir",
"--no-module-directories",
"-Xdoclint:none",
@@ -335,7 +337,7 @@
}
@Test
- void testURLEncoding() {
+ public void testURLEncoding() {
javadoc("-d", "out-encode-html5",
"--no-module-directories",
"-Xdoclint:none",
@@ -348,7 +350,7 @@
}
@Test
- void testURLEncoding_html4() {
+ public void testURLEncoding_html4() {
javadoc("-d", "out-encode-html4",
"-html4",
"--no-module-directories",
@@ -363,7 +365,7 @@
}
@Test
- void testJapaneseLocale() {
+ public void testJapaneseLocale() {
javadoc("-locale", "ja_JP",
"-d", "out-jp",
"--no-module-directories",
@@ -382,7 +384,7 @@
}
@Test
- void testChineseLocale() {
+ public void testChineseLocale() {
javadoc("-locale", "zh_CN",
"-d", "out-cn",
"--no-module-directories",
--- a/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 8017191 8182765 8200432
* @summary Javadoc is confused by at-link to imported classes outside of the set of generated packages
* @author jjg
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSeeTag
*/
+import javadoc.tester.JavadocTester;
+
public class TestSeeTag extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
@@ -67,7 +69,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
@@ -86,7 +88,7 @@
}
@Test
- void testBadReference() {
+ public void testBadReference() {
javadoc("-d", "out-badref",
"-sourcepath", testSrc,
"badref");
--- a/test/langtools/jdk/javadoc/doclet/testSerialTag/TestSerialTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSerialTag/TestSerialTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,9 +25,9 @@
* @test
* @bug 8207214
* @summary Test package-level at-serial tags
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox
+ * @build javadoc.tester.* toolbox.ToolBox
* @run main TestSerialTag
*/
@@ -36,6 +36,8 @@
import toolbox.ToolBox;
+import javadoc.tester.JavadocTester;
+
public class TestSerialTag extends JavadocTester {
public static void main(String... args) throws Exception {
TestSerialTag tester = new TestSerialTag();
--- a/test/langtools/jdk/javadoc/doclet/testSerialVersionUID/TestSerialVersionUID.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSerialVersionUID/TestSerialVersionUID.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -27,12 +27,14 @@
* @summary Test to make sure that the serialVersionUID is properly
* documented in the serialized form.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSerialVersionUID
*/
+import javadoc.tester.JavadocTester;
+
public class TestSerialVersionUID extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
testSrc("C.java"));
checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/testSerializedForm/TestSerializedForm.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSerializedForm/TestSerializedForm.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, 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
@@ -32,15 +32,17 @@
* in the serialized form page.
* Make sure see tags work in serialized form.
* @author jamieh
- * @library ../lib/
+ * @library ../../lib/
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @build TestSerializedForm
* @run main TestSerializedForm
*/
import java.io.*;
+import javadoc.tester.JavadocTester;
+
public class TestSerializedForm extends JavadocTester {
public static void main(String... args) throws Exception {
TestSerializedForm tester = new TestSerializedForm();
@@ -52,7 +54,7 @@
// @ignore 8146022
// @Test
- void testDefault() {
+ public void testDefault() {
javadoc("-d", "out-default", "-serialwarn", "-Xdoclint:none",
"-sourcepath", testSrc,
testSrc("SerializedForm.java"), testSrc("ExternalizedForm.java"), "pkg1");
@@ -100,7 +102,7 @@
}
@Test
- void testPrivate() {
+ public void testPrivate() {
javadoc("-private",
"-d", "out-private",
"-sourcepath", testSrc,
@@ -142,7 +144,7 @@
}
@Test
- void test2() {
+ public void test2() {
javadoc("-private",
"-d", "out-2",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 6802694 8025633 8026567 8183511 8074407 8182765
* @summary This test verifies deprecation info in serialized-form.html.
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSerializedFormDeprecationInfo
*/
+import javadoc.tester.JavadocTester;
+
public class TestSerializedFormDeprecationInfo extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void testDefault() {
+ public void testDefault() {
javadoc("-d", "out-default",
"-sourcepath", testSrc,
"pkg1");
@@ -51,7 +53,7 @@
}
@Test
- void testNoComment() {
+ public void testNoComment() {
javadoc("-d", "out-nocmnt",
"-nocomment",
"-sourcepath", testSrc,
@@ -63,7 +65,7 @@
}
@Test
- void testNoDeprecated() {
+ public void testNoDeprecated() {
javadoc("-d", "out-nodepr",
"-nodeprecated",
"-sourcepath", testSrc,
@@ -75,7 +77,7 @@
}
@Test
- void testNoCommentNoDeprecated() {
+ public void testNoCommentNoDeprecated() {
javadoc("-d", "out-nocmnt-nodepr",
"-nocomment",
"-nodeprecated",
--- a/test/langtools/jdk/javadoc/doclet/testSerializedFormWithClassFile/TestSerializedFormWithClassFile.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSerializedFormWithClassFile/TestSerializedFormWithClassFile.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,12 @@
* @test
* @bug 8199307
* @summary NPE in jdk.javadoc.internal.doclets.toolkit.util.Utils.getLineNumber
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules
* jdk.javadoc/jdk.javadoc.internal.tool
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSerializedFormWithClassFile
*/
@@ -43,6 +43,8 @@
import toolbox.ToolBox;
import toolbox.JavacTask;
+import javadoc.tester.JavadocTester;
+
public class TestSerializedFormWithClassFile extends JavadocTester {
final ToolBox tb;
@@ -57,7 +59,7 @@
}
@Test
- void test(Path base) throws Exception {
+ public void test(Path base) throws Exception {
Path srcDir = base.resolve("src");
createTestClass(base, srcDir);
--- a/test/langtools/jdk/javadoc/doclet/testSerializedFormWithSee/TestSerializedFormWithSee.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSerializedFormWithSee/TestSerializedFormWithSee.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,9 +25,9 @@
* @test
* @bug 8207214
* @summary Test serialized forms, with at-see to other members
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox
+ * @build javadoc.tester.* toolbox.ToolBox
* @run main TestSerializedFormWithSee
*/
@@ -46,6 +46,8 @@
* to {@code checkLinks}, to verify that there are no broken
* links in the generated files.
*/
+import javadoc.tester.JavadocTester;
+
public class TestSerializedFormWithSee extends JavadocTester {
public static void main(String... args) throws Exception {
--- a/test/langtools/jdk/javadoc/doclet/testSimpleTag/TestSimpleTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSimpleTag/TestSimpleTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -29,12 +29,14 @@
* you can escape the ":" character with a back slash so that it is not
* considered a separator when parsing the simple tag argument.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSimpleTag
*/
+import javadoc.tester.JavadocTester;
+
public class TestSimpleTag extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-tag", "param",
--- a/test/langtools/jdk/javadoc/doclet/testSimpleTagExclude/TestSimpleTagExclude.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSimpleTagExclude/TestSimpleTagExclude.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -27,12 +27,14 @@
* @summary Test the parsing of the -tag option. The user should be able to
* exclude a simple tag by using -tag tagname:X
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSimpleTagExclude
*/
+import javadoc.tester.JavadocTester;
+
public class TestSimpleTagExclude extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-tag", "todo:X",
--- a/test/langtools/jdk/javadoc/doclet/testSimpleTagInherit/TestSimpleTagInherit.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSimpleTagInherit/TestSimpleTagInherit.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -25,12 +25,14 @@
* @test
* @bug 8008768 8026567
* @summary Using {@inheritDoc} in simple tag defined via -tag fails
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSimpleTagInherit
*/
+import javadoc.tester.JavadocTester;
+
public class TestSimpleTagInherit extends JavadocTester {
//Javadoc arguments.
@@ -49,7 +51,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-tag", "custom:optcm:<em>Custom:</em>",
--- a/test/langtools/jdk/javadoc/doclet/testSinceTag/TestSinceTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSinceTag/TestSinceTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -26,12 +26,14 @@
* @bug 7180906 8026567
* @summary Test to make sure that the since tag works correctly
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSinceTag
*/
+import javadoc.tester.JavadocTester;
+
public class TestSinceTag extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void testSince() {
+ public void testSince() {
javadoc("-d", "out-since",
"-sourcepath", testSrc,
"pkg1");
@@ -51,7 +53,7 @@
}
@Test
- void testNoSince() {
+ public void testNoSince() {
javadoc("-d", "out-nosince",
"-sourcepath", testSrc,
"-nosince",
--- a/test/langtools/jdk/javadoc/doclet/testSingleQuotedLink/TestSingleQuotedLink.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSingleQuotedLink/TestSingleQuotedLink.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, 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
@@ -26,11 +26,13 @@
* @bug 6457406
* @summary Verify that a link in single quotes copied to the class-use page as is.
* @author Yuri Nesterenko
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSingleQuotedLink
*/
+import javadoc.tester.JavadocTester;
+
public class TestSingleQuotedLink extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void run() {
+ public void run() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-use",
--- a/test/langtools/jdk/javadoc/doclet/testSourceTab/TestSourceTab.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSourceTab/TestSourceTab.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -27,14 +27,16 @@
* @summary Test to make sure that the source documentation is indented properly
* when -linksourcetab is used.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSourceTab
*/
import java.io.*;
+import javadoc.tester.JavadocTester;
+
public class TestSourceTab extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
}
@Test
- void test() throws Exception {
+ public void test() throws Exception {
String tmpSrcDir = "tmpSrc";
String outdir1 = "out-tabLengthEight";
String outdir2 = "out-tabLengthFour";
--- a/test/langtools/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* 8175218 8176452 8181215 8182263 8183511 8169819 8183037 8185369 8182765 8196201 8184205
* @summary Run tests on doclet stylesheet.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestStylesheet
*/
+import javadoc.tester.JavadocTester;
+
public class TestStylesheet extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
@@ -242,7 +244,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testStylesheetOverwrite/TestStylesheetOverwrite.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testStylesheetOverwrite/TestStylesheetOverwrite.java Fri Dec 21 10:38:33 2018 -0800
@@ -24,9 +24,9 @@
* @test
* @bug 8196913
* @summary javadoc does not (over)write stylesheet.css
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox builder.ClassBuilder
+ * @build javadoc.tester.* toolbox.ToolBox builder.ClassBuilder
* @run main TestStylesheetOverwrite
*/
@@ -38,6 +38,8 @@
import builder.ClassBuilder;
import toolbox.ToolBox;
+import javadoc.tester.JavadocTester;
+
public class TestStylesheetOverwrite extends JavadocTester {
final ToolBox tb;
@@ -51,7 +53,7 @@
}
@Test
- void testStylesheetFile(Path base) throws Exception {
+ public void testStylesheetFile(Path base) throws Exception {
Path srcDir = base.resolve("src");
createTestClass(srcDir);
--- a/test/langtools/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSubTitle/TestSubTitle.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 7010342 8150000 8174974
* @summary Test for correct sub title generation.
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSubTitle
*/
+import javadoc.tester.JavadocTester;
+
public class TestSubTitle extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
--- a/test/langtools/jdk/javadoc/doclet/testSummaryHeading/TestSummaryHeading.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSummaryHeading/TestSummaryHeading.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -28,12 +28,14 @@
* "Method Summary" heading should still show up since the class
* inherits methods.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSummaryHeading
*/
+import javadoc.tester.JavadocTester;
+
public class TestSummaryHeading extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
testSrc("C.java"));
--- a/test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,14 @@
* @test
* @bug 8173425 8186332 8182765 8196202
* @summary tests for the summary tag behavior
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSummaryTag
*/
+import javadoc.tester.JavadocTester;
+
public class TestSummaryTag extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out1",
"-sourcepath", testSrc,
"p1");
@@ -95,7 +97,7 @@
}
@Test
- void test1_html4() {
+ public void test1_html4() {
javadoc("-d", "out1-html4",
"-html4",
"-sourcepath", testSrc,
@@ -139,7 +141,7 @@
}
@Test
- void test2() {
+ public void test2() {
javadoc("-d", "out2",
"-sourcepath", testSrc,
"p2");
@@ -153,7 +155,7 @@
}
@Test
- void test3() {
+ public void test3() {
javadoc("-d", "out3",
"--frames",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testSuperclassInSerialForm/TestSuperClassInSerialForm.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSuperclassInSerialForm/TestSuperClassInSerialForm.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -27,12 +27,14 @@
* @summary Test to make sure link to superclass is generated for
* each class in serialized form page.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSuperClassInSerialForm
*/
+import javadoc.tester.JavadocTester;
+
public class TestSuperClassInSerialForm extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
--- a/test/langtools/jdk/javadoc/doclet/testSupplementary/TestSupplementary.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSupplementary/TestSupplementary.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -27,14 +27,16 @@
* @summary Test to make sure that "see" tag and "serialField" tag handle supplementary
* characters correctly. This test case needs to be run in en_US locale.
* @author Naoto Sato
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSupplementary
*/
import java.util.Locale;
+import javadoc.tester.JavadocTester;
+
public class TestSupplementary extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -48,7 +50,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-locale", "en_US",
"-d", "out",
testSrc("C.java"));
--- a/test/langtools/jdk/javadoc/doclet/testSystemPropertyTaglet/TestSystemPropertyTaglet.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testSystemPropertyTaglet/TestSystemPropertyTaglet.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,9 +25,9 @@
* @test
* @bug 5076751
* @summary System properties documentation needed in javadocs
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox builder.ClassBuilder
+ * @build javadoc.tester.* toolbox.ToolBox builder.ClassBuilder
* @run main TestSystemPropertyTaglet
*/
@@ -39,6 +39,8 @@
import builder.ClassBuilder.MethodBuilder;
import toolbox.ToolBox;
+import javadoc.tester.JavadocTester;
+
public class TestSystemPropertyTaglet extends JavadocTester {
final ToolBox tb;
@@ -53,7 +55,7 @@
}
@Test
- void test(Path base) throws Exception {
+ public void test(Path base) throws Exception {
Path srcDir = base.resolve("src");
Path outDir = base.resolve("out");
@@ -97,7 +99,7 @@
}
@Test
- void testSystemProperytWithinATag(Path base) throws Exception {
+ public void testSystemProperytWithinATag(Path base) throws Exception {
Path srcDir = base.resolve("src");
Path outDir = base.resolve("out");
--- a/test/langtools/jdk/javadoc/doclet/testTagInheritence/TestTagInheritence.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testTagInheritence/TestTagInheritence.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -26,13 +26,15 @@
* @bug 4496223 4496270 4618686 4720974 4812240 6253614 6253604
* @summary <DESC>
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestTagInheritence
*/
// TODO: Inheritence should be Inheritance! fix separately as noreg-trivial
+import javadoc.tester.JavadocTester;
+
public class TestTagInheritence extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-Xdoclint:none",
"-d", "out",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testTagMisuse/TestTagMisuse.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testTagMisuse/TestTagMisuse.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, 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
@@ -25,12 +25,14 @@
* @test
* @summary Determine if proper warning messages are printed.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @build TestTagMisuse
* @run main TestTagMisuse
*/
+import javadoc.tester.JavadocTester;
+
public class TestTagMisuse extends JavadocTester {
/**
@@ -44,7 +46,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-Xdoclint:none",
"-d", "out",
testSrc("TestTagMisuse.java"));
--- a/test/langtools/jdk/javadoc/doclet/testTagOutput/TestTagOutput.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testTagOutput/TestTagOutput.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -26,12 +26,14 @@
* @bug 8026370 8026567 8183511 8074407
* @summary This test checks the generated tag output.
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestTagOutput
*/
+import javadoc.tester.JavadocTester;
+
public class TestTagOutput extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg1");
--- a/test/langtools/jdk/javadoc/doclet/testTaglets/TestTaglets.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testTaglets/TestTaglets.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,9 +25,9 @@
* @test
* @bug 8202947
* @summary Test TagletManager initialization
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build toolbox.ToolBox JavadocTester
+ * @build toolbox.ToolBox javadoc.tester.*
* @run main TestTaglets
*/
@@ -37,6 +37,7 @@
import java.nio.file.Paths;
import java.util.List;
+import javadoc.tester.JavadocTester;
import toolbox.ToolBox;
/*
@@ -62,7 +63,7 @@
}
@Test
- void test() throws Exception {
+ public void test() throws Exception {
javadoc("-d", "out",
"-javafx",
"--show-taglets",
--- a/test/langtools/jdk/javadoc/doclet/testThrowsHead/TestThrowsHead.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testThrowsHead/TestThrowsHead.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -28,12 +28,14 @@
* not documented with a throws tag, we generate a link to it in the
* throws section. Make sure that the link is below a Throws heading.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestThrowsHead
*/
+import javadoc.tester.JavadocTester;
+
public class TestThrowsHead extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
testSrc("C.java"));
checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/testThrowsInheritence/TestThrowsTagInheritence.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testThrowsInheritence/TestThrowsTagInheritence.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -28,13 +28,15 @@
* override the throws tags in interface. This test also verifies that throws tags are inherited properly
* the case where the name of one exception is not fully qualified.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestThrowsTagInheritence
*/
// TODO: should be TestThrowsInheritance!
+import javadoc.tester.JavadocTester;
+
public class TestThrowsTagInheritence extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -43,7 +45,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
testSrc("C.java"),
@@ -62,7 +64,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out-1",
"-sourcepath", testSrc,
"-package", "pkg");
--- a/test/langtools/jdk/javadoc/doclet/testThrowsTag/TestThrowsTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testThrowsTag/TestThrowsTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* @summary Test to make sure that exceptions always show up in the
* correct order.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestThrowsTag
*/
+import javadoc.tester.JavadocTester;
+
public class TestThrowsTag extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"pkg");
--- a/test/langtools/jdk/javadoc/doclet/testTitleInHref/TestTitleInHref.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testTitleInHref/TestTitleInHref.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 4714257 8164407 8205593
* @summary Test to make sure that the title attribute shows up in links.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestTitleInHref
*/
+import javadoc.tester.JavadocTester;
+
public class TestTitleInHref extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
String uri = "http://java.sun.com/j2se/1.4/docs/api";
javadoc("-d", "out",
"-source", "8",
--- a/test/langtools/jdk/javadoc/doclet/testTopOption/TestTopOption.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testTopOption/TestTopOption.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,12 +26,14 @@
* @bug 6227616 8043186 8196202
* @summary Test the new -top option.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestTopOption
*/
+import javadoc.tester.JavadocTester;
+
public class TestTopOption extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-overview", testSrc("overview.html"),
"-use",
"-top", "TOP TEXT",
@@ -64,7 +66,7 @@
}
@Test
- void testDocRootRewrite() {
+ public void testDocRootRewrite() {
javadoc("-overview", testSrc("overview.html"),
"-use",
"-top", "\u0130{@docroot}TOP TEXT",
--- a/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* 8187288
* @summary Make sure that type annotations are displayed correctly
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestTypeAnnotations
*/
+import javadoc.tester.JavadocTester;
+
public class TestTypeAnnotations extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-private",
@@ -720,7 +722,7 @@
}
@Test
- void test_html4() {
+ public void test_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testTypeParams/TestTypeParameters.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testTypeParams/TestTypeParameters.java Fri Dec 21 10:38:33 2018 -0800
@@ -30,12 +30,14 @@
* class-use pages. The class/annotation pages should check for type
* parameter links in the class/annotation signature section when -linksource is set.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestTypeParameters
*/
+import javadoc.tester.JavadocTester;
+
public class TestTypeParameters extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -44,7 +46,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out-1",
"-use",
"-sourcepath", testSrc,
@@ -74,7 +76,7 @@
}
@Test
- void test1_html4() {
+ public void test1_html4() {
javadoc("-d", "out-1-html4",
"-html4",
"-use",
@@ -90,7 +92,7 @@
}
@Test
- void test2() {
+ public void test2() {
javadoc("-d", "out-2",
"-linksource",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testTypeVariableLinks/TestTypeVariableLinks.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testTypeVariableLinks/TestTypeVariableLinks.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,14 @@
* @test
* @bug 8174805 8182765
* @summary JavacTrees should use Types.skipTypeVars() to get the upper bound of type variables
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestTypeVariableLinks
*/
+import javadoc.tester.JavadocTester;
+
public class TestTypeVariableLinks extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-package",
@@ -57,7 +59,7 @@
}
@Test
- void test1_html4() {
+ public void test1_html4() {
javadoc("-d", "out-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testUnicode/TestUnicode.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testUnicode/TestUnicode.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,9 +25,9 @@
* @test
* @bug 8203176
* @summary javadoc handles non-ASCII characters incorrectly
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build toolbox.ToolBox JavadocTester
+ * @build toolbox.ToolBox javadoc.tester.*
* @run main TestUnicode
*/
@@ -35,6 +35,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
+import javadoc.tester.JavadocTester;
import toolbox.ToolBox;
public class TestUnicode extends JavadocTester {
@@ -47,7 +48,7 @@
ToolBox tb = new ToolBox();
@Test
- void test() throws Exception {
+ public void test() throws Exception {
char ellipsis = '\u2026';
Path src = Files.createDirectories(Paths.get("src"));
tb.writeJavaFiles(src,
--- a/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* @summary Reference unnamed package as "Unnamed", not empty string.
* Generate a package summary for the unnamed package.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestUnnamedPackage
*/
+import javadoc.tester.JavadocTester;
+
public class TestUnnamedPackage extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
testSrc("C.java"));
--- a/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,12 +27,14 @@
* 8182765 8196202
* @summary A simple test to ensure class-use files are correct.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestUseOption
*/
+import javadoc.tester.JavadocTester;
+
public class TestUseOption extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out-1",
"-sourcepath", testSrc,
"-use",
@@ -142,7 +144,7 @@
}
@Test
- void test1_html4() {
+ public void test1_html4() {
javadoc("-d", "out-1-html4",
"-html4",
"-sourcepath", testSrc,
@@ -181,7 +183,7 @@
}
@Test
- void test2() {
+ public void test2() {
javadoc("-d", "out-2",
"-sourcepath", testSrc,
"-use",
@@ -205,7 +207,7 @@
}
@Test
- void test2_html4() {
+ public void test2_html4() {
javadoc("-d", "out-2-html4",
"-html4",
"-sourcepath", testSrc,
@@ -223,7 +225,7 @@
}
@Test
- void test3() {
+ public void test3() {
javadoc("-d", "out-3",
"-sourcepath", testSrc,
"-use",
@@ -237,7 +239,7 @@
}
@Test
- void test3_html4() {
+ public void test3_html4() {
javadoc("-d", "out-3-html4",
"-html4",
"-sourcepath", testSrc,
--- a/test/langtools/jdk/javadoc/doclet/testUserTaglet/TestUserTaglet.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testUserTaglet/TestUserTaglet.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,12 +25,14 @@
* @test
* @bug 8176836 8201817
* @summary Provide Taglet with context
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester InfoTaglet
+ * @build javadoc.tester.* InfoTaglet
* @run main TestUserTaglet
*/
+import javadoc.tester.JavadocTester;
+
public class TestUserTaglet extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-tagletpath", System.getProperty("test.class.path"),
--- a/test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -27,9 +27,9 @@
* @summary This test ensures that the value tag works in all
* use cases, the tests are explained below.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestValueTag
*/
@@ -39,6 +39,8 @@
import java.nio.file.Paths;
import java.util.List;
+import javadoc.tester.JavadocTester;
+
public class TestValueTag extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -47,7 +49,7 @@
}
@Test
- void test1() {
+ public void test1() {
javadoc("-d", "out1",
"-sourcepath", testSrc,
"-tag", "todo",
@@ -117,7 +119,7 @@
}
@Test
- void test2() {
+ public void test2() {
javadoc("-Xdoclint:none",
"-d", "out2",
"-sourcepath", testSrc,
@@ -140,7 +142,7 @@
}
@Test
- void test3() {
+ public void test3() {
javadoc("-d", "out3",
"-sourcepath", testSrc,
"pkg2", "pkg3");
@@ -156,7 +158,7 @@
}
@Test
- void test4() throws IOException {
+ public void test4() throws IOException {
Path base = Paths.get("test4");
Path src = base.resolve("src");
Files.createDirectories(src.resolve("p"));
--- a/test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTagInModule.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testValueTag/TestValueTagInModule.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,11 +25,11 @@
* @test
* @bug 8210244
* @summary {@value} should be permitted in module documentation
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestValueTagInModule
*/
@@ -40,6 +40,8 @@
import toolbox.ModuleBuilder;
import toolbox.ToolBox;
+import javadoc.tester.JavadocTester;
+
public class TestValueTagInModule extends JavadocTester {
final ToolBox tb;
@@ -54,7 +56,7 @@
}
@Test
- void test(Path base) throws Exception {
+ public void test(Path base) throws Exception {
Path srcDir = base.resolve("src");
createTestClass(srcDir);
--- a/test/langtools/jdk/javadoc/doclet/testVersionOption/TestVersionOption.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testVersionOption/TestVersionOption.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -25,12 +25,14 @@
* @test
* @bug 8177048
* @summary javadoc should support --version and --full-version flags
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester TestVersionOption
+ * @build javadoc.tester.* TestVersionOption
* @run main TestVersionOption
*/
+import javadoc.tester.JavadocTester;
+
public class TestVersionOption extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -39,7 +41,7 @@
}
@Test
- void testFullVersionOption() {
+ public void testFullVersionOption() {
javadoc("--full-version");
checkExit(Exit.OK);
@@ -48,7 +50,7 @@
@Test
- void testVersionOption() {
+ public void testVersionOption() {
javadoc("--version");
checkExit(Exit.OK);
--- a/test/langtools/jdk/javadoc/doclet/testVersionTag/TestVersionTag.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testVersionTag/TestVersionTag.java Fri Dec 21 10:38:33 2018 -0800
@@ -25,9 +25,9 @@
* @test
* @bug 8202947
* @summary test the at-version tag, and corresponding option
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build toolbox.ToolBox JavadocTester
+ * @build toolbox.ToolBox javadoc.tester.*
* @run main TestVersionTag
*/
@@ -35,6 +35,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
+import javadoc.tester.JavadocTester;
import toolbox.ToolBox;
public class TestVersionTag extends JavadocTester {
@@ -58,7 +59,7 @@
}
@Test
- void testVersion() {
+ public void testVersion() {
javadoc("-d", "out-version",
"-sourcepath", src.toString(),
"-version",
@@ -69,7 +70,7 @@
}
@Test
- void testNoVersion() {
+ public void testNoVersion() {
javadoc("-d", "out-noversion",
"-sourcepath", src.toString(),
"pkg");
--- a/test/langtools/jdk/javadoc/doclet/testVisibleMembers/TestVisibleMembers.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testVisibleMembers/TestVisibleMembers.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,9 +26,9 @@
* @bug 8025091 8198890
* @summary Verify the presence visible members in the case of
* member hiding and overridding.
- * @library /tools/lib ../lib
+ * @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester toolbox.ToolBox builder.ClassBuilder
+ * @build javadoc.tester.* toolbox.ToolBox builder.ClassBuilder
* @run main TestVisibleMembers
*/
@@ -43,6 +43,8 @@
import toolbox.ToolBox;
import builder.ClassBuilder;
+import javadoc.tester.JavadocTester;
+
public class TestVisibleMembers extends JavadocTester {
final ToolBox tb;
@@ -56,7 +58,7 @@
}
@Test
- void testChronoDiamondLeafDetail(Path base) throws Exception {
+ public void testChronoDiamondLeafDetail(Path base) throws Exception {
Path srcDir = base.resolve("src");
emitChronoDiamondLeaf(srcDir);
@@ -84,7 +86,7 @@
}
@Test
- void testChronoDiamondLeafSummary(Path base) throws Exception {
+ public void testChronoDiamondLeafSummary(Path base) throws Exception {
Path srcDir = base.resolve("src");
emitChronoDiamondLeaf(srcDir);
@@ -182,7 +184,7 @@
}
@Test
- void testNestedInterfaceDetail(Path base) throws Exception {
+ public void testNestedInterfaceDetail(Path base) throws Exception {
Path srcDir = base.resolve("src");
emitNestedInterface(srcDir);
@@ -202,7 +204,7 @@
}
@Test
- void testNestedInterfaceSummary(Path base) throws Exception {
+ public void testNestedInterfaceSummary(Path base) throws Exception {
Path srcDir = base.resolve("src");
emitNestedInterface(srcDir);
@@ -256,7 +258,7 @@
}
@Test
- void testStreamsMissingLinksDetail(Path base) throws Exception {
+ public void testStreamsMissingLinksDetail(Path base) throws Exception {
Path srcDir = base.resolve("src");
emitStreamsMissingLinks(srcDir);
@@ -291,7 +293,7 @@
}
@Test
- void testStreamsMissingLinksSummary(Path base) throws Exception {
+ public void testStreamsMissingLinksSummary(Path base) throws Exception {
Path srcDir = base.resolve("src");
emitStreamsMissingLinks(srcDir);
@@ -395,7 +397,7 @@
}
@Test
- void testVisibleMemberTableDetail(Path base) throws Exception {
+ public void testVisibleMemberTableDetail(Path base) throws Exception {
Path srcDir = base.resolve("src");
emitVisibleMemberTable(srcDir);
@@ -447,7 +449,7 @@
}
@Test
- void testVisibleMemberTableSummary(Path base) throws Exception {
+ public void testVisibleMemberTableSummary(Path base) throws Exception {
Path srcDir = base.resolve("src");
emitVisibleMemberTable(srcDir);
@@ -569,7 +571,7 @@
}
@Test
- void testHiddenMembersDetail(Path base) throws Exception {
+ public void testHiddenMembersDetail(Path base) throws Exception {
Path srcDir = base.resolve("src");
emitHiddenMembers(srcDir);
@@ -604,7 +606,7 @@
}
@Test
- void testHiddenMembersSummary(Path base) throws Exception {
+ public void testHiddenMembersSummary(Path base) throws Exception {
Path srcDir = base.resolve("src");
emitHiddenMembers(srcDir);
--- a/test/langtools/jdk/javadoc/doclet/testWarnBadParamNames/TestWarnBadParamNames.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testWarnBadParamNames/TestWarnBadParamNames.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, 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
@@ -27,12 +27,14 @@
* @summary Test to make sure that warning is printed when bad parameter
* name is used with param.
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestWarnBadParamNames
*/
+import javadoc.tester.JavadocTester;
+
public class TestWarnBadParamNames extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-Xdoclint:none",
"-d", "out",
testSrc("C.java"));
--- a/test/langtools/jdk/javadoc/doclet/testWarnings/TestWarnings.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testWarnings/TestWarnings.java Fri Dec 21 10:38:33 2018 -0800
@@ -30,12 +30,14 @@
* a "link unresolved" warning.
* Make sure error message starts with "error -".
* @author jamieh
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestWarnings
*/
+import javadoc.tester.JavadocTester;
+
public class TestWarnings extends JavadocTester {
public static void main(String... args) throws Exception {
TestWarnings tester = new TestWarnings();
@@ -43,7 +45,7 @@
}
@Test
- void testDefault() {
+ public void testDefault() {
javadoc("-d", "out-default",
"-sourcepath", testSrc,
"pkg");
@@ -70,7 +72,7 @@
}
@Test
- void testPrivate() {
+ public void testPrivate() {
javadoc("-d", "out-private",
"-private",
"-sourcepath", testSrc,
@@ -84,7 +86,7 @@
}
@Test
- void testPrivate_html4() {
+ public void testPrivate_html4() {
javadoc("-d", "out-private-html4",
"-html4",
"-private",
--- a/test/langtools/jdk/javadoc/doclet/testWindowTitle/TestWindowTitle.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testWindowTitle/TestWindowTitle.java Fri Dec 21 10:38:33 2018 -0800
@@ -26,11 +26,13 @@
* @bug 8016675 8026736 8196202
* @summary Test for window title.
* @author Bhavesh Patel
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestWindowTitle
*/
+import javadoc.tester.JavadocTester;
+
public class TestWindowTitle extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -40,7 +42,7 @@
}
@Test
- void testJavaScriptChars() {
+ public void testJavaScriptChars() {
// Window title with JavaScript special characters.
String title = "Testing \"Window 'Title'\" with a \\ backslash and a / "
+ "forward slash and a \u00e8 unicode char also a tab and also a "
@@ -67,7 +69,7 @@
}
@Test
- void testScriptTag() {
+ public void testScriptTag() {
// Window title with a script tag.
String title = "Testing script tag in title </title><script>alert(\"Should not pop up\")</script>.";
@@ -100,7 +102,7 @@
}
@Test
- void testHtmlTags() {
+ public void testHtmlTags() {
// Window title with other HTML tags.
String title = "Testing another <p>HTML</p> tag. Another <h1>tag</h1>. A "
+ "<span id=\"testTag\">tag with attributes</span>. <script and </p are not tags.";
@@ -125,7 +127,7 @@
}
@Test
- void testHtmlEntities() {
+ public void testHtmlEntities() {
// Window title using entities.
String title = "Testing entities <script>alert(\"Should not pop up\")</script>.";
@@ -146,7 +148,7 @@
}
@Test
- void testEmptyTags() {
+ public void testEmptyTags() {
// Window title with just empty HTML tags.
String title = "</title><script></script>";
@@ -166,7 +168,7 @@
}
@Test
- void testUnicode() {
+ public void testUnicode() {
//Window title with unicode characters.
String title = "Testing unicode \u003cscript\u003ealert(\"Should not pop up\")\u003c/script\u003e.";
@@ -189,7 +191,7 @@
}
@Test
- void testEmpty() {
+ public void testEmpty() {
// An empty window title.
String title = "";
javadoc("-d", "out-empty",
@@ -204,7 +206,7 @@
}
@Test
- void testDocTitle() {
+ public void testDocTitle() {
// Window title with JavaScript special characters, specified with -doctitle
String title = "Testing \"Window 'Title'\" with a \\ backslash and a / "
+ "forward slash and a \u00e8 unicode char also a tab and also a "
--- a/test/langtools/jdk/javadoc/doclet/testXOption/TestXOption.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/testXOption/TestXOption.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -25,15 +25,17 @@
* @test
* @bug 8007687
* @summary Make sure that the -X option works properly.
- * @library ../lib
+ * @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestXOption
*/
import java.util.*;
import java.util.stream.*;
+import javadoc.tester.JavadocTester;
+
public class TestXOption extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -42,7 +44,7 @@
}
@Test
- void testLineLengths() {
+ public void testLineLengths() {
javadoc("-d", "out1",
"-sourcepath", testSrc,
"-X",
@@ -62,7 +64,7 @@
}
@Test
- void testWithHelpExtraOption() {
+ public void testWithHelpExtraOption() {
javadoc("-d", "out1",
"-sourcepath", testSrc,
"--help-extra",
@@ -72,7 +74,7 @@
}
@Test
- void testWithOption() {
+ public void testWithOption() {
javadoc("-d", "out1",
"-sourcepath", testSrc,
"-X",
@@ -82,7 +84,7 @@
}
@Test
- void testWithoutOption() {
+ public void testWithoutOption() {
javadoc("-d", "out2",
"-sourcepath", testSrc,
testSrc("TestXOption.java"));
--- a/test/langtools/jdk/javadoc/doclet/typeAnnotations/smoke/TestSmoke.java Fri Dec 21 16:56:40 2018 +0100
+++ b/test/langtools/jdk/javadoc/doclet/typeAnnotations/smoke/TestSmoke.java Fri Dec 21 10:38:33 2018 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, 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
@@ -27,12 +27,14 @@
* @summary Smoke test for ensuring that annotations are emitted to javadoc
*
* @author Mahmood Ali <mali>
- * @library ../../lib
+ * @library ../../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
- * @build JavadocTester
+ * @build javadoc.tester.*
* @run main TestSmoke
*/
+import javadoc.tester.JavadocTester;
+
public class TestSmoke extends JavadocTester {
public static void main(String... args) throws Exception {
@@ -41,7 +43,7 @@
}
@Test
- void test() {
+ public void test() {
javadoc("-d", "out",
"-private",
"-sourcepath", testSrc,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/jdk/javadoc/lib/javadoc/tester/JavadocTester.java Fri Dec 21 10:38:33 2018 -0800
@@ -0,0 +1,1800 @@
+/*
+ * Copyright (c) 2002, 2018, 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 javadoc.tester;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.FilenameFilter;
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.lang.annotation.Annotation;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.ref.SoftReference;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CodingErrorAction;
+import java.nio.charset.UnsupportedCharsetException;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.function.Function;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+
+/**
+ * Test framework for running javadoc and performing tests on the resulting output.
+ *
+ * <p>
+ * Tests are typically written as subtypes of JavadocTester, with a main
+ * method that creates an instance of the test class and calls the runTests()
+ * method. The runTests() methods calls all the test methods declared in the class,
+ * and then calls a method to print a summary, and throw an exception if
+ * any of the test methods reported a failure.
+ *
+ * <p>
+ * Test methods are identified with a @Test annotation. They have no parameters.
+ * The name of the method is not important, but if you have more than one, it is
+ * recommended that the names be meaningful and suggestive of the test case
+ * contained therein.
+ *
+ * <p>
+ * Typically, a test method will invoke javadoc, and then perform various
+ * checks on the results. The standard checks are:
+ *
+ * <dl>
+ * <dt>checkExitCode
+ * <dd>Check the exit code returned from javadoc.
+ * <dt>checkOutput
+ * <dd>Perform a series of checks on the contents on a file or output stream
+ * generated by javadoc.
+ * The checks can be either that a series of strings are found or are not found.
+ * <dt>checkFiles
+ * <dd>Perform a series of checks on the files generated by javadoc.
+ * The checks can be that a series of files are found or are not found.
+ * </dl>
+ *
+ * <pre><code>
+ * public class MyTester extends JavadocTester {
+ * public static void main(String... args) throws Exception {
+ * MyTester tester = new MyTester();
+ * tester.runTests();
+ * }
+ *
+ * // test methods...
+ * @Test
+ * void test() {
+ * javadoc(<i>args</i>);
+ * checkExit(Exit.OK);
+ * checkOutput(<i>file</i>, true,
+ * <i>strings-to-find</i>);
+ * checkOutput(<i>file</i>, false,
+ * <i>strings-to-not-find</i>);
+ * }
+ * }
+ * </code></pre>
+ *
+ * <p>
+ * If javadoc is run more than once in a test method, you can compare the
+ * results that are generated with the diff method. Since files written by
+ * javadoc typically contain a timestamp, you may want to use the -notimestamp
+ * option if you are going to compare the results from two runs of javadoc.
+ *
+ * <p>
+ * If you have many calls of checkOutput that are very similar, you can write
+ * your own check... method to reduce the amount of duplication. For example,
+ * if you want to check that many files contain the same string, you could
+ * write a method that takes a varargs list of files and calls checkOutput
+ * on each file in turn with the string to be checked.
+ *
+ * <p>
+ * You can also write you own custom check methods, which can use
+ * readFile to get the contents of a file generated by javadoc,
+ * and then use pass(...) or fail(...) to report whether the check
+ * succeeded or not.
+ *
+ * <p>
+ * You can have many separate test methods, each identified with a @Test
+ * annotation. However, you should <b>not</b> assume they will be called
+ * in the order declared in your source file. If the order of a series
+ * of javadoc invocations is important, do that within a single method.
+ * If the invocations are independent, for better clarity, use separate
+ * test methods, each with their own set of checks on the results.
+ *
+ * @author Doug Kramer
+ * @author Jamie Ho
+ * @author Jonathan Gibbons (rewrite)
+ */
+public abstract class JavadocTester {
+
+ public static final String FS = System.getProperty("file.separator");
+ public static final String PS = System.getProperty("path.separator");
+ public static final String NL = System.getProperty("line.separator");
+ public static final Path currDir = Paths.get(".").toAbsolutePath().normalize();
+
+ public enum Output {
+ /** The name of the output stream from javadoc. */
+ OUT,
+ /** The name for any output written to System.out. */
+ STDOUT,
+ /** The name for any output written to System.err. */
+ STDERR
+ }
+
+ /** The output directory used in the most recent call of javadoc. */
+ protected File outputDir;
+
+ /** The output charset used in the most recent call of javadoc. */
+ protected Charset charset = Charset.defaultCharset();
+
+ /** The exit code of the most recent call of javadoc. */
+ private int exitCode;
+
+ /** The output generated by javadoc to the various writers and streams. */
+ private final Map<Output, String> outputMap = new EnumMap<>(Output.class);
+
+ /** A cache of file content, to avoid reading files unnecessarily. */
+ private final Map<File,SoftReference<String>> fileContentCache = new HashMap<>();
+ /** The charset used for files in the fileContentCache. */
+ private Charset fileContentCacheCharset = null;
+
+ /** Stream used for logging messages. */
+ protected final PrintStream out = System.out;
+
+ /** The directory containing the source code for the test. */
+ public static final String testSrc = System.getProperty("test.src");
+
+ /**
+ * Get the path for a source file in the test source directory.
+ * @param path the path of a file or directory in the source directory
+ * @return the full path of the specified file
+ */
+ public static String testSrc(String path) {
+ return new File(testSrc, path).getPath();
+ }
+
+ /**
+ * Alternatives for checking the contents of a directory.
+ */
+ public enum DirectoryCheck {
+ /**
+ * Check that the directory is empty.
+ */
+ EMPTY((file, name) -> true),
+ /**
+ * Check that the directory does not contain any HTML files,
+ * such as may have been generated by a prior run of javadoc
+ * using this directory.
+ * For now, the check is only performed on the top level directory.
+ */
+ NO_HTML_FILES((file, name) -> name.endsWith(".html")),
+ /**
+ * No check is performed on the directory contents.
+ */
+ NONE(null) { @Override void check(File dir) { } };
+
+ /** The filter used to detect that files should <i>not</i> be present. */
+ FilenameFilter filter;
+
+ DirectoryCheck(FilenameFilter f) {
+ filter = f;
+ }
+
+ void check(File dir) {
+ if (dir.isDirectory()) {
+ String[] contents = dir.list(filter);
+ if (contents == null)
+ throw new Error("cannot list directory: " + dir);
+ if (contents.length > 0) {
+ System.err.println("Found extraneous files in dir:" + dir.getAbsolutePath());
+ for (String x : contents) {
+ System.err.println(x);
+ }
+ throw new Error("directory has unexpected content: " + dir);
+ }
+ }
+ }
+ }
+
+ private DirectoryCheck outputDirectoryCheck = DirectoryCheck.EMPTY;
+
+ private boolean automaticCheckLinks = true;
+
+ /** The current subtest number. Incremented when checking(...) is called. */
+ private int numTestsRun = 0;
+
+ /** The number of subtests passed. Incremented when passed(...) is called. */
+ private int numTestsPassed = 0;
+
+ /** The current run of javadoc. Incremented when javadoc is called. */
+ private int javadocRunNum = 0;
+
+ /** The current subtest number for this run of javadoc. Incremented when checking(...) is called. */
+ private int javadocTestNum = 0;
+
+ /** Marker annotation for test methods to be invoked by runTests. */
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Test { }
+
+ /**
+ * Run all methods annotated with @Test, followed by printSummary.
+ * Typically called on a tester object in main()
+ * @throws Exception if any errors occurred
+ */
+ public void runTests() throws Exception {
+ runTests(m -> new Object[0]);
+ }
+
+ /**
+ * Run all methods annotated with @Test, followed by printSummary.
+ * Typically called on a tester object in main()
+ * @param f a function which will be used to provide arguments to each
+ * invoked method
+ * @throws Exception if any errors occurred
+ */
+ public void runTests(Function<Method, Object[]> f) throws Exception {
+ for (Method m: getClass().getDeclaredMethods()) {
+ Annotation a = m.getAnnotation(Test.class);
+ if (a != null) {
+ try {
+ out.println("Running test " + m.getName());
+ m.invoke(this, f.apply(m));
+ } catch (InvocationTargetException e) {
+ Throwable cause = e.getCause();
+ throw (cause instanceof Exception) ? ((Exception) cause) : e;
+ }
+ out.println();
+ }
+ }
+ printSummary();
+ }
+
+ /**
+ * Run javadoc.
+ * The output directory used by this call and the final exit code
+ * will be saved for later use.
+ * To aid the reader, it is recommended that calls to this method
+ * put each option and the arguments it takes on a separate line.
+ *
+ * Example:
+ * <pre><code>
+ * javadoc("-d", "out",
+ * "-sourcepath", testSrc,
+ * "-notimestamp",
+ * "pkg1", "pkg2", "pkg3/C.java");
+ * </code></pre>
+ *
+ * @param args the arguments to pass to javadoc
+ */
+ public void javadoc(String... args) {
+ outputMap.clear();
+ fileContentCache.clear();
+
+ javadocRunNum++;
+ javadocTestNum = 0; // reset counter for this run of javadoc
+ if (javadocRunNum == 1) {
+ out.println("Running javadoc...");
+ } else {
+ out.println("Running javadoc (run "+ javadocRunNum + ")...");
+ }
+
+ outputDir = new File(".");
+ String charsetArg = null;
+ String docencodingArg = null;
+ String encodingArg = null;
+ for (int i = 0; i < args.length - 2; i++) {
+ switch (args[i]) {
+ case "-d":
+ outputDir = new File(args[++i]);
+ break;
+ case "-charset":
+ charsetArg = args[++i];
+ break;
+ case "-docencoding":
+ docencodingArg = args[++i];
+ break;
+ case "-encoding":
+ encodingArg = args[++i];
+ break;
+ }
+ }
+
+ // The following replicates HtmlConfiguration.finishOptionSettings0
+ // and sets up the charset used to read files.
+ String cs;
+ if (docencodingArg == null) {
+ if (charsetArg == null) {
+ cs = (encodingArg == null) ? "UTF-8" : encodingArg;
+ } else {
+ cs = charsetArg;
+ }
+ } else {
+ cs = docencodingArg;
+ }
+ try {
+ charset = Charset.forName(cs);
+ } catch (UnsupportedCharsetException e) {
+ charset = Charset.defaultCharset();
+ }
+
+ out.println("args: " + Arrays.toString(args));
+// log.setOutDir(outputDir);
+
+ outputDirectoryCheck.check(outputDir);
+
+ // This is the sole stream used by javadoc
+ WriterOutput outOut = new WriterOutput();
+
+ // These are to catch output to System.out and System.err,
+ // in case these are used instead of the primary streams
+ StreamOutput sysOut = new StreamOutput(System.out, System::setOut);
+ StreamOutput sysErr = new StreamOutput(System.err, System::setErr);
+
+ try {
+ exitCode = jdk.javadoc.internal.tool.Main.execute(args, outOut.pw);
+ } finally {
+ outputMap.put(Output.STDOUT, sysOut.close());
+ outputMap.put(Output.STDERR, sysErr.close());
+ outputMap.put(Output.OUT, outOut.close());
+ }
+
+ outputMap.forEach((name, text) -> {
+ if (!text.isEmpty()) {
+ out.println("javadoc " + name + ":");
+ out.println(text);
+ }
+ });
+
+ if (automaticCheckLinks && exitCode == Exit.OK.code && outputDir.exists()) {
+ checkLinks();
+ }
+ }
+
+ /**
+ * Set the kind of check for the initial contents of the output directory
+ * before javadoc is run.
+ * The filter should return true for files that should <b>not</b> appear.
+ * @param c the kind of check to perform
+ */
+ public void setOutputDirectoryCheck(DirectoryCheck c) {
+ outputDirectoryCheck = c;
+ }
+
+ /**
+ * Set whether or not to perform an automatic call of checkLinks.
+ */
+ public void setAutomaticCheckLinks(boolean b) {
+ automaticCheckLinks = b;
+ }
+
+ /**
+ * The exit codes returned by the javadoc tool.
+ * @see jdk.javadoc.internal.tool.Main.Result
+ */
+ public enum Exit {
+ OK(0), // Javadoc completed with no errors.
+ ERROR(1), // Completed but reported errors.
+ CMDERR(2), // Bad command-line arguments
+ SYSERR(3), // System error or resource exhaustion.
+ ABNORMAL(4); // Javadoc terminated abnormally
+
+ Exit(int code) {
+ this.code = code;
+ }
+
+ final int code;
+
+ @Override
+ public String toString() {
+ return name() + '(' + code + ')';
+ }
+ }
+
+ /**
+ * Check the exit code of the most recent call of javadoc.
+ *
+ * @param expected the exit code that is required for the test
+ * to pass.
+ */
+ public void checkExit(Exit expected) {
+ checking("check exit code");
+ if (exitCode == expected.code) {
+ passed("return code " + exitCode);
+ } else {
+ failed("return code " + exitCode +"; expected " + expected);
+ }
+ }
+
+ /**
+ * Check for content in (or not in) the generated output.
+ * Within the search strings, the newline character \n
+ * will be translated to the platform newline character sequence.
+ * @param path a path within the most recent output directory
+ * or the name of one of the output buffers, identifying
+ * where to look for the search strings.
+ * @param expectedFound true if all of the search strings are expected
+ * to be found, or false if the file is not expected to be found
+ * @param strings the strings to be searched for
+ */
+ public void checkFileAndOutput(String path, boolean expectedFound, String... strings) {
+ if (expectedFound) {
+ checkOutput(path, true, strings);
+ } else {
+ checkFiles(false, path);
+ }
+ }
+
+ /**
+ * Check for content in (or not in) the generated output.
+ * Within the search strings, the newline character \n
+ * will be translated to the platform newline character sequence.
+ * @param path a path within the most recent output directory, identifying
+ * where to look for the search strings.
+ * @param expectedFound true if all of the search strings are expected
+ * to be found, or false if all of the strings are expected to be
+ * not found
+ * @param strings the strings to be searched for
+ */
+ public void checkOutput(String path, boolean expectedFound, String... strings) {
+ // Read contents of file
+ try {
+ String fileString = readFile(outputDir, path);
+ checkOutput(new File(outputDir, path).getPath(), fileString, expectedFound, strings);
+ } catch (Error e) {
+ checking("Read file");
+ failed("Error reading file: " + e);
+ }
+ }
+
+ /**
+ * Check for content in (or not in) the one of the output streams written by
+ * javadoc. Within the search strings, the newline character \n
+ * will be translated to the platform newline character sequence.
+ * @param output the output stream to check
+ * @param expectedFound true if all of the search strings are expected
+ * to be found, or false if all of the strings are expected to be
+ * not found
+ * @param strings the strings to be searched for
+ */
+ public void checkOutput(Output output, boolean expectedFound, String... strings) {
+ checkOutput(output.toString(), outputMap.get(output), expectedFound, strings);
+ }
+
+ // NOTE: path may be the name of an Output stream as well as a file path
+ private void checkOutput(String path, String fileString, boolean expectedFound, String... strings) {
+ for (String stringToFind : strings) {
+// log.logCheckOutput(path, expectedFound, stringToFind);
+ checking("checkOutput");
+ // Find string in file's contents
+ boolean isFound = findString(fileString, stringToFind);
+ if (isFound == expectedFound) {
+ passed(path + ": following text " + (isFound ? "found:" : "not found:") + "\n"
+ + stringToFind);
+ } else {
+ failed(path + ": following text " + (isFound ? "found:" : "not found:") + "\n"
+ + stringToFind + '\n' +
+ "found \n" +
+ fileString);
+ }
+ }
+ }
+
+ public void checkLinks() {
+ checking("Check links");
+ LinkChecker c = new LinkChecker(out, this::readFile);
+ try {
+ c.checkDirectory(outputDir.toPath());
+ c.report();
+ int errors = c.getErrorCount();
+ if (errors == 0) {
+ passed("Links are OK");
+ } else {
+ failed(errors + " errors found when checking links");
+ }
+ } catch (IOException e) {
+ failed("exception thrown when reading files: " + e);
+ }
+ }
+
+ /**
+ * Get the content of the one of the output streams written by javadoc.
+ * @param output the name of the output stream
+ * @return the content of the output stream
+ */
+ public String getOutput(Output output) {
+ return outputMap.get(output);
+ }
+
+ /**
+ * Get the content of the one of the output streams written by javadoc.
+ * @param output the name of the output stream
+ * @return the content of the output stream, as a line of lines
+ */
+ public List<String> getOutputLines(Output output) {
+ String text = outputMap.get(output);
+ return (text == null) ? Collections.emptyList() : Arrays.asList(text.split(NL));
+ }
+
+ /**
+ * Check for files in (or not in) the generated output.
+ * @param expectedFound true if all of the files are expected
+ * to be found, or false if all of the files are expected to be
+ * not found
+ * @param paths the files to check, within the most recent output directory.
+ * */
+ public void checkFiles(boolean expectedFound, String... paths) {
+ checkFiles(expectedFound, Arrays.asList(paths));
+ }
+
+ /**
+ * Check for files in (or not in) the generated output.
+ * @param expectedFound true if all of the files are expected
+ * to be found, or false if all of the files are expected to be
+ * not found
+ * @param paths the files to check, within the most recent output directory.
+ * */
+ public void checkFiles(boolean expectedFound, Collection<String> paths) {
+ for (String path: paths) {
+// log.logCheckFile(path, expectedFound);
+ checking("checkFile");
+ File file = new File(outputDir, path);
+ boolean isFound = file.exists();
+ if (isFound == expectedFound) {
+ passed(file, "file " + (isFound ? "found:" : "not found:") + "\n");
+ } else {
+ failed(file, "file " + (isFound ? "found:" : "not found:") + "\n");
+ }
+ }
+ }
+
+ /**
+ * Check that a series of strings are found in order in a file in
+ * the generated output.
+ * @param path the file to check
+ * @param strings the strings whose order to check
+ */
+ public void checkOrder(String path, String... strings) {
+ File file = new File(outputDir, path);
+ String fileString = readOutputFile(path);
+ int prevIndex = -1;
+ for (String s : strings) {
+ s = s.replace("\n", NL); // normalize new lines
+ int currentIndex = fileString.indexOf(s, prevIndex + 1);
+ checking("file: " + file + ": " + s + " at index " + currentIndex);
+ if (currentIndex == -1) {
+ failed(file, s + " not found.");
+ continue;
+ }
+ if (currentIndex > prevIndex) {
+ passed(file, s + " is in the correct order");
+ } else {
+ failed(file, s + " is in the wrong order.");
+ }
+ prevIndex = currentIndex;
+ }
+ }
+
+ /**
+ * Ensures that a series of strings appear only once, in the generated output,
+ * noting that, this test does not exhaustively check for all other possible
+ * duplicates once one is found.
+ * @param path the file to check
+ * @param strings ensure each are unique
+ */
+ public void checkUnique(String path, String... strings) {
+ File file = new File(outputDir, path);
+ String fileString = readOutputFile(path);
+ for (String s : strings) {
+ int currentIndex = fileString.indexOf(s);
+ checking(s + " at index " + currentIndex);
+ if (currentIndex == -1) {
+ failed(file, s + " not found.");
+ continue;
+ }
+ int nextindex = fileString.indexOf(s, currentIndex + s.length());
+ if (nextindex == -1) {
+ passed(file, s + " is unique");
+ } else {
+ failed(file, s + " is not unique, found at " + nextindex);
+ }
+ }
+ }
+
+ /**
+ * Compare a set of files in each of two directories.
+ *
+ * @param baseDir1 the directory containing the first set of files
+ * @param baseDir2 the directory containing the second set of files
+ * @param files the set of files to be compared
+ */
+ public void diff(String baseDir1, String baseDir2, String... files) {
+ File bd1 = new File(baseDir1);
+ File bd2 = new File(baseDir2);
+ for (String file : files) {
+ diff(bd1, bd2, file);
+ }
+ }
+
+ /**
+ * A utility to copy a directory from one place to another.
+ *
+ * @param targetDir the directory to copy.
+ * @param destDir the destination to copy the directory to.
+ */
+ // TODO: convert to using java.nio.Files.walkFileTree
+ public void copyDir(String targetDir, String destDir) {
+ try {
+ File targetDirObj = new File(targetDir);
+ File destDirParentObj = new File(destDir);
+ File destDirObj = new File(destDirParentObj, targetDirObj.getName());
+ if (! destDirParentObj.exists()) {
+ destDirParentObj.mkdir();
+ }
+ if (! destDirObj.exists()) {
+ destDirObj.mkdir();
+ }
+ String[] files = targetDirObj.list();
+ for (String file : files) {
+ File srcFile = new File(targetDirObj, file);
+ File destFile = new File(destDirObj, file);
+ if (srcFile.isFile()) {
+ out.println("Copying " + srcFile + " to " + destFile);
+ copyFile(destFile, srcFile);
+ } else if(srcFile.isDirectory()) {
+ copyDir(srcFile.getAbsolutePath(), destDirObj.getAbsolutePath());
+ }
+ }
+ } catch (IOException exc) {
+ throw new Error("Could not copy " + targetDir + " to " + destDir);
+ }
+ }
+
+ /**
+ * Copy source file to destination file.
+ *
+ * @param destfile the destination file
+ * @param srcfile the source file
+ * @throws IOException
+ */
+ public void copyFile(File destfile, File srcfile) throws IOException {
+ Files.copy(srcfile.toPath(), destfile.toPath());
+ }
+
+ /**
+ * Read a file from the output directory.
+ *
+ * @param fileName the name of the file to read
+ * @return the file in string format
+ */
+ public String readOutputFile(String fileName) throws Error {
+ return readFile(outputDir, fileName);
+ }
+
+ protected String readFile(String fileName) throws Error {
+ return readFile(outputDir, fileName);
+ }
+
+ protected String readFile(String baseDir, String fileName) throws Error {
+ return readFile(new File(baseDir), fileName);
+ }
+
+ private String readFile(Path file) {
+ File baseDir;
+ if (file.startsWith(outputDir.toPath())) {
+ baseDir = outputDir;
+ } else if (file.startsWith(currDir)) {
+ baseDir = currDir.toFile();
+ } else {
+ baseDir = file.getParent().toFile();
+ }
+ String fileName = baseDir.toPath().relativize(file).toString();
+ return readFile(baseDir, fileName);
+ }
+
+ /**
+ * Read the file and return it as a string.
+ *
+ * @param baseDir the directory in which to locate the file
+ * @param fileName the name of the file to read
+ * @return the file in string format
+ */
+ private String readFile(File baseDir, String fileName) throws Error {
+ if (!Objects.equals(fileContentCacheCharset, charset)) {
+ fileContentCache.clear();
+ fileContentCacheCharset = charset;
+ }
+ try {
+ File file = new File(baseDir, fileName);
+ SoftReference<String> ref = fileContentCache.get(file);
+ String content = (ref == null) ? null : ref.get();
+ if (content != null)
+ return content;
+
+ // charset defaults to a value inferred from latest javadoc run
+ content = new String(Files.readAllBytes(file.toPath()), charset);
+ fileContentCache.put(file, new SoftReference<>(content));
+ return content;
+ } catch (FileNotFoundException e) {
+ throw new Error("File not found: " + fileName + ": " + e);
+ } catch (IOException e) {
+ throw new Error("Error reading file: " + fileName + ": " + e);
+ }
+ }
+
+ protected void checking(String message) {
+ numTestsRun++;
+ javadocTestNum++;
+ print("Starting subtest " + javadocRunNum + "." + javadocTestNum, message);
+ }
+
+ protected void passed(File file, String message) {
+ passed(file + ": " + message);
+ }
+
+ protected void passed(String message) {
+ numTestsPassed++;
+ print("Passed", message);
+ out.println();
+ }
+
+ protected void failed(File file, String message) {
+ failed(file + ": " + message);
+ }
+
+ protected void failed(String message) {
+ print("FAILED", message);
+ StackWalker.getInstance().walk(s -> {
+ s.dropWhile(f -> f.getMethodName().equals("failed"))
+ .takeWhile(f -> !f.getMethodName().equals("runTests"))
+ .forEach(f -> out.println(" at "
+ + f.getClassName() + "." + f.getMethodName()
+ + "(" + f.getFileName() + ":" + f.getLineNumber() + ")"));
+ return null;
+ });
+ out.println();
+ }
+
+ private void print(String prefix, String message) {
+ if (message.isEmpty())
+ out.println(prefix);
+ else {
+ out.print(prefix);
+ out.print(": ");
+ out.print(message.replace("\n", NL));
+ if (!(message.endsWith("\n") || message.endsWith(NL))) {
+ out.println();
+ }
+ }
+ }
+
+ /**
+ * Print a summary of the test results.
+ */
+ protected void printSummary() {
+ String javadocRuns = (javadocRunNum <= 1) ? ""
+ : ", in " + javadocRunNum + " runs of javadoc";
+
+ if (numTestsRun != 0 && numTestsPassed == numTestsRun) {
+ // Test passed
+ out.println();
+ out.println("All " + numTestsPassed + " subtests passed" + javadocRuns);
+ } else {
+ // Test failed
+ throw new Error((numTestsRun - numTestsPassed)
+ + " of " + (numTestsRun)
+ + " subtests failed"
+ + javadocRuns);
+ }
+ }
+
+ /**
+ * Search for the string in the given file and return true
+ * if the string was found.
+ *
+ * @param fileString the contents of the file to search through
+ * @param stringToFind the string to search for
+ * @return true if the string was found
+ */
+ private boolean findString(String fileString, String stringToFind) {
+ // javadoc (should) always use the platform newline sequence,
+ // but in the strings to find it is more convenient to use the Java
+ // newline character. So we translate \n to NL before we search.
+ stringToFind = stringToFind.replace("\n", NL);
+ return fileString.contains(stringToFind);
+ }
+
+ /**
+ * Compare the two given files.
+ *
+ * @param baseDir1 the directory in which to locate the first file
+ * @param baseDir2 the directory in which to locate the second file
+ * @param file the file to compare in the two base directories
+ * @param throwErrorIFNoMatch flag to indicate whether or not to throw
+ * an error if the files do not match.
+ * @return true if the files are the same and false otherwise.
+ */
+ private void diff(File baseDir1, File baseDir2, String file) {
+ String file1Contents = readFile(baseDir1, file);
+ String file2Contents = readFile(baseDir2, file);
+ checking("diff " + new File(baseDir1, file) + ", " + new File(baseDir2, file));
+ if (file1Contents.trim().compareTo(file2Contents.trim()) == 0) {
+ passed("files are equal");
+ } else {
+ failed("files differ");
+ }
+ }
+
+ /**
+ * Utility class to simplify the handling of temporarily setting a
+ * new stream for System.out or System.err.
+ */
+ private static class StreamOutput {
+ // functional interface to set a stream.
+ private interface Initializer {
+ void set(PrintStream s);
+ }
+
+ private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ private final PrintStream ps = new PrintStream(baos);
+ private final PrintStream prev;
+ private final Initializer init;
+
+ StreamOutput(PrintStream s, Initializer init) {
+ prev = s;
+ init.set(ps);
+ this.init = init;
+ }
+
+ String close() {
+ init.set(prev);
+ ps.close();
+ return baos.toString();
+ }
+ }
+
+ /**
+ * Utility class to simplify the handling of creating an in-memory PrintWriter.
+ */
+ private static class WriterOutput {
+ private final StringWriter sw = new StringWriter();
+ final PrintWriter pw = new PrintWriter(sw);
+ String close() {
+ pw.close();
+ return sw.toString();
+ }
+ }
+
+
+// private final Logger log = new Logger();
+
+ //--------- Logging --------------------------------------------------------
+ //
+ // This class writes out the details of calls to checkOutput and checkFile
+ // in a canonical way, so that the resulting file can be checked against
+ // similar files from other versions of JavadocTester using the same logging
+ // facilities.
+
+ static class Logger {
+ private static final int PREFIX = 40;
+ private static final int SUFFIX = 20;
+ private static final int MAX = PREFIX + SUFFIX;
+ List<String> tests = new ArrayList<>();
+ String outDir;
+ String rootDir = rootDir();
+
+ static String rootDir() {
+ File f = new File(".").getAbsoluteFile();
+ while (!new File(f, ".hg").exists())
+ f = f.getParentFile();
+ return f.getPath();
+ }
+
+ void setOutDir(File outDir) {
+ this.outDir = outDir.getPath();
+ }
+
+ void logCheckFile(String file, boolean positive) {
+ // Strip the outdir because that will typically not be the same
+ if (file.startsWith(outDir + "/"))
+ file = file.substring(outDir.length() + 1);
+ tests.add(file + " " + positive);
+ }
+
+ void logCheckOutput(String file, boolean positive, String text) {
+ // Compress the string to be displayed in the log file
+ String simpleText = text.replaceAll("\\s+", " ").replace(rootDir, "[ROOT]");
+ if (simpleText.length() > MAX)
+ simpleText = simpleText.substring(0, PREFIX)
+ + "..." + simpleText.substring(simpleText.length() - SUFFIX);
+ // Strip the outdir because that will typically not be the same
+ if (file.startsWith(outDir + "/"))
+ file = file.substring(outDir.length() + 1);
+ // The use of text.hashCode ensure that all of "text" is taken into account
+ tests.add(file + " " + positive + " " + text.hashCode() + " " + simpleText);
+ }
+
+ void write() {
+ // sort the log entries because the subtests may not be executed in the same order
+ tests.sort((a, b) -> a.compareTo(b));
+ try (BufferedWriter bw = new BufferedWriter(new FileWriter("tester.log"))) {
+ for (String t: tests) {
+ bw.write(t);
+ bw.newLine();
+ }
+ } catch (IOException e) {
+ throw new Error("problem writing log: " + e);
+ }
+ }
+ }
+
+ // Support classes for checkLinks
+
+ /**
+ * A basic HTML parser. Override the protected methods as needed to get notified
+ * of significant items in any file that is read.
+ */
+ static abstract class HtmlParser {
+
+ protected final PrintStream out;
+ protected final Function<Path,String> fileReader;
+
+ private Path file;
+ private StringReader in;
+ private int ch;
+ private int lineNumber;
+ private boolean inScript;
+ private boolean xml;
+
+ HtmlParser(PrintStream out, Function<Path,String> fileReader) {
+ this.out = out;
+ this.fileReader = fileReader;
+ }
+
+ /**
+ * Read a file.
+ * @param file the file to be read
+ * @throws IOException if an error occurs while reading the file
+ */
+ void read(Path file) throws IOException {
+ try (StringReader r = new StringReader(fileReader.apply(file))) {
+ this.file = file;
+ this.in = r;
+
+ startFile(file);
+ try {
+ lineNumber = 1;
+ xml = false;
+ nextChar();
+
+ while (ch != -1) {
+ switch (ch) {
+
+ case '<':
+ html();
+ break;
+
+ default:
+ nextChar();
+ }
+ }
+ } finally {
+ endFile();
+ }
+ } catch (IOException e) {
+ error(file, lineNumber, e);
+ } catch (Throwable t) {
+ error(file, lineNumber, t);
+ t.printStackTrace(out);
+ }
+ }
+
+
+ int getLineNumber() {
+ return lineNumber;
+ }
+
+ /**
+ * Called when a file has been opened, before parsing begins.
+ * This is always the first notification when reading a file.
+ * This implementation does nothing.
+ *
+ * @param file the file
+ */
+ protected void startFile(Path file) { }
+
+ /**
+ * Called when the parser has finished reading a file.
+ * This is always the last notification when reading a file,
+ * unless any errors occur while closing the file.
+ * This implementation does nothing.
+ */
+ protected void endFile() { }
+
+ /**
+ * Called when a doctype declaration is found, at the beginning of the file.
+ * This implementation does nothing.
+ * @param s the doctype declaration
+ */
+ protected void docType(String s) { }
+
+ /**
+ * Called when the opening tag of an HTML element is encountered.
+ * This implementation does nothing.
+ * @param name the name of the tag
+ * @param attrs the attribute
+ * @param selfClosing whether or not this is a self-closing tag
+ */
+ protected void startElement(String name, Map<String,String> attrs, boolean selfClosing) { }
+
+ /**
+ * Called when the closing tag of an HTML tag is encountered.
+ * This implementation does nothing.
+ * @param name the name of the tag
+ */
+ protected void endElement(String name) { }
+
+ /**
+ * Called when an error has been encountered.
+ * @param file the file being read
+ * @param lineNumber the line number of line containing the error
+ * @param message a description of the error
+ */
+ protected void error(Path file, int lineNumber, String message) {
+ out.println(file + ":" + lineNumber + ": " + message);
+ }
+
+ /**
+ * Called when an exception has been encountered.
+ * @param file the file being read
+ * @param lineNumber the line number of the line being read when the exception was found
+ * @param t the exception
+ */
+ protected void error(Path file, int lineNumber, Throwable t) {
+ out.println(file + ":" + lineNumber + ": " + t);
+ }
+
+ private void nextChar() throws IOException {
+ ch = in.read();
+ if (ch == '\n')
+ lineNumber++;
+ }
+
+ /**
+ * Read the start or end of an HTML tag, or an HTML comment
+ * {@literal <identifier attrs> } or {@literal </identifier> }
+ * @throws java.io.IOException if there is a problem reading the file
+ */
+ private void html() throws IOException {
+ nextChar();
+ if (isIdentifierStart((char) ch)) {
+ String name = readIdentifier().toLowerCase(Locale.US);
+ Map<String,String> attrs = htmlAttrs();
+ if (attrs != null) {
+ boolean selfClosing = false;
+ if (ch == '/') {
+ nextChar();
+ selfClosing = true;
+ }
+ if (ch == '>') {
+ nextChar();
+ startElement(name, attrs, selfClosing);
+ if (name.equals("script")) {
+ inScript = true;
+ }
+ return;
+ }
+ }
+ } else if (ch == '/') {
+ nextChar();
+ if (isIdentifierStart((char) ch)) {
+ String name = readIdentifier().toLowerCase(Locale.US);
+ skipWhitespace();
+ if (ch == '>') {
+ nextChar();
+ endElement(name);
+ if (name.equals("script")) {
+ inScript = false;
+ }
+ return;
+ }
+ }
+ } else if (ch == '!') {
+ nextChar();
+ if (ch == '-') {
+ nextChar();
+ if (ch == '-') {
+ nextChar();
+ while (ch != -1) {
+ int dash = 0;
+ while (ch == '-') {
+ dash++;
+ nextChar();
+ }
+ // Strictly speaking, a comment should not contain "--"
+ // so dash > 2 is an error, dash == 2 implies ch == '>'
+ // See http://www.w3.org/TR/html-markup/syntax.html#syntax-comments
+ // for more details.
+ if (dash >= 2 && ch == '>') {
+ nextChar();
+ return;
+ }
+
+ nextChar();
+ }
+ }
+ } else if (ch == '[') {
+ nextChar();
+ if (ch == 'C') {
+ nextChar();
+ if (ch == 'D') {
+ nextChar();
+ if (ch == 'A') {
+ nextChar();
+ if (ch == 'T') {
+ nextChar();
+ if (ch == 'A') {
+ nextChar();
+ if (ch == '[') {
+ while (true) {
+ nextChar();
+ if (ch == ']') {
+ nextChar();
+ if (ch == ']') {
+ nextChar();
+ if (ch == '>') {
+ nextChar();
+ return;
+ }
+ }
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+ }
+ } else {
+ StringBuilder sb = new StringBuilder();
+ while (ch != -1 && ch != '>') {
+ sb.append((char) ch);
+ nextChar();
+ }
+ Pattern p = Pattern.compile("(?is)doctype\\s+html\\s?.*");
+ String s = sb.toString();
+ if (p.matcher(s).matches()) {
+ docType(s);
+ return;
+ }
+ }
+ } else if (ch == '?') {
+ nextChar();
+ if (ch == 'x') {
+ nextChar();
+ if (ch == 'm') {
+ nextChar();
+ if (ch == 'l') {
+ Map<String,String> attrs = htmlAttrs();
+ if (ch == '?') {
+ nextChar();
+ if (ch == '>') {
+ nextChar();
+ xml = true;
+ return;
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+ if (!inScript) {
+ error(file, lineNumber, "bad html");
+ }
+ }
+
+ /**
+ * Read a series of HTML attributes, terminated by {@literal > }.
+ * Each attribute is of the form {@literal identifier[=value] }.
+ * "value" may be unquoted, single-quoted, or double-quoted.
+ */
+ private Map<String,String> htmlAttrs() throws IOException {
+ Map<String, String> map = new LinkedHashMap<>();
+ skipWhitespace();
+
+ loop:
+ while (isIdentifierStart((char) ch)) {
+ String name = readAttributeName().toLowerCase(Locale.US);
+ skipWhitespace();
+ String value = null;
+ if (ch == '=') {
+ nextChar();
+ skipWhitespace();
+ if (ch == '\'' || ch == '"') {
+ char quote = (char) ch;
+ nextChar();
+ StringBuilder sb = new StringBuilder();
+ while (ch != -1 && ch != quote) {
+ sb.append((char) ch);
+ nextChar();
+ }
+ value = sb.toString() // hack to replace common entities
+ .replace("<", "<")
+ .replace(">", ">")
+ .replace("&", "&");
+ nextChar();
+ } else {
+ StringBuilder sb = new StringBuilder();
+ while (ch != -1 && !isUnquotedAttrValueTerminator((char) ch)) {
+ sb.append((char) ch);
+ nextChar();
+ }
+ value = sb.toString();
+ }
+ skipWhitespace();
+ }
+ map.put(name, value);
+ }
+
+ return map;
+ }
+
+ private boolean isIdentifierStart(char ch) {
+ return Character.isUnicodeIdentifierStart(ch);
+ }
+
+ private String readIdentifier() throws IOException {
+ StringBuilder sb = new StringBuilder();
+ sb.append((char) ch);
+ nextChar();
+ while (ch != -1 && Character.isUnicodeIdentifierPart(ch)) {
+ sb.append((char) ch);
+ nextChar();
+ }
+ return sb.toString();
+ }
+
+ private String readAttributeName() throws IOException {
+ StringBuilder sb = new StringBuilder();
+ sb.append((char) ch);
+ nextChar();
+ while (ch != -1 && Character.isUnicodeIdentifierPart(ch)
+ || ch == '-'
+ || xml && ch == ':') {
+ sb.append((char) ch);
+ nextChar();
+ }
+ return sb.toString();
+ }
+
+ private boolean isWhitespace(char ch) {
+ return Character.isWhitespace(ch);
+ }
+
+ private void skipWhitespace() throws IOException {
+ while (isWhitespace((char) ch)) {
+ nextChar();
+ }
+ }
+
+ private boolean isUnquotedAttrValueTerminator(char ch) {
+ switch (ch) {
+ case '\f': case '\n': case '\r': case '\t':
+ case ' ':
+ case '"': case '\'': case '`':
+ case '=': case '<': case '>':
+ return true;
+ default:
+ return false;
+ }
+ }
+ }
+
+ /**
+ * A class to check the links in a set of HTML files.
+ */
+ static class LinkChecker extends HtmlParser {
+ private final Map<Path, IDTable> allFiles;
+ private final Map<URI, IDTable> allURIs;
+
+ private int files;
+ private int links;
+ private int badSchemes;
+ private int duplicateIds;
+ private int missingIds;
+
+ private Path currFile;
+ private IDTable currTable;
+ private boolean html5;
+ private boolean xml;
+
+ private int errors;
+
+ LinkChecker(PrintStream out, Function<Path,String> fileReader) {
+ super(out, fileReader);
+ allFiles = new HashMap<>();
+ allURIs = new HashMap<>();
+ }
+
+ void checkDirectory(Path dir) throws IOException {
+ checkFiles(List.of(dir), false, Collections.emptySet());
+ }
+
+ void checkFiles(List<Path> files, boolean skipSubdirs, Set<Path> excludeFiles) throws IOException {
+ for (Path file : files) {
+ Files.walkFileTree(file, new SimpleFileVisitor<Path>() {
+ int depth = 0;
+
+ @Override
+ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
+ if ((skipSubdirs && depth > 0) || excludeFiles.contains(dir)) {
+ return FileVisitResult.SKIP_SUBTREE;
+ }
+ depth++;
+ return FileVisitResult.CONTINUE;
+ }
+
+ @Override
+ public FileVisitResult visitFile(Path p, BasicFileAttributes attrs) {
+ if (excludeFiles.contains(p)) {
+ return FileVisitResult.CONTINUE;
+ }
+
+ if (Files.isRegularFile(p) && p.getFileName().toString().endsWith(".html")) {
+ checkFile(p);
+ }
+ return FileVisitResult.CONTINUE;
+ }
+
+ @Override
+ public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException {
+ depth--;
+ return super.postVisitDirectory(dir, e);
+ }
+ });
+ }
+ }
+
+ void checkFile(Path file) {
+ try {
+ read(file);
+ } catch (IOException e) {
+ error(file, 0, e);
+ }
+ }
+
+ int getErrorCount() {
+ return errors;
+ }
+
+ public void report() {
+ List<Path> missingFiles = getMissingFiles();
+ if (!missingFiles.isEmpty()) {
+ report("Missing files: (" + missingFiles.size() + ")");
+ missingFiles.stream()
+ .sorted()
+ .forEach(this::reportMissingFile);
+
+ }
+
+ if (!allURIs.isEmpty()) {
+ report(false, "External URLs:");
+ allURIs.keySet().stream()
+ .sorted(new URIComparator())
+ .forEach(uri -> report(false, " %s", uri.toString()));
+ }
+
+ int anchors = 0;
+ for (IDTable t : allFiles.values()) {
+ anchors += t.map.values().stream()
+ .filter(e -> !e.getReferences().isEmpty())
+ .count();
+ }
+ for (IDTable t : allURIs.values()) {
+ anchors += t.map.values().stream()
+ .filter(e -> !e.references.isEmpty())
+ .count();
+ }
+
+ report(false, "Checked " + files + " files.");
+ report(false, "Found " + links + " references to " + anchors + " anchors "
+ + "in " + allFiles.size() + " files and " + allURIs.size() + " other URIs.");
+ report(!missingFiles.isEmpty(), "%6d missing files", missingFiles.size());
+ report(duplicateIds > 0, "%6d duplicate ids", duplicateIds);
+ report(missingIds > 0, "%6d missing ids", missingIds);
+
+ Map<String, Integer> schemeCounts = new TreeMap<>();
+ Map<String, Integer> hostCounts = new TreeMap<>(new HostComparator());
+ for (URI uri : allURIs.keySet()) {
+ String scheme = uri.getScheme();
+ if (scheme != null) {
+ schemeCounts.put(scheme, schemeCounts.computeIfAbsent(scheme, s -> 0) + 1);
+ }
+ String host = uri.getHost();
+ if (host != null) {
+ hostCounts.put(host, hostCounts.computeIfAbsent(host, h -> 0) + 1);
+ }
+ }
+
+ if (schemeCounts.size() > 0) {
+ report(false, "Schemes");
+ schemeCounts.forEach((s, n) -> report(!isSchemeOK(s), "%6d %s", n, s));
+ }
+
+ if (hostCounts.size() > 0) {
+ report(false, "Hosts");
+ hostCounts.forEach((h, n) -> report(false, "%6d %s", n, h));
+ }
+ }
+
+ private void report(String message, Object... args) {
+ out.println(String.format(message, args));
+ }
+
+ private void report(boolean highlight, String message, Object... args) {
+ out.print(highlight ? "* " : " ");
+ out.println(String.format(message, args));
+ }
+
+ private void reportMissingFile(Path file) {
+ report("%s", relativePath(file));
+ IDTable table = allFiles.get(file);
+ Set<Path> refs = new TreeSet<>();
+ for (ID id : table.map.values()) {
+ if (id.references != null) {
+ for (Position p : id.references) {
+ refs.add(p.path);
+ }
+ }
+ }
+ int n = 0;
+ int MAX_REFS = 10;
+ for (Path ref : refs) {
+ report(" in " + relativePath(ref));
+ if (++n == MAX_REFS) {
+ report(" ... and %d more", refs.size() - n);
+ break;
+ }
+ }
+ }
+
+ @Override
+ public void startFile(Path path) {
+ currFile = path.toAbsolutePath().normalize();
+ currTable = allFiles.computeIfAbsent(currFile, p -> new IDTable(p));
+ html5 = false;
+ files++;
+ }
+
+ @Override
+ public void endFile() {
+ currTable.check();
+ }
+
+ @Override
+ public void docType(String doctype) {
+ html5 = doctype.matches("(?i)<\\?doctype\\s+html>");
+ }
+
+ @Override @SuppressWarnings("fallthrough")
+ public void startElement(String name, Map<String, String> attrs, boolean selfClosing) {
+ int line = getLineNumber();
+ switch (name) {
+ case "a":
+ String nameAttr = html5 ? null : attrs.get("name");
+ if (nameAttr != null) {
+ foundAnchor(line, nameAttr);
+ }
+ // fallthrough
+ case "link":
+ String href = attrs.get("href");
+ if (href != null) {
+ foundReference(line, href);
+ }
+ break;
+ }
+
+ String idAttr = attrs.get("id");
+ if (idAttr != null) {
+ foundAnchor(line, idAttr);
+ }
+ }
+
+ @Override
+ public void endElement(String name) { }
+
+ private void foundAnchor(int line, String name) {
+ currTable.addID(line, name);
+ }
+
+ private void foundReference(int line, String ref) {
+ links++;
+ try {
+ URI uri = new URI(ref);
+ if (uri.isAbsolute()) {
+ foundReference(line, uri);
+ } else {
+ Path p;
+ String uriPath = uri.getPath();
+ if (uriPath == null || uriPath.isEmpty()) {
+ p = currFile;
+ } else {
+ p = currFile.getParent().resolve(uriPath).normalize();
+ }
+ foundReference(line, p, uri.getFragment());
+ }
+ } catch (URISyntaxException e) {
+ error(currFile, line, "invalid URI: " + e);
+ }
+ }
+
+ private void foundReference(int line, Path p, String fragment) {
+ IDTable t = allFiles.computeIfAbsent(p, key -> new IDTable(key));
+ t.addReference(fragment, currFile, line);
+ }
+
+ private void foundReference(int line, URI uri) {
+ if (!isSchemeOK(uri.getScheme())) {
+ error(currFile, line, "bad scheme in URI");
+ badSchemes++;
+ }
+
+ String fragment = uri.getFragment();
+ try {
+ URI noFrag = new URI(uri.toString().replaceAll("#\\Q" + fragment + "\\E$", ""));
+ IDTable t = allURIs.computeIfAbsent(noFrag, key -> new IDTable(key.toString()));
+ t.addReference(fragment, currFile, line);
+ } catch (URISyntaxException e) {
+ throw new Error(e);
+ }
+ }
+
+ private boolean isSchemeOK(String uriScheme) {
+ if (uriScheme == null) {
+ return true;
+ }
+
+ switch (uriScheme) {
+ case "file":
+ case "ftp":
+ case "http":
+ case "https":
+ case "javascript":
+ case "mailto":
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ private List<Path> getMissingFiles() {
+ return allFiles.entrySet().stream()
+ .filter(e -> !Files.exists(e.getKey()))
+ .map(e -> e.getKey())
+ .collect(Collectors.toList());
+ }
+
+ @Override
+ protected void error(Path file, int lineNumber, String message) {
+ super.error(relativePath(file), lineNumber, message);
+ errors++;
+ }
+
+ @Override
+ protected void error(Path file, int lineNumber, Throwable t) {
+ super.error(relativePath(file), lineNumber, t);
+ errors++;
+ }
+
+ private Path relativePath(Path path) {
+ return path.startsWith(currDir) ? currDir.relativize(path) : path;
+ }
+
+ /**
+ * A position in a file, as identified by a file name and line number.
+ */
+ static class Position implements Comparable<Position> {
+ Path path;
+ int line;
+
+ Position(Path path, int line) {
+ this.path = path;
+ this.line = line;
+ }
+
+ @Override
+ public int compareTo(Position o) {
+ int v = path.compareTo(o.path);
+ return v != 0 ? v : Integer.compare(line, o.line);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ } else if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ } else {
+ final Position other = (Position) obj;
+ return Objects.equals(this.path, other.path)
+ && this.line == other.line;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(path) * 37 + line;
+ }
+ }
+
+ /**
+ * Infor for an ID within an HTML file, and a set of positions that reference it.
+ */
+ static class ID {
+ boolean declared;
+ Set<Position> references;
+
+ Set<Position> getReferences() {
+ return (references) == null ? Collections.emptySet() : references;
+ }
+ }
+
+ /**
+ * A table for the set of IDs in an HTML file.
+ */
+ class IDTable {
+ private String name;
+ private boolean checked;
+ private final Map<String, ID> map = new HashMap<>();
+
+ IDTable(Path p) {
+ this(relativePath(p).toString());
+ }
+
+ IDTable(String name) {
+ this.name = name;
+ }
+
+ void addID(int line, String name) {
+ if (checked) {
+ throw new IllegalStateException("Adding ID after file has been read");
+ }
+ Objects.requireNonNull(name);
+ ID id = map.computeIfAbsent(name, x -> new ID());
+ if (id.declared) {
+ error(currFile, line, "name already declared: " + name);
+ duplicateIds++;
+ } else {
+ id.declared = true;
+ }
+ }
+
+ void addReference(String name, Path from, int line) {
+ if (checked) {
+ if (name != null) {
+ ID id = map.get(name);
+ if (id == null || !id.declared) {
+ error(from, line, "id not found: " + this.name + "#" + name);
+ }
+ }
+ } else {
+ ID id = map.computeIfAbsent(name, x -> new ID());
+ if (id.references == null) {
+ id.references = new TreeSet<>();
+ }
+ id.references.add(new Position(from, line));
+ }
+ }
+
+ void check() {
+ map.forEach((name, id) -> {
+ if (name != null && !id.declared) {
+ //log.error(currFile, 0, "id not declared: " + name);
+ for (Position ref : id.references) {
+ error(ref.path, ref.line, "id not found: " + this.name + "#" + name);
+ }
+ missingIds++;
+ }
+ });
+ checked = true;
+ }
+ }
+
+ static class URIComparator implements Comparator<URI> {
+ final HostComparator hostComparator = new HostComparator();
+
+ @Override
+ public int compare(URI o1, URI o2) {
+ if (o1.isOpaque() || o2.isOpaque()) {
+ return o1.compareTo(o2);
+ }
+ String h1 = o1.getHost();
+ String h2 = o2.getHost();
+ String s1 = o1.getScheme();
+ String s2 = o2.getScheme();
+ if (h1 == null || h1.isEmpty() || s1 == null || s1.isEmpty()
+ || h2 == null || h2.isEmpty() || s2 == null || s2.isEmpty()) {
+ return o1.compareTo(o2);
+ }
+ int v = hostComparator.compare(h1, h2);
+ if (v != 0) {
+ return v;
+ }
+ v = s1.compareTo(s2);
+ if (v != 0) {
+ return v;
+ }
+ return o1.compareTo(o2);
+ }
+ }
+
+ static class HostComparator implements Comparator<String> {
+ @Override
+ public int compare(String h1, String h2) {
+ List<String> l1 = new ArrayList<>(Arrays.asList(h1.split("\\.")));
+ Collections.reverse(l1);
+ String r1 = String.join(".", l1);
+ List<String> l2 = new ArrayList<>(Arrays.asList(h2.split("\\.")));
+ Collections.reverse(l2);
+ String r2 = String.join(".", l2);
+ return r1.compareTo(r2);
+ }
+ }
+
+ }
+}