33919
|
1 |
/*
|
38838
|
2 |
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
33919
|
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 8130880
|
38838
|
27 |
* @library /jdk/javadoc/tool/sampleapi/lib
|
35359
|
28 |
* @modules jdk.compiler/com.sun.tools.javac.api
|
|
29 |
* jdk.compiler/com.sun.tools.javac.code
|
|
30 |
* jdk.compiler/com.sun.tools.javac.parser
|
|
31 |
* jdk.compiler/com.sun.tools.javac.tree
|
|
32 |
* jdk.compiler/com.sun.tools.javac.util
|
44015
|
33 |
* jdk.javadoc/jdk.javadoc.internal.tool
|
|
34 |
* @build sampleapi.SampleApiDefaultRunner
|
33919
|
35 |
* @run main SampleApiTest
|
|
36 |
*/
|
|
37 |
|
|
38 |
import com.sun.tools.javadoc.*;
|
38838
|
39 |
import sampleapi.*;
|
33919
|
40 |
|
|
41 |
public class SampleApiTest {
|
|
42 |
|
38838
|
43 |
public static void main(String... args) throws Exception {
|
|
44 |
|
|
45 |
// generate
|
|
46 |
SampleApiDefaultRunner.execute(
|
|
47 |
new String[] {
|
|
48 |
"-o=out/src",
|
|
49 |
"-r=" + System.getProperty("test.src") + "/res"
|
|
50 |
});
|
33919
|
51 |
|
|
52 |
// html4
|
38838
|
53 |
int res1 = Main.execute(
|
33919
|
54 |
new String[] {
|
|
55 |
"-d", "out/doc.html4",
|
|
56 |
"-verbose",
|
|
57 |
"-private",
|
|
58 |
"-use",
|
|
59 |
"-splitindex",
|
|
60 |
"-linksource",
|
|
61 |
"-html4",
|
|
62 |
"-javafx",
|
|
63 |
"-windowtitle", "SampleAPI",
|
|
64 |
"-sourcepath", "out/src",
|
|
65 |
"sampleapi.simple",
|
38838
|
66 |
"sampleapi.simple.sub",
|
33919
|
67 |
"sampleapi.tiny",
|
|
68 |
"sampleapi.fx"
|
|
69 |
});
|
|
70 |
|
|
71 |
// html5
|
38838
|
72 |
int res2 = Main.execute(
|
33919
|
73 |
new String[] {
|
|
74 |
"-d", "out/doc.html5",
|
|
75 |
"-verbose",
|
|
76 |
"-private",
|
|
77 |
"-use",
|
|
78 |
"-splitindex",
|
|
79 |
"-linksource",
|
|
80 |
"-html5",
|
|
81 |
"-javafx",
|
|
82 |
"-windowtitle", "SampleAPI",
|
|
83 |
"-sourcepath", "out/src",
|
|
84 |
"sampleapi.simple",
|
38838
|
85 |
"sampleapi.simple.sub",
|
33919
|
86 |
"sampleapi.tiny",
|
|
87 |
"sampleapi.fx"
|
|
88 |
});
|
38838
|
89 |
|
|
90 |
if (res1 + res2 > 0)
|
|
91 |
throw new Exception("One of exit statuses of test execution is non-zero: "
|
|
92 |
+ res1 + " for HTML4, " + res2 + " for HTML5.");
|
33919
|
93 |
}
|
|
94 |
}
|