diff --git a/langtools/test/com/sun/javadoc/5093723/T5093723.java b/langtools/test/com/sun/javadoc/5093723/T5093723.java index 1b23bb1a979..8bea133cc07 100644 --- a/langtools/test/com/sun/javadoc/5093723/T5093723.java +++ b/langtools/test/com/sun/javadoc/5093723/T5093723.java @@ -33,10 +33,8 @@ public class T5093723 extends JavadocTester { - private static final String BUG_ID = "5093723"; - private static final String[] ARGS = new String[] { - "-d", BUG_ID + ".out", "-Xdoclint:none", + "-d", OUTPUT_DIR + ".out", "-Xdoclint:none", SRC_DIR + "/DocumentedClass.java", SRC_DIR + "/UndocumentedClass.java" }; @@ -46,12 +44,4 @@ public class T5093723 extends JavadocTester { if (tester.runJavadoc(ARGS) != 0) throw new AssertionError("non-zero return code from javadoc"); } - - public String getBugId() { - return BUG_ID; - } - - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java b/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java index dd604ce7ed9..0aa3aca9852 100644 --- a/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java +++ b/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java @@ -34,30 +34,27 @@ public class AccessSummary extends JavadocTester { - private static final String BUG_ID = "4637604-4775148"; - private static final String OUTPUT_DIR1 = "docs1-" + BUG_ID + "/"; - /** * Assign value for [ fileToSearch, stringToFind ] */ private static final String[][] TESTARRAY1 = { // Test that the summary attribute appears - { OUTPUT_DIR1 + "overview-summary.html", + { "overview-summary.html", "summary=\"Packages table, listing packages, and an explanation\"" }, // Test that the summary attribute appears - { OUTPUT_DIR1 + "p1/C1.html", + { "p1/C1.html", "summary=\"Constructor Summary table, listing constructors, and an explanation\"" }, // Test that the summary attribute appears - { OUTPUT_DIR1 + "constant-values.html", + { "constant-values.html", "summary=\"Constant Field Values table, listing constant fields, and values\"" } }; // First test with -header only private static final String[] JAVADOC_ARGS = new String[] { - "-d", OUTPUT_DIR1, + "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "p1", "p2"}; @@ -70,18 +67,4 @@ public class AccessSummary extends JavadocTester { tester.run(JAVADOC_ARGS, TESTARRAY1, new String[][] {}); tester.printSummary(); // Necessary for string search } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java b/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java index 224ea865fbb..49456b5bfa0 100644 --- a/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java +++ b/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java @@ -39,8 +39,6 @@ import java.util.Date; public class MetaTag extends JavadocTester { //Test information. - private static final String BUG_ID = "4034096-4764726-6235799"; - private static final String OUTPUT_DIR = "docs-" + BUG_ID; private static final SimpleDateFormat m_dateFormat = new SimpleDateFormat("yyyy-MM-dd"); //Javadoc arguments. @@ -63,62 +61,62 @@ public class MetaTag extends JavadocTester { //Input for string search tests. private static final String[][] TEST = { - { OUTPUT_DIR + "/p1/C1.html", + { "p1/C1.html", "" }, - { OUTPUT_DIR + "/p1/C1.html", + { "p1/C1.html", "" }, - { OUTPUT_DIR + "/p1/C1.html", + { "p1/C1.html", "" }, - { OUTPUT_DIR + "/p1/C1.html", + { "p1/C1.html", "" }, - { OUTPUT_DIR + "/p1/C1.html", + { "p1/C1.html", "" }, - { OUTPUT_DIR + "/p1/package-summary.html", + { "p1/package-summary.html", "" }, - { OUTPUT_DIR + "/overview-summary.html", + { "overview-summary.html", "" }, //NOTE: Hopefully, this regression test is not run at midnight. If the output //was generated yesterday and this test is run today, the test will fail. - {OUTPUT_DIR + "/overview-summary.html", + { "overview-summary.html", ""}, }; private static final String[][] NEGATED_TEST2 = { //No keywords when -keywords is not used. - { OUTPUT_DIR + "-2/p1/C1.html", + { "p1/C1.html", "" }, - { OUTPUT_DIR + "-2/p1/C1.html", + { "p1/C1.html", "" }, - { OUTPUT_DIR + "-2/p1/C1.html", + { "p1/C1.html", "" }, - { OUTPUT_DIR + "-2/p1/C1.html", + { "p1/C1.html", "" }, - { OUTPUT_DIR + "-2/p1/C1.html", + { "p1/C1.html", "" }, - { OUTPUT_DIR + "-2/p1/package-summary.html", + { "p1/package-summary.html", "" }, - { OUTPUT_DIR + "-2/overview-summary.html", + { "overview-summary.html", "" }, //The date metatag should not show up when -notimestamp is used. //NOTE: Hopefully, this regression test is not run at midnight. If the output //was generated yesterday and this test is run today, the test will fail. - {OUTPUT_DIR + "-2/overview-summary.html", + { "overview-summary.html", ""}, }; @@ -133,18 +131,4 @@ public class MetaTag extends JavadocTester { tester.run(ARGS_NO_TIMESTAMP_NO_KEYWORDS, NO_TEST, NEGATED_TEST2); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java b/langtools/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java index d7631cfcf1e..aa7ba2dbb9e 100644 --- a/langtools/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java +++ b/langtools/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java @@ -37,12 +37,9 @@ public class PackagesHeader extends JavadocTester { //Test information. - private static final String BUG_ID = "4766385"; - private static final String OUTPUT_DIR = "docs-" + BUG_ID; - - private static final String OUTPUT_DIR1 = "docs1-" + BUG_ID + "/"; - private static final String OUTPUT_DIR2 = "docs2-" + BUG_ID + "/"; - private static final String OUTPUT_DIR3 = "docs3-" + BUG_ID + "/"; + private static final String OUTPUT_DIR1 = OUTPUT_DIR + "-1/"; + private static final String OUTPUT_DIR2 = OUTPUT_DIR + "-2/"; + private static final String OUTPUT_DIR3 = OUTPUT_DIR + "-3/"; /** * Assign value for [ fileToSearch, stringToFind ] @@ -50,7 +47,7 @@ public class PackagesHeader extends JavadocTester { private static final String[][] TESTARRAY1 = { // Test that the -header shows up in the packages frame - { OUTPUT_DIR1 + "overview-frame.html", + { "overview-frame.html", "Main Frame Header" } }; @@ -59,7 +56,7 @@ public class PackagesHeader extends JavadocTester { // Test that the -packagesheader string shows // up in the packages frame - { OUTPUT_DIR2 + "overview-frame.html", + { "overview-frame.html", "Packages Frame Header" } }; @@ -67,10 +64,10 @@ public class PackagesHeader extends JavadocTester { // Test that the both headers show up and are different - { OUTPUT_DIR3 + "overview-frame.html", + { "overview-frame.html", "Packages Frame Header" }, - { OUTPUT_DIR3 + "overview-summary.html", + { "overview-summary.html", "Main Frame Header" } }; @@ -110,18 +107,4 @@ public class PackagesHeader extends JavadocTester { tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/T6735320/T6735320.java b/langtools/test/com/sun/javadoc/T6735320/T6735320.java index 21c82a99beb..531e4a64bba 100644 --- a/langtools/test/com/sun/javadoc/T6735320/T6735320.java +++ b/langtools/test/com/sun/javadoc/T6735320/T6735320.java @@ -31,20 +31,11 @@ */ public class T6735320 extends JavadocTester { - private static final String BUG_ID = "6735320"; private static final String[] ARGS = new String[]{ - "-d", BUG_ID + ".out", + "-d", OUTPUT_DIR + ".out", SRC_DIR + "/SerialFieldTest.java" }; - public String getBugId() { - return BUG_ID; - } - - public String getBugName() { - return getClass().getName(); - } - public static void main(String... args) { T6735320 tester = new T6735320(); if (tester.runJavadoc(ARGS) == 0) { diff --git a/langtools/test/com/sun/javadoc/_template/Template.java b/langtools/test/com/sun/javadoc/_template/Template.java index 10429f72f2d..92a36f867df 100644 --- a/langtools/test/com/sun/javadoc/_template/Template.java +++ b/langtools/test/com/sun/javadoc/_template/Template.java @@ -33,10 +33,6 @@ public class Template extends JavadocTester { - //Test information. - private static final String BUG_ID = ""; - private static final String OUTPUT_DIR = "docs-" + BUG_ID; - //Javadoc arguments. private static final String[] ARGS = new String[] { "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR @@ -55,18 +51,4 @@ public class Template extends JavadocTester { tester.run(ARGS, TEST, NEGATED_TEST); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/_template/TemplateComplete.java b/langtools/test/com/sun/javadoc/_template/TemplateComplete.java index 428438c03f0..cb15e989a35 100644 --- a/langtools/test/com/sun/javadoc/_template/TemplateComplete.java +++ b/langtools/test/com/sun/javadoc/_template/TemplateComplete.java @@ -33,10 +33,6 @@ public class TemplateComplete extends JavadocTester { - //Test information. - private static final String BUG_ID = ""; - private static final String OUTPUT_DIR = "docs-" + BUG_ID; - //Javadoc arguments. private static final String[] ARGS = new String[] { "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR @@ -51,6 +47,8 @@ public class TemplateComplete extends JavadocTester { //Input for file diff test. + private static final String DIFFDIR1 = null; + private static final String DIFFDIR2 = null; private static final String[][] FILES_TO_DIFF = {}; /** @@ -61,21 +59,7 @@ public class TemplateComplete extends JavadocTester { TemplateComplete tester = new TemplateComplete(); int actualExitCode = tester.run(ARGS, TEST, NEGATED_TEST); tester.checkExitCode(EXPECTED_EXIT_CODE, actualExitCode); - tester.runDiffs(FILES_TO_DIFF, false); + tester.runDiffs(DIFFDIR1, DIFFDIR2, FILES_TO_DIFF, false); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java b/langtools/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java index 016ea3ed833..5c17d7ede6f 100644 --- a/langtools/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java +++ b/langtools/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java @@ -33,9 +33,8 @@ */ public class TestConstantValuesDriver extends JavadocTester { - private static final String BUG_ID = "4504730-4526070-5077317"; private static final String[] ARGS = new String[] { - "-d", BUG_ID, SRC_DIR + "/TestConstantValues.java", + "-d", OUTPUT_DIR, SRC_DIR + "/TestConstantValues.java", SRC_DIR + "/TestConstantValues2.java", SRC_DIR + "/A.java" }; @@ -47,30 +46,16 @@ public class TestConstantValuesDriver extends JavadocTester { public static void main(String[] args) { String[][] tests = new String[5][2]; for (int i = 0; i < tests.length-1; i++) { - tests[i][0] = BUG_ID + "/constant-values.html"; + tests[i][0] = "constant-values.html"; tests[i][1] = "TEST"+(i+1)+"PASSES"; } - tests[tests.length-1][0] = BUG_ID + "/constant-values.html"; + tests[tests.length-1][0] = "constant-values.html"; tests[tests.length-1][1] = "\"<Hello World>\""; TestConstantValuesDriver tester = new TestConstantValuesDriver(); tester.run(ARGS, tests, NO_TEST); tester.printSummary(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } - /** * @throws java.io.IOException Test 1 passes * @throws java.io.IOException Test 2 passes diff --git a/langtools/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java b/langtools/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java index 91a94211bb0..b186e6165d8 100644 --- a/langtools/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java +++ b/langtools/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java @@ -33,9 +33,8 @@ */ public class TestDupThrowsTags extends JavadocTester { - private static final String BUG_ID = "4525364"; private static final String[] ARGS = new String[] { - "-d", BUG_ID, SRC_DIR + "/TestDupThrowsTags.java" + "-d", OUTPUT_DIR, SRC_DIR + "/TestDupThrowsTags.java" }; /** @@ -45,7 +44,7 @@ public class TestDupThrowsTags extends JavadocTester { public static void main(String[] args) { String[][] tests = new String[4][2]; for (int i = 0; i < tests.length; i++) { - tests[i][0] = BUG_ID + "/TestDupThrowsTags.html"; + tests[i][0] = "TestDupThrowsTags.html"; tests[i][1] = "Test "+(i+1)+" passes"; } TestDupThrowsTags tester = new TestDupThrowsTags(); @@ -53,20 +52,6 @@ public class TestDupThrowsTags extends JavadocTester { tester.printSummary(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } - /** * @throws java.io.IOException Test 1 passes * @throws java.io.IOException Test 2 passes diff --git a/langtools/test/com/sun/javadoc/lib/JavadocTester.java b/langtools/test/com/sun/javadoc/lib/JavadocTester.java index 899de67d638..5149d9301fc 100644 --- a/langtools/test/com/sun/javadoc/lib/JavadocTester.java +++ b/langtools/test/com/sun/javadoc/lib/JavadocTester.java @@ -21,8 +21,6 @@ * questions. */ -import com.sun.javadoc.*; -import java.util.*; import java.io.*; @@ -56,6 +54,7 @@ public abstract class JavadocTester { protected static final String SRC_DIR = System.getProperty("test.src", "."); protected static final String JAVA_VERSION = System.getProperty("java.version"); + protected static final String OUTPUT_DIR = "out"; protected static final String[][] NO_TEST = new String[][] {}; protected static final String[] NO_FILE_TEST = new String[] {}; @@ -105,10 +104,15 @@ public abstract class JavadocTester { public StringWriter warnings; /** - * The buffer of warning output.. + * The buffer of warning output. */ public StringBuffer standardOut; + /** + * The output directory. + */ + private File outputDir; + /** * The current subtest number. */ @@ -130,18 +134,6 @@ public abstract class JavadocTester { public JavadocTester() { } - /** - * Return the bug id. - * @return the bug id - */ - public abstract String getBugId(); - - /** - * Return the name of the bug. - * @return the name of the bug - */ - public abstract String getBugName(); - /** * Execute the tests. * @@ -206,6 +198,13 @@ public abstract class JavadocTester { + javadocRunNum + ")..."); } initOutputBuffers(); + outputDir = new File("."); + for (int i = 0; i < args.length - 2; i++) { + if (args[i].equals("-d")) { + outputDir = new File(args[++i]); + break; + } + } ByteArrayOutputStream stdout = new ByteArrayOutputStream(); PrintStream prevOut = System.out; @@ -216,7 +215,7 @@ public abstract class JavadocTester { System.setErr(new PrintStream(stderr)); int returnCode = com.sun.tools.javadoc.Main.execute( - getBugName(), + "javadoc", new PrintWriter(errors, true), new PrintWriter(warnings, true), new PrintWriter(notices, true), @@ -258,60 +257,53 @@ public abstract class JavadocTester { * Run array of tests on the generated files. * This method accepts a fileTestArray for testing if a file is generated * and a negatedFileTestArray for testing if a file is not found. + * The files are relative to the most recent output directory specified + * with -d. * - * @param testArray the array of file tests - * @param negatedTestArray the array of negated file tests + * @param fileTestArray the array of file tests + * @param negatedFileTestArray the array of negated file tests */ public void runTestsOnFile(String[] fileTestArray, String[] negatedFileTestArray) { - runTestsOnFile(fileTestArray, false); - runTestsOnFile(negatedFileTestArray, true); + runTestsOnFile(outputDir, fileTestArray, false); + runTestsOnFile(outputDir, negatedFileTestArray, true); } /** * Run the array of tests on the resulting HTML. + * The files are relative to the most recent output directory specified + * with -d. * * @param testArray the array of tests * @param isNegated true if test is negated; false otherwise */ private void runTestsOnHTML(String[][] testArray , boolean isNegated) { - for (int i = 0; i < testArray.length; i++) { - + for (String[] test : testArray) { numTestsRun++; - System.out.print("Running subtest #" + numTestsRun + "... "); - // Get string to find - String stringToFind = testArray[i][1]; - + String stringToFind = test[1]; // Read contents of file into a string String fileString; try { - fileString = readFileToString(testArray[i][0]); + fileString = readFileToString(outputDir, test[0]); } catch (Error e) { if (isNegated) { - System.out.println( "FAILED" + "\n" - + "for bug " + getBugId() - + " (" + getBugName() + ") " - + "due to " - + e + "\n"); - continue; + System.out.println( "FAILED, due to " + e + "\n"); + continue; } throw e; } // Find string in file's contents boolean isFound = findString(fileString, stringToFind); - if ((isNegated && !isFound) || (!isNegated && isFound) ) { + if ((isNegated && !isFound) || (!isNegated && isFound)) { numTestsPassed += 1; - System.out.println( "Passed" + "\n" - + (isNegated ? "not found:" : "found:") + "\n" - + stringToFind + " in " + testArray[i][0] + "\n"); + System.out.println("Passed" + "\n" + + (isNegated ? "not found:" : "found:") + "\n" + + stringToFind + " in " + test[0] + "\n"); } else { - System.out.println( "FAILED" + "\n" - + "for bug " + getBugId() - + " (" + getBugName() + ")" + "\n" - + "when searching for:" + "\n" - + stringToFind - + " in " + testArray[i][0] + "\n"); + System.out.println("FAILED, when searching for:" + "\n" + + stringToFind + + " in " + test[0] + "\n"); } } } @@ -322,21 +314,15 @@ public abstract class JavadocTester { * @param testArray the array of file tests * @param isNegated true if test is negated; false otherwise */ - private void runTestsOnFile(String[] testArray, boolean isNegated) { - String fileName; - String failedString; - String passedString; - for (int i = 0; i < testArray.length; i++) { + private void runTestsOnFile(File baseDir, String[] testArray, boolean isNegated) { + for (String fileName : testArray) { numTestsRun++; - fileName = testArray[i]; - failedString = "FAILED" + "\n" - + "for bug " + getBugId() + " (" + getBugName() + ") " - + "file (" + fileName + ") found" + "\n"; - passedString = "Passed" + "\n" + - "file (" + fileName + ") not found" + "\n"; + String failedString = "FAILED: file (" + fileName + ") found" + "\n"; + String passedString = "Passed" + "\n" + + "file (" + fileName + ") not found" + "\n"; System.out.print("Running subtest #" + numTestsRun + "... "); try { - File file = new File(fileName); + File file = new File(baseDir, fileName); if ((file.exists() && !isNegated) || (!file.exists() && isNegated)) { numTestsPassed += 1; System.out.println(passedString); @@ -352,27 +338,33 @@ public abstract class JavadocTester { /** * Iterate through the list of given file pairs and diff each file. * - * @param filePairs the pairs of files to diff. - * @throws an Error is thrown if any differences are found between + * @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 + * @throws Error if any differences are found between * file pairs. */ - public void runDiffs(String[][] filePairs) throws Error { - runDiffs(filePairs, true); + public void runDiffs(String baseDir1, String baseDir2, String[] files) throws Error { + runDiffs(baseDir1, baseDir2, files, true); } /** * Iterate through the list of given file pairs and diff each file. * - * @param filePairs the pairs of files to diff. - * @param throwErrorIFNoMatch flag to indicate whether or not to throw + * @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 + * @param throwErrorIfNoMatch flag to indicate whether or not to throw * an error if the files do not match. * - * @throws an Error is thrown if any differences are found between - * file pairs and throwErrorIFNoMatch is true. + * @throws Error if any differences are found between + * file pairs and throwErrorIfNoMatch is true. */ - public void runDiffs(String[][] filePairs, boolean throwErrorIfNoMatch) throws Error { - for (int i = 0; i < filePairs.length; i++) { - diff(filePairs[i][0], filePairs[i][1], throwErrorIfNoMatch); + public void runDiffs(String baseDir1, String baseDir2, String[] files, boolean throwErrorIfNoMatch) throws Error { + File bd1 = new File(baseDir1); + File bd2 = new File(baseDir2); + for (String file : files) { + diff(bd1, bd2, file, throwErrorIfNoMatch); } } @@ -392,8 +384,7 @@ public abstract class JavadocTester { actualExitCode); numTestsPassed++; } else { - System.out.println( "FAILED" + "\n" + "for bug " + getBugId() - + " (" + getBugName() + ")" + "\n" + "Expected return code " + + System.out.println( "FAILED: expected return code " + expectedExitCode + " but got " + actualExitCode); } } @@ -410,8 +401,7 @@ public abstract class JavadocTester { // Test failed throw new Error("\n" + (numTestsRun - numTestsPassed) + " of " + (numTestsRun) - + " subtests failed for bug " + getBugId() - + " (" + getBugName() + ")" + "\n"); + + " subtests failed\n"); } } @@ -432,28 +422,39 @@ public abstract class JavadocTester { * @return the file in string format */ public String readFileToString(String fileName) throws Error { - if (fileName.equals(ERROR_OUTPUT)) { - return getErrorOutput(); - } else if (fileName.equals(NOTICE_OUTPUT)) { - return getNoticeOutput(); - } else if (fileName.equals(WARNING_OUTPUT)) { - return getWarningOutput(); - } else if (fileName.equals(STANDARD_OUTPUT)) { - return getStandardOutput(); + return readFileToString(outputDir, 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 readFileToString(File baseDir, String fileName) throws Error { + switch (fileName) { + case ERROR_OUTPUT: + return getErrorOutput(); + case NOTICE_OUTPUT: + return getNoticeOutput(); + case WARNING_OUTPUT: + return getWarningOutput(); + case STANDARD_OUTPUT: + return getStandardOutput(); } try { - File file = new File(fileName); + File file = new File(baseDir, fileName); if ( !file.exists() ) { System.out.println("\n" + "FILE DOES NOT EXIST: " + fileName); } - BufferedReader in = new BufferedReader(new FileReader(file)); - - // Create an array of characters the size of the file - char[] allChars = new char[(int)file.length()]; - - // Read the characters into the allChars array - in.read(allChars, 0, (int)file.length()); - in.close(); + char[] allChars; + try (BufferedReader in = new BufferedReader(new FileReader(file))) { + // Create an array of characters the size of the file + allChars = new char[(int)file.length()]; + // Read the characters into the allChars array + in.read(allChars, 0, (int)file.length()); + } // Convert to a string String allCharsString = new String(allChars); @@ -470,22 +471,24 @@ public abstract class JavadocTester { /** * Compare the two given files. * - * @param file1 the first file to compare. - * @param file2 the second file to compare. + * @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. */ - public boolean diff(String file1, String file2, boolean throwErrorIFNoMatch) throws Error { - String file1Contents = readFileToString(file1); - String file2Contents = readFileToString(file2); + private boolean diff(File baseDir1, File baseDir2, String file, + boolean throwErrorIFNoMatch) throws Error { + String file1Contents = readFileToString(baseDir1, file); + String file2Contents = readFileToString(baseDir2, file); numTestsRun++; if (file1Contents.trim().compareTo(file2Contents.trim()) == 0) { - System.out.println("Diff successful: " + file1 + ", " + file2); + System.out.println("Diff successful: " + new File(baseDir1, file) + ", " + new File(baseDir2, file)); numTestsPassed++; return true; } else if (throwErrorIFNoMatch) { - throw new Error("Diff failed: " + file1 + ", " + file2); + throw new Error("Diff failed: " + new File(baseDir1, file) + ", " + new File(baseDir2, file)); } else { return false; } @@ -559,12 +562,12 @@ public abstract class JavadocTester { destDirObj.mkdir(); } String[] files = targetDirObj.list(); - for (int i = 0; i < files.length; i++) { - File srcFile = new File(targetDirObj, files[i]); - File destFile = new File(destDirObj, files[i]); + for (String file : files) { + File srcFile = new File(targetDirObj, file); + File destFile = new File(destDirObj, file); if (srcFile.isFile()) { System.out.println("Copying " + srcFile + " to " + destFile); - copyFile(destFile, srcFile); + copyFile(destFile, srcFile); } else if(srcFile.isDirectory()) { copyDir(srcFile.getAbsolutePath(), destDirObj.getAbsolutePath()); } @@ -577,13 +580,15 @@ public abstract class JavadocTester { /** * Copy source file to destination file. * + * @param destfile the destination file + * @param srcfile the source file * @throws SecurityException * @throws IOException */ public static void copyFile(File destfile, File srcfile) throws IOException { byte[] bytearr = new byte[512]; - int len = 0; + int len; FileInputStream input = new FileInputStream(srcfile); File destDir = destfile.getParentFile(); destDir.mkdirs(); @@ -592,8 +597,7 @@ public abstract class JavadocTester { while ((len = input.read(bytearr)) != -1) { output.write(bytearr, 0, len); } - } catch (FileNotFoundException exc) { - } catch (SecurityException exc) { + } catch (FileNotFoundException | SecurityException exc) { } finally { input.close(); output.close(); diff --git a/langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java b/langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java index 7d7ff47ce95..292f571a185 100644 --- a/langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java +++ b/langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java @@ -34,9 +34,8 @@ public class TestAbsLinkPath extends JavadocTester { - private static final String BUG_ID = "4640745"; private static final String[][] TEST = { - {"tmp/pkg1/C1.html", "C2.html"}}; + { "pkg1/C1.html", "C2.html"}}; private static final String[] ARGS1 = new String[] { @@ -56,18 +55,4 @@ public class TestAbsLinkPath extends JavadocTester { tester.run(ARGS2, TEST, NO_TEST); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java b/langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java index a813bd16fd2..600affee6d2 100644 --- a/langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java +++ b/langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java @@ -35,18 +35,17 @@ public class TestAbstractMethod extends JavadocTester { //Test information. - private static final String BUG_ID = "8004891"; //Javadoc arguments. private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" + "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg" }; //Input for string search tests. private static final String[][] TEST = { - {BUG_ID + "/pkg/A.html", + { "pkg/A.html", "default void"}, - {BUG_ID + "/pkg/A.html", + { "pkg/A.html", "" + "All Methods " + "" + @@ -57,7 +56,7 @@ public class TestAbstractMethod extends JavadocTester { "" + "Default Methods" + " "}, - {BUG_ID + "/pkg/B.html", + { "pkg/B.html", "" + "All Methods " + "" + @@ -68,9 +67,9 @@ public class TestAbstractMethod extends JavadocTester { "" + "Concrete Methods" + " "}, - {BUG_ID + "/pkg/B.html", + { "pkg/B.html", "abstract void"}, - {BUG_ID + "/pkg/C.html", + { "pkg/C.html", "" + "All Methods " + "" + @@ -79,18 +78,18 @@ public class TestAbstractMethod extends JavadocTester { "" + "Default Methods" + " "}, - {BUG_ID + "/pkg/C.html", + { "pkg/C.html", "default void"} }; private static final String[][] NEGATED_TEST = { - {BUG_ID + "/pkg/A.html", + { "pkg/A.html", "abstract void"}, - {BUG_ID + "/pkg/B.html", + { "pkg/B.html", "Default Methods" + " "}, - {BUG_ID + "/pkg/B.html", + { "pkg/B.html", "default void"}, - {BUG_ID + "/pkg/C.html", + { "pkg/C.html", "Abstract Methods" + " "} }; @@ -104,18 +103,4 @@ public class TestAbstractMethod extends JavadocTester { tester.run(ARGS, TEST, NEGATED_TEST); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java b/langtools/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java index d611dbee8a8..af2472924fb 100644 --- a/langtools/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java +++ b/langtools/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java @@ -33,41 +33,40 @@ public class TestAnchorNames extends JavadocTester { - private static final String BUG_ID = "8025633"; //Input for string search tests. private static final String[][] TEST = { //Test some section markers and links to these markers - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, @@ -75,170 +74,170 @@ public class TestAnchorNames extends JavadocTester { //The marker for this appears in the serialized-form.html which we will //test below - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, //Test some fields - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/DeprMemClass.html", + { "pkg1/DeprMemClass.html", "" }, - {BUG_ID + "/pkg1/DeprMemClass.html", + { "pkg1/DeprMemClass.html", "" }, //Test constructor - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, //Test some methods - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", "" }, - {BUG_ID + "/pkg1/DeprMemClass.html", + { "pkg1/DeprMemClass.html", "" }, - {BUG_ID + "/pkg1/DeprMemClass.html", + { "pkg1/DeprMemClass.html", "" }, //Test enum - {BUG_ID + "/pkg1/RegClass.Te$t_Enum.html", + { "pkg1/RegClass.Te$t_Enum.html", "" }, - {BUG_ID + "/pkg1/RegClass.Te$t_Enum.html", + { "pkg1/RegClass.Te$t_Enum.html", "" }, //Test nested class - {BUG_ID + "/pkg1/RegClass._NestedClas$.html", + { "pkg1/RegClass._NestedClas$.html", "" }, - {BUG_ID + "/pkg1/RegClass._NestedClas$.html", + { "pkg1/RegClass._NestedClas$.html", "" }, //Test class use page - {BUG_ID + "/pkg1/class-use/DeprMemClass.html", + { "pkg1/class-use/DeprMemClass.html", "" }, //Test deprecated list page - {BUG_ID + "/deprecated-list.html", + { "deprecated-list.html", "" }, - {BUG_ID + "/deprecated-list.html", + { "deprecated-list.html", "" }, //Test constant values page - {BUG_ID + "/constant-values.html", + { "constant-values.html", "" }, //Test serialized form page //This is the marker for the link that appears in the pkg1.RegClass.html page - {BUG_ID + "/serialized-form.html", + { "serialized-form.html", "" }, //Test member name index page - {BUG_ID + "/index-all.html", + { "index-all.html", "" }, - {BUG_ID + "/index-all.html", + { "index-all.html", "$" }, - {BUG_ID + "/index-all.html", + { "index-all.html", "_" } }; @@ -246,22 +245,22 @@ public class TestAnchorNames extends JavadocTester { private static final String[][] NEGATED_TEST = { //The marker name conversion should only affect HTML anchors. It should not //affect the lables. - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", " Z:Z_" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", " Z:Z:Dfield" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", " Z:Z_field_In_Class" }, - {BUG_ID + "/pkg1/RegClass.html", + { "pkg1/RegClass.html", " S_:D:D:D:D:DINT" }, }; private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1" + "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-use", "pkg1" }; /** @@ -273,18 +272,4 @@ public class TestAnchorNames extends JavadocTester { tester.run(ARGS, TEST, NEGATED_TEST); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java b/langtools/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java index 5bc524bdff1..d2d5108356d 100644 --- a/langtools/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java +++ b/langtools/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java @@ -35,17 +35,14 @@ public class TestAnnotationOptional extends JavadocTester { - //Test information. - private static final String BUG_ID = "NO_BUG_ID_YET"; - //Javadoc arguments. private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" + "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg" }; //Input for string search tests. private static final String[][] TEST = { - {BUG_ID + "/pkg/AnnotationOptional.html", + { "pkg/AnnotationOptional.html", "" } }; @@ -58,18 +55,4 @@ public class TestAnnotationOptional extends JavadocTester { tester.run(ARGS, TEST, NO_TEST); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java b/langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java index c98da5c8ab9..b870b2618a7 100644 --- a/langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java +++ b/langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java @@ -34,47 +34,44 @@ public class TestAnnotationTypes extends JavadocTester { - //Test information. - private static final String BUG_ID = "4973609-8015249"; - //Javadoc arguments. private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" + "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg" }; //Input for string search tests. private static final String[][] TEST = { - {BUG_ID + "/pkg/AnnotationTypeField.html", + { "pkg/AnnotationTypeField.html", "
  • Summary: 
  • \n" + "
  • Field | 
  • "}, - {BUG_ID + "/pkg/AnnotationTypeField.html", + { "pkg/AnnotationTypeField.html", "
  • Detail: 
  • \n" + "
  • Field | 
  • "}, - {BUG_ID + "/pkg/AnnotationTypeField.html", + { "pkg/AnnotationTypeField.html", ""}, - {BUG_ID + "/pkg/AnnotationTypeField.html", + { "pkg/AnnotationTypeField.html", "

    Field Summary

    "}, - {BUG_ID + "/pkg/AnnotationTypeField.html", + { "pkg/AnnotationTypeField.html", "DEFAULT_NAME" + " "}, - {BUG_ID + "/pkg/AnnotationTypeField.html", + { "pkg/AnnotationTypeField.html", ""}, - {BUG_ID + "/pkg/AnnotationTypeField.html", + { "pkg/AnnotationTypeField.html", "

    DEFAULT_NAME

    \n" + "
    public static final java." +
                 "lang.String DEFAULT_NAME
    "}, - {BUG_ID + "/pkg/AnnotationType.html", + { "pkg/AnnotationType.html", "
  • Summary: 
  • \n" + "
  • Field | 
  • "}, - {BUG_ID + "/pkg/AnnotationType.html", + { "pkg/AnnotationType.html", "
  • Detail: 
  • \n" + "
  • Field | 
  • "}, }; private static final String[][] NEGATED_TEST = { - {BUG_ID + "/pkg/AnnotationType.html", + { "pkg/AnnotationType.html", "
    \n\n" + "

    \n\n" + "

    " + @@ -90,18 +87,4 @@ public class TestAnnotationTypes extends JavadocTester { tester.run(ARGS, TEST, NEGATED_TEST); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java b/langtools/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java index 85c71c47ce7..f7973439012 100644 --- a/langtools/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java +++ b/langtools/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java @@ -35,12 +35,11 @@ public class TestBackSlashInLink extends JavadocTester { - private static final String BUG_ID = "4511110"; private static final String[][] TEST = { - {BUG_ID + "/C.html", "src-html/C.html#line.7"}}; + { "C.html", "src-html/C.html#line.7"}}; private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, + "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-linksource", SRC_DIR + "/C.java"}; /** @@ -52,18 +51,4 @@ public class TestBackSlashInLink extends JavadocTester { tester.run(ARGS, TEST, NO_TEST); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/testBadPackageFileInJar/TestBadPackageFileInJar.java b/langtools/test/com/sun/javadoc/testBadPackageFileInJar/TestBadPackageFileInJar.java index 5c8b1abe17a..32bca3224a2 100644 --- a/langtools/test/com/sun/javadoc/testBadPackageFileInJar/TestBadPackageFileInJar.java +++ b/langtools/test/com/sun/javadoc/testBadPackageFileInJar/TestBadPackageFileInJar.java @@ -35,10 +35,6 @@ public class TestBadPackageFileInJar extends JavadocTester { - protected static final String FS = System.getProperty("file.separator"); - - private static final String BUG_ID = "4691095"; - private static final String[][] TEST = new String[][] { {ERROR_OUTPUT, @@ -47,7 +43,7 @@ public class TestBadPackageFileInJar extends JavadocTester { private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-classpath", + "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-classpath", SRC_DIR + "/badPackageFileInJar.jar", "pkg"}; @@ -60,18 +56,4 @@ public class TestBadPackageFileInJar extends JavadocTester { tester.run(ARGS, TEST, NO_TEST); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java b/langtools/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java index 59936389e72..cf60a9f6edb 100644 --- a/langtools/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java +++ b/langtools/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java @@ -35,12 +35,9 @@ public class TestBadSourceFile extends JavadocTester { - //Test information. - private static final String BUG_ID = "4835749"; - //Javadoc arguments. private static final String[] ARGS = new String[] { - "-Xdoclint:none", "-d", BUG_ID, SRC_DIR + "/C2.java" + "-Xdoclint:none", "-d", OUTPUT_DIR, SRC_DIR + "/C2.java" }; /** @@ -53,18 +50,4 @@ public class TestBadSourceFile extends JavadocTester { tester.checkExitCode(0, exitCode); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/testBaseClass/TestBaseClass.java b/langtools/test/com/sun/javadoc/testBaseClass/TestBaseClass.java index 782b6d07879..d25e8e06b30 100644 --- a/langtools/test/com/sun/javadoc/testBaseClass/TestBaseClass.java +++ b/langtools/test/com/sun/javadoc/testBaseClass/TestBaseClass.java @@ -35,7 +35,6 @@ public class TestBaseClass extends JavadocTester { - private static final String BUG_ID = "4197513"; private static final String[] ARGS = new String[] { "-sourcepath", SRC_DIR, @@ -52,18 +51,4 @@ public class TestBaseClass extends JavadocTester { throw new Error("Javadoc failed to execute."); } } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java b/langtools/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java index 56fa6b33c73..f0dd06e3feb 100644 --- a/langtools/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java +++ b/langtools/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java @@ -37,13 +37,12 @@ public class TestBreakIterator extends JavadocTester { - private static final String BUG_ID = "4165985"; private static final String[][] TEST = { - {BUG_ID + "/pkg/BreakIteratorTest.html", + { "pkg/BreakIteratorTest.html", "The class is empty (i.e. it has no members)."}}; private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, + "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-breakiterator", "pkg"}; /** @@ -55,18 +54,4 @@ public class TestBreakIterator extends JavadocTester { tester.run(ARGS, TEST, NO_TEST); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java b/langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java index fc6925a9fb5..5bac9a6f553 100644 --- a/langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java +++ b/langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java @@ -37,17 +37,14 @@ import java.util.*; public class TestCRLineSeparator extends JavadocTester { - //Test information. - private static final String BUG_ID = "4979486-8014636"; - //Javadoc arguments. private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", ".", "pkg" + "-d", OUTPUT_DIR, "-sourcepath", ".", "pkg" }; //Input for string search tests. private static final String[][] TEST = { - {BUG_ID + "/pkg/MyClass.html", "Line 1\n" + + { "pkg/MyClass.html", "Line 1\n" + " Line 2"} }; @@ -63,20 +60,6 @@ public class TestCRLineSeparator extends JavadocTester { tester.printSummary(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } - // recursively copy files from fromDir to toDir, replacing newlines // with \r static void initFiles(File fromDir, File toDir, String f) throws IOException { diff --git a/langtools/test/com/sun/javadoc/testCharset/TestCharset.java b/langtools/test/com/sun/javadoc/testCharset/TestCharset.java index c6b1483bd67..d851a659c98 100644 --- a/langtools/test/com/sun/javadoc/testCharset/TestCharset.java +++ b/langtools/test/com/sun/javadoc/testCharset/TestCharset.java @@ -34,25 +34,22 @@ public class TestCharset extends JavadocTester { - //Test information. - private static final String BUG_ID = "7052170"; - //Javadoc arguments. private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-charset", "UTF-8", "-sourcepath", SRC_DIR, "pkg" + "-d", OUTPUT_DIR, "-charset", "UTF-8", "-sourcepath", SRC_DIR, "pkg" }; private static final String[][] TEST = { - {BUG_ID + "/index.html", + { "index.html", ""}, - {BUG_ID + "/pkg/Foo.html", + { "pkg/Foo.html", ""} }; private static final String[][] NEGATED_TEST = { - {BUG_ID + "/index.html", + { "index.html", ""}, - {BUG_ID + "/pkg/Foo.html", + { "pkg/Foo.html", ""} }; @@ -65,18 +62,4 @@ public class TestCharset extends JavadocTester { tester.run(ARGS, TEST, NEGATED_TEST); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java b/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java index 45163f48407..6617c6e61ec 100644 --- a/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java +++ b/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java @@ -34,20 +34,19 @@ public class TestClassCrossReferences extends JavadocTester { - private static final String BUG_ID = "4652655-4857717"; private static final String[][] TEST = { - {BUG_ID + "/C.html", + { "C.html", "Link to math package"}, - {BUG_ID + "/C.html", + { "C.html", "Link to AttributeContext innerclass"}, - {BUG_ID + "/C.html", + { "C.html", "Link to external class BigDecimal"}, - {BUG_ID + "/C.html", + { "C.html", "Link to external member gcd"}, - {BUG_ID + "/C.html", + { "C.html", "

    \n" + "
    Overrides:
    \n" + "
    toString in class java.lang.Object
    \n" + @@ -55,7 +54,7 @@ public class TestClassCrossReferences extends JavadocTester { }; private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, + "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-linkoffline", "http://java.sun.com/j2se/1.4/docs/api/", SRC_DIR, SRC_DIR + "/C.java"}; @@ -68,18 +67,4 @@ public class TestClassCrossReferences extends JavadocTester { tester.run(ARGS, TEST, NO_TEST); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } } diff --git a/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java b/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java index d739eb93e53..9215c4e54fc 100644 --- a/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java +++ b/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java @@ -37,22 +37,19 @@ public class TestClassTree extends JavadocTester { - //Test information. - private static final String BUG_ID = "4632553-4973607"; - //Javadoc arguments. private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" + "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg" }; //Input for string search tests. private static final String[][] TEST = { - {BUG_ID + "/pkg/package-tree.html", + { "pkg/package-tree.html", "