# HG changeset patch # User jjg # Date 1482242761 28800 # Node ID 2f0b2a65b2848b9bb7f3d88593df1cb1ec9f6969 # Parent 1768507dae6b3621fa27852cf271e6117e8f2e32 8171413: jdk/javadoc/doclet/testModules/TestModules.java failed due to some subtests failed Reviewed-by: bpatel diff -r 1768507dae6b -r 2f0b2a65b284 langtools/test/ProblemList.txt --- a/langtools/test/ProblemList.txt Tue Dec 20 05:50:39 2016 -0800 +++ b/langtools/test/ProblemList.txt Tue Dec 20 06:06:01 2016 -0800 @@ -32,8 +32,6 @@ jdk/javadoc/tool/varArgs/Main.java 8152313 generic-all convert to doclet test framework jdk/javadoc/doclet/testIOException/TestIOException.java 8164597 windows-all -jdk/javadoc/doclet/testModules/TestModules.java 8171413 generic-all jdk/javadoc/doclet/testModules/TestModules.java failed due to some subtests failed - ########################################################################### # # jshell diff -r 1768507dae6b -r 2f0b2a65b284 langtools/test/jdk/javadoc/doclet/lib/JavadocTester.java --- a/langtools/test/jdk/javadoc/doclet/lib/JavadocTester.java Tue Dec 20 05:50:39 2016 -0800 +++ b/langtools/test/jdk/javadoc/doclet/lib/JavadocTester.java Tue Dec 20 06:06:01 2016 -0800 @@ -373,6 +373,25 @@ * 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 + * 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 all of the strings are expected to be * not found * @param strings the strings to be searched for @@ -383,11 +402,9 @@ try { fileString = readFile(outputDir, path); } catch (Error e) { - if (!expectedFound) { - failed("Error reading file: " + e); - return; - } - throw e; + checking("Read file"); + failed("Error reading file: " + e); + return; } checkOutput(path, fileString, expectedFound, strings); } @@ -413,10 +430,10 @@ // Find string in file's contents boolean isFound = findString(fileString, stringToFind); if (isFound == expectedFound) { - passed(path + ": " + (isFound ? "found:" : "not found:") + "\n" + passed(path + ": following text " + (isFound ? "found:" : "not found:") + "\n" + stringToFind + "\n"); } else { - failed(path + ": " + (isFound ? "found:" : "not found:") + "\n" + failed(path + ": following text " + (isFound ? "found:" : "not found:") + "\n" + stringToFind + "\n"); } } @@ -464,9 +481,9 @@ File file = new File(outputDir, path); boolean isFound = file.exists(); if (isFound == expectedFound) { - passed(path + ": " + (isFound ? "found:" : "not found:") + "\n"); + passed(path + ": file " + (isFound ? "found:" : "not found:") + "\n"); } else { - failed(path + ": " + (isFound ? "found:" : "not found:") + "\n"); + failed(path + ": file " + (isFound ? "found:" : "not found:") + "\n"); } } } @@ -619,11 +636,9 @@ fileContentCache.put(file, new SoftReference<>(content)); return content; } catch (FileNotFoundException e) { - System.err.println(e); - throw new Error("File not found: " + fileName); + throw new Error("File not found: " + fileName + ": " + e); } catch (IOException e) { - System.err.println(e); - throw new Error("Error reading file: " + fileName); + throw new Error("Error reading file: " + fileName + ": " + e); } } diff -r 1768507dae6b -r 2f0b2a65b284 langtools/test/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java --- a/langtools/test/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java Tue Dec 20 05:50:39 2016 -0800 +++ b/langtools/test/jdk/javadoc/doclet/testHelpOption/TestHelpOption.java Tue Dec 20 06:06:01 2016 -0800 @@ -171,7 +171,7 @@ "-notimestamp ", "-sourcetab "); - checkOutput("Sample.html", !withOption, + checkFileAndOutput("Sample.html", !withOption, "
  • Help
  • "); } } diff -r 1768507dae6b -r 2f0b2a65b284 langtools/test/jdk/javadoc/doclet/testIndentation/p/IndentAnnot.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/test/jdk/javadoc/doclet/testIndentation/p/IndentAnnot.java Tue Dec 20 06:06:01 2016 -0800 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2015, 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 p; + +public class IndentAnnot { + public void f1(int a, int b) {} + + public void f2(int a, Object... b) {} + + @Deprecated + public void f3(int a, int b) {} + + @SafeVarargs + public void f4(int a, Object... b) {} + + @SafeVarargs + @Deprecated + public void f5(int a, Object... b) {} +} diff -r 1768507dae6b -r 2f0b2a65b284 langtools/test/jdk/javadoc/doclet/testModules/TestModules.java --- a/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java Tue Dec 20 05:50:39 2016 -0800 +++ b/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java Tue Dec 20 06:06:01 2016 -0800 @@ -550,11 +550,11 @@ } void checkModuleFilesAndLinks(boolean found) { - checkOutput("testpkgmdlA/package-summary.html", found, + checkFileAndOutput("testpkgmdlA/package-summary.html", found, "
  • Module
  • ", "
    Module " + "moduleA
    "); - checkOutput("testpkgmdlA/TestClassInModuleA.html", found, + checkFileAndOutput("testpkgmdlA/TestClassInModuleA.html", found, "
  • Module
  • ", "
    Module " + "moduleA
    "); @@ -618,14 +618,9 @@ + "\n" + "Module\n" + "Packages\n" - + "\n" - + "\n" - + "\n" - + "moduleB\n" - + "testpkgmdlB\n" - + "\n" - + "\n" - + ""); + + "\n", + "moduleB\n" + + "testpkgmdlB\n"); checkOutput("moduleB-summary.html", true, "TestClassInModuleB\n" + "With a test description for uses. "); @@ -663,14 +658,9 @@ + "\n" + "Module\n" + "Packages\n" - + "\n" - + "\n" - + "\n" - + "moduleB\n" - + "testpkgmdlB\n" - + "\n" - + "\n" - + ""); + + "\n", + "moduleB\n" + + "testpkgmdlB\n"); } void checkModuleModeApi(boolean found) {