*/
+import javadoc.tester.JavadocTester;
+
public class TemplateComplete extends JavadocTester {
//Javadoc arguments.
diff -r 58154bf80f90 -r 2e82ca64b25d test/langtools/jdk/javadoc/doclet/constantValues/TestConstantValuesDriver.java
--- 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"),
diff -r 58154bf80f90 -r 2e82ca64b25d test/langtools/jdk/javadoc/doclet/dupThrowsTags/TestDupThrowsTags.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);
diff -r 58154bf80f90 -r 2e82ca64b25d test/langtools/jdk/javadoc/doclet/lib/JavadocTester.java
--- 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.
- *
- *
- * 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.
- *
- *
- * 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.
- *
- *
- * Typically, a test method will invoke javadoc, and then perform various
- * checks on the results. The standard checks are:
- *
- *
- * - checkExitCode
- *
- Check the exit code returned from javadoc.
- *
- checkOutput
- *
- 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.
- *
- checkFiles
- *
- 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.
- *
- *
- *
- * 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(args);
- * checkExit(Exit.OK);
- * checkOutput(file, true,
- * strings-to-find);
- * checkOutput(file, false,
- * strings-to-not-find);
- * }
- * }
- *
- *
- *
- * 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.
- *
- *
- * 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.
- *
- *
- * 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.
- *
- *
- * You can have many separate test methods, each identified with a @Test
- * annotation. However, you should not 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