8040904: Ensure javadoc tests do not overwrite results within tests

Reviewed-by: ksrini
This commit is contained in:
Jonathan Gibbons 2014-04-25 13:08:41 -07:00
parent e5a91499f0
commit 6c24c7e153
13 changed files with 384 additions and 293 deletions

View file

@ -113,6 +113,46 @@ public abstract class JavadocTester {
*/ */
private File outputDir; private File outputDir;
/**
* Alternatives for checking the contents of a directory.
*/
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)
throw new Error("directory has unexpected content: " + dir);
}
}
}
private DirectoryCheck outputDirectoryCheck = DirectoryCheck.EMPTY;
/** /**
* The current subtest number. * The current subtest number.
*/ */
@ -206,6 +246,8 @@ public abstract class JavadocTester {
} }
} }
outputDirectoryCheck.check(outputDir);
ByteArrayOutputStream stdout = new ByteArrayOutputStream(); ByteArrayOutputStream stdout = new ByteArrayOutputStream();
PrintStream prevOut = System.out; PrintStream prevOut = System.out;
System.setOut(new PrintStream(stdout)); System.setOut(new PrintStream(stdout));
@ -231,6 +273,15 @@ public abstract class JavadocTester {
return returnCode; return returnCode;
} }
/**
* Set a filter to check the initial contents of the output directory
* before javadoc is run.
* The filter should return true for files that should <b>not</b> appear.
*/
public void setCheckOutputDirectoryCheck(DirectoryCheck c) {
outputDirectoryCheck = c;
}
/** /**
* Create new string writer buffers * Create new string writer buffers
*/ */

View file

@ -86,10 +86,12 @@ public class TestDocFileDir extends JavadocTester {
*/ */
public static void main(String[] args) { public static void main(String[] args) {
TestDocFileDir tester = new TestDocFileDir(); TestDocFileDir tester = new TestDocFileDir();
tester.setCheckOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES);
copyDir(SRC_DIR + "/pkg", "."); copyDir(SRC_DIR + "/pkg", ".");
tester.run(ARGS0, TEST0, NO_TEST); tester.run(ARGS0, TEST0, NO_TEST);
copyDir(SRC_DIR + "/pkg", OUTPUT_DIR + "-1"); copyDir(SRC_DIR + "/pkg", OUTPUT_DIR + "-1");
tester.run(ARGS1, TEST1, NO_TEST); tester.run(ARGS1, TEST1, NO_TEST);
tester.setCheckOutputDirectoryCheck(DirectoryCheck.NONE);
tester.run(ARGS2, NO_TEST, NO_TEST, FILE_TEST2, FILE_NEGATED_TEST2); tester.run(ARGS2, NO_TEST, NO_TEST, FILE_TEST2, FILE_NEGATED_TEST2);
tester.printSummary(); tester.printSummary();
} }

View file

