Fri, 28 Aug 2009 12:12:08 -0700
6876782: two javadoc tests fail on Windows
Reviewed-by: darcy
1.1 --- a/test/com/sun/javadoc/lib/JavadocTester.java Thu Aug 27 18:25:21 2009 -0700 1.2 +++ b/test/com/sun/javadoc/lib/JavadocTester.java Fri Aug 28 12:12:08 2009 -0700 1.3 @@ -124,6 +124,14 @@ 1.4 private static int javadocRunNum = 0; 1.5 1.6 /** 1.7 + * Whether or not to match newlines exactly. 1.8 + * Set this value to false if the match strings 1.9 + * contain text from javadoc comments containing 1.10 + * non-platform newlines. 1.11 + */ 1.12 + protected boolean exactNewlineMatch = true; 1.13 + 1.14 + /** 1.15 * Construct a JavadocTester. 1.16 */ 1.17 public JavadocTester() { 1.18 @@ -419,15 +427,22 @@ 1.19 /** 1.20 * Search for the string in the given file and return true 1.21 * if the string was found. 1.22 + * If exactNewlineMatch is false, newlines will be normalized 1.23 + * before the comparison. 1.24 * 1.25 * @param fileString the contents of the file to search through 1.26 * @param stringToFind the string to search for 1.27 * @return true if the string was found 1.28 */ 1.29 private boolean findString(String fileString, String stringToFind) { 1.30 - return fileString.indexOf(stringToFind) >= 0; 1.31 + if (exactNewlineMatch) { 1.32 + return fileString.indexOf(stringToFind) >= 0; 1.33 + } else { 1.34 + return fileString.replace(NL, "\n").indexOf(stringToFind.replace(NL, "\n")) >= 0; 1.35 + } 1.36 } 1.37 1.38 + 1.39 /** 1.40 * Return the standard output. 1.41 * @return the standard output
2.1 --- a/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Thu Aug 27 18:25:21 2009 -0700 2.2 +++ b/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Fri Aug 28 12:12:08 2009 -0700 2.3 @@ -351,6 +351,7 @@ 2.4 */ 2.5 public static void main(String[] args) { 2.6 TestHtmlDefinitionListTag tester = new TestHtmlDefinitionListTag(); 2.7 + tester.exactNewlineMatch = false; 2.8 run(tester, ARGS1, TEST_ALL, NEGATED_TEST); 2.9 run(tester, ARGS1, TEST_CMNT_DEPR, NEGATED_TEST); 2.10 run(tester, ARGS2, TEST_ALL, NEGATED_TEST);
3.1 --- a/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java Thu Aug 27 18:25:21 2009 -0700 3.2 +++ b/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java Fri Aug 28 12:12:08 2009 -0700 3.3 @@ -128,6 +128,7 @@ 3.4 */ 3.5 public static void main(String[] args) { 3.6 TestSerializedFormDeprecationInfo tester = new TestSerializedFormDeprecationInfo(); 3.7 + tester.exactNewlineMatch = false; 3.8 run(tester, ARGS1, TEST_CMNT_DEPR, TEST_NOCMNT); 3.9 run(tester, ARGS2, TEST_NOCMNT, TEST_CMNT_DEPR); 3.10 run(tester, ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR);