Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/langtools/jdk/javadoc/doclet/testDocFileDir/TestDocFileDir.java
40971 views
1
/*
2
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
/*
25
* @test
26
* @bug 4258405 4973606 8024096
27
* @summary This test verifies that the doc-file directory does not
28
* get overwritten when the sourcepath is equal to the destination
29
* directory.
30
* Also test that -docfilessubdirs and -excludedocfilessubdir both work.
31
* @library ../../lib
32
* @modules jdk.javadoc/jdk.javadoc.internal.tool
33
* @build javadoc.tester.*
34
* @run main TestDocFileDir
35
*/
36
37
import javadoc.tester.JavadocTester;
38
39
public class TestDocFileDir extends JavadocTester {
40
41
public static void main(String... args) throws Exception {
42
TestDocFileDir tester = new TestDocFileDir();
43
tester.runTests();
44
}
45
46
// Output dir = "", Input dir = ""
47
@Test
48
public void test1() {
49
copyDir(testSrc("pkg"), ".");
50
setOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES);
51
javadoc("pkg/C.java");
52
checkExit(Exit.OK);
53
checkOutput("pkg/doc-files/testfile.txt", true,
54
"This doc file did not get trashed.");
55
}
56
57
// Output dir = Input Dir
58
@Test
59
public void test2() {
60
String outdir = "out2";
61
copyDir(testSrc("pkg"), outdir);
62
setOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES);
63
javadoc("-d", outdir,
64
"-sourcepath", "blah" + PS + outdir + PS + "blah",
65
"pkg");
66
checkExit(Exit.OK);
67
checkOutput("pkg/doc-files/testfile.txt", true,
68
"This doc file did not get trashed.");
69
}
70
71
// Exercising -docfilessubdirs and -excludedocfilessubdir
72
@Test
73
public void test3() {
74
String outdir = "out3";
75
setOutputDirectoryCheck(DirectoryCheck.NONE);
76
javadoc("-d", outdir,
77
"-sourcepath", testSrc,
78
"-docfilessubdirs",
79
"-excludedocfilessubdir", "subdir-excluded1:subdir-excluded2",
80
"pkg");
81
checkExit(Exit.OK);
82
checkFiles(true,
83
"pkg/doc-files/subdir-used1/testfile.txt",
84
"pkg/doc-files/subdir-used2/testfile.txt");
85
checkFiles(false,
86
"pkg/doc-files/subdir-excluded1/testfile.txt",
87
"pkg/doc-files/subdir-excluded2/testfile.txt");
88
}
89
}
90
91