@ -58,7 +58,7 @@ public class TestGeneratedBy extends JavadocTester {
private static final String[] NO_TIMESTAMP_ARGS = private static final String[] NO_TIMESTAMP_ARGS =
new String[] { new String[] {
"-notimestamp", "-notimestamp",
"-d", OUTPUT_DIR, "-d", OUTPUT_DIR + "-1",
"-sourcepath", SRC_DIR, "-sourcepath", SRC_DIR,
"pkg" "pkg"
}; };

View file

@ -45,7 +45,7 @@ public class TestGroupOption extends JavadocTester {
}; };
private static final String[] ARGS2 = new String[] { private static final String[] ARGS2 = new String[] {
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-d", OUTPUT_DIR + "-1", "-sourcepath", SRC_DIR,
"-group", "Package One", "pkg1", "-group", "Package One", "pkg1",
"-group", "Package One", "pkg2", "-group", "Package One", "pkg2",
"-group", "Package One", "pkg3", "-group", "Package One", "pkg3",

View file

@ -40,11 +40,12 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
// Optional Element should print properly nested definition list tags // Optional Element should print properly nested definition list tags
// for default value. // for default value.
private static final String[][] TEST_ALL = { private static final String[][] TEST_ALL = {
{ "pkg1/C1.html", "<pre>public class " + { "pkg1/C1.html",
"<span class=\"typeNameLabel\">C1</span>\n" + "<pre>public class <span class=\"typeNameLabel\">C1</span>\n" +
"extends java.lang.Object\n" + "extends java.lang.Object\n" +
"implements java.io.Serializable</pre>"}, "implements java.io.Serializable</pre>"},
{ "pkg1/C4.html", "<dl>\n" + { "pkg1/C4.html",
"<dl>\n" +
"<dt>Default:</dt>\n" + "<dt>Default:</dt>\n" +
"<dd>true</dd>\n" + "<dd>true</dd>\n" +
"</dl>"}}; "</dl>"}};
@ -53,11 +54,13 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
// serialized form should have properly nested definition list tags // serialized form should have properly nested definition list tags
// enclosing comments, tags and deprecated information. // enclosing comments, tags and deprecated information.
private static final String[][] TEST_CMNT_DEPR = { private static final String[][] TEST_CMNT_DEPR = {
{ "pkg1/package-summary.html", "<dl>\n" + { "pkg1/package-summary.html",
"<dl>\n" +
"<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" +
"<dd>JDK1.0</dd>\n" + "<dd>JDK1.0</dd>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C1.html", "<dl>\n" + { "pkg1/C1.html",
"<dl>\n" +
"<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" +
"<dd>JDK1.0</dd>\n" + "<dd>JDK1.0</dd>\n" +
"<dt><span class=\"seeLabel\">See Also:</span></dt>\n" + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" +
@ -66,18 +69,18 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
"<a href=\"../serialized-form.html#pkg1.C1\">" + "<a href=\"../serialized-form.html#pkg1.C1\">" +
"Serialized Form</a></dd>\n" + "Serialized Form</a></dd>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C1.html", "<dl>\n" + { "pkg1/C1.html",
"<dl>\n" +
"<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" +
"<dd>1.4</dd>\n" + "<dd>1.4</dd>\n" +
"<dt><span class=\"seeLabel\">See Also:</span></dt>\n" + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" +
"<dd>" + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" +
"<a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>setUndecorated(boolean)</code></a></dd>\n" + "<code>setUndecorated(boolean)</code></a></dd>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C1.html", "<dl>\n" + { "pkg1/C1.html",
"<dl>\n" +
"<dt><span class=\"paramLabel\">Parameters:</span></dt>\n" + "<dt><span class=\"paramLabel\">Parameters:</span></dt>\n" +
"<dd><code>title" + "<dd><code>title</code> - the title</dd>\n" +
"</code> - the title</dd>\n" +
"<dd><code>test</code> - boolean value" + "<dd><code>test</code> - boolean value" +
"</dd>\n" + "</dd>\n" +
"<dt><span class=\"throwsLabel\">Throws:</span></dt>\n" + "<dt><span class=\"throwsLabel\">Throws:</span></dt>\n" +
@ -87,7 +90,8 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
"device</dd>\n" + "device</dd>\n" +
"<dd><code>HeadlessException</code></dd>\n" + "<dd><code>HeadlessException</code></dd>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C1.html", "<dl>\n" + { "pkg1/C1.html",
"<dl>\n" +
"<dt><span class=\"paramLabel\">Parameters:</span></dt>\n" + "<dt><span class=\"paramLabel\">Parameters:</span></dt>\n" +
"<dd><code>undecorated" + "<dd><code>undecorated" +
"</code> - <code>true</code> if no decorations are\n" + "</code> - <code>true</code> if no decorations are\n" +
@ -102,7 +106,8 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
"<a href=\"../pkg1/C1.html#readObject--\"><code>readObject()" + "<a href=\"../pkg1/C1.html#readObject--\"><code>readObject()" +
"</code></a></dd>\n" + "</code></a></dd>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C1.html", "<dl>\n" + { "pkg1/C1.html",
"<dl>\n" +
"<dt><span class=\"throwsLabel\">Throws:</span></dt>\n" + "<dt><span class=\"throwsLabel\">Throws:</span></dt>\n" +
"<dd><code>java.io.IOException</code></dd>\n" + "<dd><code>java.io.IOException</code></dd>\n" +
"<dt><span class=\"seeLabel\">See Also:" + "<dt><span class=\"seeLabel\">See Also:" +
@ -110,7 +115,8 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
"<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>setUndecorated(boolean)</code></a></dd>\n" + "<code>setUndecorated(boolean)</code></a></dd>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C2.html", "<dl>\n" + { "pkg1/C2.html",
"<dl>\n" +
"<dt><span class=\"paramLabel\">Parameters:" + "<dt><span class=\"paramLabel\">Parameters:" +
"</span></dt>\n" + "</span></dt>\n" +
"<dd><code>set</code> - boolean</dd>\n" + "<dd><code>set</code> - boolean</dd>\n" +
@ -118,7 +124,8 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
"Since:</span></dt>\n" + "Since:</span></dt>\n" +
"<dd>1.4</dd>\n" + "<dd>1.4</dd>\n" +
"</dl>"}, "</dl>"},
{ "serialized-form.html", "<dl>\n" + { "serialized-form.html",
"<dl>\n" +
"<dt><span class=\"throwsLabel\">Throws:</span>" + "<dt><span class=\"throwsLabel\">Throws:</span>" +
"</dt>\n" + "</dt>\n" +
"<dd><code>" + "<dd><code>" +
@ -168,11 +175,13 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
// should display properly nested definition list tags for comments, tags // should display properly nested definition list tags for comments, tags
// and deprecated information. // and deprecated information.
private static final String[][] TEST_NODEPR = { private static final String[][] TEST_NODEPR = {
{ "pkg1/package-summary.html", "<dl>\n" + { "pkg1/package-summary.html",
"<dl>\n" +
"<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" +
"<dd>JDK1.0</dd>\n" + "<dd>JDK1.0</dd>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C1.html", "<dl>\n" + { "pkg1/C1.html",
"<dl>\n" +
"<dt><span class=\"simpleTagLabel\">Since:</span>" + "<dt><span class=\"simpleTagLabel\">Since:</span>" +
"</dt>\n" + "</dt>\n" +
"<dd>JDK1.0</dd>\n" + "<dd>JDK1.0</dd>\n" +
@ -183,7 +192,8 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
"<a href=\"../serialized-form.html#pkg1.C1\">" + "<a href=\"../serialized-form.html#pkg1.C1\">" +
"Serialized Form</a></dd>\n" + "Serialized Form</a></dd>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C1.html", "<dl>\n" + { "pkg1/C1.html",
"<dl>\n" +
"<dt><span class=\"paramLabel\">Parameters:" + "<dt><span class=\"paramLabel\">Parameters:" +
"</span></dt>\n" + "</span></dt>\n" +
"<dd><code>title</code> - the title</dd>\n" + "<dd><code>title</code> - the title</dd>\n" +
@ -198,7 +208,8 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
"<dd><code>" + "<dd><code>" +
"HeadlessException</code></dd>\n" + "HeadlessException</code></dd>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C1.html", "<dl>\n" + { "pkg1/C1.html",
"<dl>\n" +
"<dt><span class=\"paramLabel\">Parameters:" + "<dt><span class=\"paramLabel\">Parameters:" +
"</span></dt>\n" + "</span></dt>\n" +
"<dd><code>undecorated</code> - <code>true</code>" + "<dd><code>undecorated</code> - <code>true</code>" +
@ -212,7 +223,8 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
"<dd><a href=\"../pkg1/C1.html#readObject--\">" + "<dd><a href=\"../pkg1/C1.html#readObject--\">" +
"<code>readObject()</code></a></dd>\n" + "<code>readObject()</code></a></dd>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C1.html", "<dl>\n" + { "pkg1/C1.html",
"<dl>\n" +
"<dt><span class=\"throwsLabel\">Throws:</span>" + "<dt><span class=\"throwsLabel\">Throws:</span>" +
"</dt>\n" + "</dt>\n" +
"<dd><code>java.io.IOException</code></dd>\n" + "<dd><code>java.io.IOException</code></dd>\n" +
@ -221,7 +233,8 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
"<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" +
"<code>setUndecorated(boolean)</code></a></dd>\n" + "<code>setUndecorated(boolean)</code></a></dd>\n" +
"</dl>"}, "</dl>"},
{ "serialized-form.html", "<dl>\n" + { "serialized-form.html",
"<dl>\n" +
"<dt><span class=\"throwsLabel\">Throws:</span>" + "<dt><span class=\"throwsLabel\">Throws:</span>" +
"</dt>\n" + "</dt>\n" +
"<dd><code>" + "<dd><code>" +
@ -296,55 +309,76 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
// Test for valid HTML generation which should not comprise of empty // Test for valid HTML generation which should not comprise of empty
// definition list tags. // definition list tags.
private static final String[][] NEGATED_TEST = { private static final String[][] NEGATED_TEST_NO_C5 = {
{ "pkg1/package-summary.html", "<dl></dl>"}, { "pkg1/package-summary.html",
{ "pkg1/package-summary.html", "<dl>\n" + "<dl></dl>"},
{ "pkg1/package-summary.html",
"<dl>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C1.html", "<dl></dl>"}, { "pkg1/C1.html",
{ "pkg1/C1.html", "<dl>\n" + "<dl></dl>"},
{ "pkg1/C1.html",
"<dl>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C1.ModalExclusionType.html", "<dl></dl>"}, { "pkg1/C1.ModalExclusionType.html",
{ "pkg1/C1.ModalExclusionType.html", "<dl>\n" + "<dl></dl>"},
{ "pkg1/C1.ModalExclusionType.html",
"<dl>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C2.html", "<dl></dl>"}, { "pkg1/C2.html",
{ "pkg1/C2.html", "<dl>\n" + "<dl></dl>"},
{ "pkg1/C2.html",
"<dl>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C2.ModalType.html", "<dl></dl>"}, { "pkg1/C2.ModalType.html",
{ "pkg1/C2.ModalType.html", "<dl>\n" + "<dl></dl>"},
{ "pkg1/C2.ModalType.html",
"<dl>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C3.html", "<dl></dl>"}, { "pkg1/C3.html",
{ "pkg1/C3.html", "<dl>\n" + "<dl></dl>"},
{ "pkg1/C3.html",
"<dl>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C4.html", "<dl></dl>"}, { "pkg1/C4.html",
{ "pkg1/C4.html", "<dl>\n" + "<dl></dl>"},
{ "pkg1/C4.html",
"<dl>\n" +
"</dl>"}, "</dl>"},
{ "pkg1/C5.html", "<dl></dl>"}, { "overview-tree.html",
{ "pkg1/C5.html", "<dl>\n" + "<dl></dl>"},
{ "overview-tree.html",
"<dl>\n" +
"</dl>"}, "</dl>"},
{ "overview-tree.html", "<dl></dl>"}, { "serialized-form.html",
{ "overview-tree.html", "<dl>\n" + "<dl></dl>"},
"</dl>"}, { "serialized-form.html",
{ "serialized-form.html", "<dl></dl>"}, "<dl>\n" +
{ "serialized-form.html", "<dl>\n" + "</dl>"}};
private static final String[][] NEGATED_TEST_C5 = {
{ "pkg1/C5.html",
"<dl></dl>"},
{ "pkg1/C5.html",
"<dl>\n" +
"</dl>"}}; "</dl>"}};
private static final String[] ARGS1 = private static final String[] ARGS1 =
new String[] { new String[] {
"-Xdoclint:none", "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"}; "-Xdoclint:none", "-d", OUTPUT_DIR + "-1", "-sourcepath", SRC_DIR, "pkg1"};
private static final String[] ARGS2 = private static final String[] ARGS2 =
new String[] { new String[] {
"-Xdoclint:none", "-d", OUTPUT_DIR, "-nocomment", "-sourcepath", "-Xdoclint:none", "-d", OUTPUT_DIR + "-2", "-nocomment", "-sourcepath",
SRC_DIR, "pkg1"}; SRC_DIR, "pkg1"};
private static final String[] ARGS3 = private static final String[] ARGS3 =
new String[] { new String[] {
"-Xdoclint:none", "-d", OUTPUT_DIR, "-nodeprecated", "-sourcepath", "-Xdoclint:none", "-d", OUTPUT_DIR + "-3", "-nodeprecated", "-sourcepath",
SRC_DIR, "pkg1"}; SRC_DIR, "pkg1"};
private static final String[] ARGS4 = private static final String[] ARGS4 =
new String[] { new String[] {
"-Xdoclint:none", "-d", OUTPUT_DIR, "-nocomment", "-nodeprecated", "-Xdoclint:none", "-d", OUTPUT_DIR + "-4", "-nocomment", "-nodeprecated",
"-sourcepath", SRC_DIR, "pkg1"}; "-sourcepath", SRC_DIR, "pkg1"};
/** /**
@ -353,14 +387,20 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
*/ */
public static void main(String[] args) { public static void main(String[] args) {
TestHtmlDefinitionListTag tester = new TestHtmlDefinitionListTag(); TestHtmlDefinitionListTag tester = new TestHtmlDefinitionListTag();
tester.run(ARGS1, TEST_ALL, NEGATED_TEST); tester.run(ARGS1, TEST_ALL, NEGATED_TEST_NO_C5);
tester.run(ARGS1, TEST_CMNT_DEPR, NEGATED_TEST); tester.runTestsOnHTML(NO_TEST, NEGATED_TEST_C5);
tester.run(ARGS2, TEST_ALL, NEGATED_TEST); tester.runTestsOnHTML(TEST_CMNT_DEPR, NO_TEST);
tester.run(ARGS2, NO_TEST, TEST_CMNT_DEPR);
tester.run(ARGS3, TEST_ALL, NEGATED_TEST); tester.run(ARGS2, TEST_ALL, NEGATED_TEST_NO_C5);
tester.run(ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR); tester.runTestsOnHTML(NO_TEST, NEGATED_TEST_C5);
tester.run(ARGS4, TEST_ALL, NEGATED_TEST); tester.runTestsOnHTML(NO_TEST, TEST_CMNT_DEPR);
tester.run(ARGS4, TEST_NOCMNT_NODEPR, TEST_CMNT_DEPR);
tester.run(ARGS3, TEST_ALL, NEGATED_TEST_NO_C5);
tester.runTestsOnHTML(TEST_NODEPR, TEST_NOCMNT_NODEPR);
tester.run(ARGS4, TEST_ALL, NEGATED_TEST_NO_C5);
tester.runTestsOnHTML(TEST_NOCMNT_NODEPR, TEST_CMNT_DEPR);
tester.printSummary(); tester.printSummary();
} }
} }

View file

@ -47,16 +47,14 @@ public class TestHtmlStrongTag extends JavadocTester {
private static final String[][] TEST2 = { private static final String[][] TEST2 = {
{ "pkg2/C2.html", "<B>Comments:</B>"}}; { "pkg2/C2.html", "<B>Comments:</B>"}};
private static final String[][] NEGATED_TEST2 = { private static final String[][] NEGATED_TEST2 = {
{ "pkg2/C2.html", "<STRONG>Method Summary</STRONG>"}, { "pkg2/C2.html", "<STRONG>Method Summary</STRONG>"}};
{ "pkg1/package-summary.html",
"<STRONG>Class Summary</STRONG>"}};
private static final String[] ARGS1 = private static final String[] ARGS1 =
new String[] { new String[] {
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"}; "-d", OUTPUT_DIR + "-1", "-sourcepath", SRC_DIR, "pkg1"};
private static final String[] ARGS2 = private static final String[] ARGS2 =
new String[] { new String[] {
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg2"}; "-d", OUTPUT_DIR + "-2", "-sourcepath", SRC_DIR, "pkg2"};
/** /**
* The entry point of the test. * The entry point of the test.

View file

@ -58,13 +58,13 @@ public class TestHtmlTag extends JavadocTester {
private static final String[] ARGS1 = private static final String[] ARGS1 =
new String[] { new String[] {
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"}; "-d", OUTPUT_DIR + "-1", "-sourcepath", SRC_DIR, "pkg1"};
private static final String[] ARGS2 = private static final String[] ARGS2 =
new String[] { new String[] {
"-locale", "ja", "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg2"}; "-locale", "ja", "-d", OUTPUT_DIR + "-2", "-sourcepath", SRC_DIR, "pkg2"};
private static final String[] ARGS3 = private static final String[] ARGS3 =
new String[] { new String[] {
"-locale", "en_US", "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"}; "-locale", "en_US", "-d", OUTPUT_DIR + "-3", "-sourcepath", SRC_DIR, "pkg1"};
/** /**
* The entry point of the test. * The entry point of the test.

View file

@ -79,8 +79,8 @@ public class TestLinkOption extends JavadocTester {
private static final String[][] TEST2 = { private static final String[][] TEST2 = {
{ "pkg2/C2.html", { "pkg2/C2.html",
"This is a link to <a href=\"../../" + OUTPUT_DIR + "This is a link to <a href=\"../../" +
"-1/pkg/C.html?is-external=true\" " + OUTPUT_DIR + "-1/pkg/C.html?is-external=true\" " +
"title=\"class or interface in pkg\"><code>Class C</code></a>." "title=\"class or interface in pkg\"><code>Class C</code></a>."
} }
}; };
@ -119,7 +119,6 @@ public class TestLinkOption extends JavadocTester {
public static void main(String[] args) { public static void main(String[] args) {
TestLinkOption tester = new TestLinkOption(); TestLinkOption tester = new TestLinkOption();
tester.run(ARGS1, TEST1, NEGATED_TEST1); tester.run(ARGS1, TEST1, NEGATED_TEST1);
tester.run(ARGS1, TEST1, NEGATED_TEST1);
tester.run(ARGS2, TEST2, NO_TEST); tester.run(ARGS2, TEST2, NO_TEST);
tester.runJavadoc(createArguments(true)); // with trailing slash tester.runJavadoc(createArguments(true)); // with trailing slash
tester.runJavadoc(createArguments(false)); // without trailing slash tester.runJavadoc(createArguments(false)); // without trailing slash

View file

@ -67,7 +67,9 @@ public class TestNotifications extends JavadocTester {
tester.run(ARGS, TEST, NO_TEST); tester.run(ARGS, TEST, NO_TEST);
// No need to notify that the destination must be created because // No need to notify that the destination must be created because
// it already exists. // it already exists.
tester.setCheckOutputDirectoryCheck(DirectoryCheck.NONE);
tester.run(ARGS, NO_TEST, NEGATED_TEST); tester.run(ARGS, NO_TEST, NEGATED_TEST);
tester.setCheckOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES);
//Make sure classname is not include in javadoc usage message. //Make sure classname is not include in javadoc usage message.
tester.run(ARGS2, NO_TEST, NEGATED_TEST2); tester.run(ARGS2, NO_TEST, NEGATED_TEST2);
tester.printSummary(); tester.printSummary();

View file

@ -115,19 +115,19 @@ public class TestSerializedFormDeprecationInfo extends JavadocTester {
private static final String[] ARGS1 = private static final String[] ARGS1 =
new String[] { new String[] {
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1"}; "-d", OUTPUT_DIR + "-1", "-sourcepath", SRC_DIR, "pkg1"};
private static final String[] ARGS2 = private static final String[] ARGS2 =
new String[] { new String[] {
"-d", OUTPUT_DIR, "-nocomment", "-sourcepath", SRC_DIR, "pkg1"}; "-d", OUTPUT_DIR + "-2", "-nocomment", "-sourcepath", SRC_DIR, "pkg1"};
private static final String[] ARGS3 = private static final String[] ARGS3 =
new String[] { new String[] {
"-d", OUTPUT_DIR, "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"}; "-d", OUTPUT_DIR + "-3", "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"};
private static final String[] ARGS4 = private static final String[] ARGS4 =
new String[] { new String[] {
"-d", OUTPUT_DIR, "-nocomment", "-nodeprecated", "-sourcepath", "-d", OUTPUT_DIR + "-4", "-nocomment", "-nodeprecated", "-sourcepath",
SRC_DIR, "pkg1"}; SRC_DIR, "pkg1"};
/** /**

View file

@ -35,11 +35,11 @@ public class TestSinceTag extends JavadocTester {
//Javadoc arguments. //Javadoc arguments.
private static final String[] ARGS1 = new String[] { private static final String[] ARGS1 = new String[] {
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1" "-d", OUTPUT_DIR + "-1", "-sourcepath", SRC_DIR, "pkg1"
}; };
private static final String[] ARGS2 = new String[] { private static final String[] ARGS2 = new String[] {
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-nosince", "pkg1" "-d", OUTPUT_DIR + "-2", "-sourcepath", SRC_DIR, "-nosince", "pkg1"
}; };
//Input for string search tests. //Input for string search tests.

View file

@ -39,11 +39,11 @@ public class TestTypeParameters extends JavadocTester {
//Javadoc arguments. //Javadoc arguments.
private static final String[] ARGS1 = new String[]{ private static final String[] ARGS1 = new String[]{
"-d", OUTPUT_DIR, "-use", "-sourcepath", SRC_DIR, "-d", OUTPUT_DIR + "-1", "-use", "-sourcepath", SRC_DIR,
"pkg" "pkg"
}; };
private static final String[] ARGS2 = new String[]{ private static final String[] ARGS2 = new String[]{
"-d", OUTPUT_DIR, "-linksource", "-sourcepath", SRC_DIR, "-d", OUTPUT_DIR + "-2", "-linksource", "-sourcepath", SRC_DIR,
"pkg" "pkg"
}; };

View file

@ -40,11 +40,11 @@ public class TestWarnings extends JavadocTester {
//Javadoc arguments. //Javadoc arguments.
private static final String[] ARGS = new String[] { private static final String[] ARGS = new String[] {
"-Xdoclint:none", "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg" "-Xdoclint:none", "-d", OUTPUT_DIR + "-1", "-sourcepath", SRC_DIR, "pkg"
}; };
private static final String[] ARGS2 = new String[] { private static final String[] ARGS2 = new String[] {
"-Xdoclint:none", "-d", OUTPUT_DIR, "-private", "-sourcepath", SRC_DIR, "-Xdoclint:none", "-d", OUTPUT_DIR + "-2", "-private", "-sourcepath", SRC_DIR,
"pkg" "pkg"
}; };
@ -78,7 +78,6 @@ public class TestWarnings extends JavadocTester {
public static void main(String[] args) { public static void main(String[] args) {
TestWarnings tester = new TestWarnings(); TestWarnings tester = new TestWarnings();
tester.run(ARGS, TEST, NEGATED_TEST); tester.run(ARGS, TEST, NEGATED_TEST);
tester.run(ARGS, TEST, NEGATED_TEST);
tester.run(ARGS2, TEST2, NO_TEST); tester.run(ARGS2, TEST2, NO_TEST);
tester.printSummary(); tester.printSummary();
} }