author | ksrini |
Tue, 21 Nov 2017 13:17:06 -0800 | |
changeset 47877 | 7e57d42b5eeb |
parent 47216 | 71c04702a3d5 |
child 53097 | 2e82ca64b25d |
permissions | -rw-r--r-- |
10 | 1 |
/* |
36526 | 2 |
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. |
10 | 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 |
* |
|
5520 | 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. |
|
10 | 22 |
*/ |
23 |
||
24 |
/* |
|
25 |
* @test |
|
47877
7e57d42b5eeb
8180019: javadoc should treat failure to access URL as an error, not a warning.
ksrini
parents:
47216
diff
changeset
|
26 |
* @bug 4625883 8180019 |
7e57d42b5eeb
8180019: javadoc should treat failure to access URL as an error, not a warning.
ksrini
parents:
47216
diff
changeset
|
27 |
* @summary Make sure that bad -link arguments trigger errors. |
10 | 28 |
* @author jamieh |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
29 |
* @library ../lib |
36526 | 30 |
* @modules jdk.javadoc/jdk.javadoc.internal.tool |
10 | 31 |
* @build JavadocTester |
32 |
* @run main TestBadLinkOption |
|
33 |
*/ |
|
34 |
||
35 |
public class TestBadLinkOption extends JavadocTester { |
|
36 |
||
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
37 |
public static void main(String... args) throws Exception { |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
38 |
TestBadLinkOption tester = new TestBadLinkOption(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
39 |
tester.runTests(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
40 |
} |
10 | 41 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
42 |
@Test |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
43 |
void test() { |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
44 |
String out = "out"; |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
45 |
javadoc("-d", out, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
46 |
"-sourcepath", testSrc, |
47877
7e57d42b5eeb
8180019: javadoc should treat failure to access URL as an error, not a warning.
ksrini
parents:
47216
diff
changeset
|
47 |
"-link", "a-non-existent-link", |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
48 |
"pkg"); |
47877
7e57d42b5eeb
8180019: javadoc should treat failure to access URL as an error, not a warning.
ksrini
parents:
47216
diff
changeset
|
49 |
checkExit(Exit.ERROR); |
10 | 50 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
30730
diff
changeset
|
51 |
checkOutput(Output.OUT, true, |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
52 |
"Error reading file:"); |
10 | 53 |
} |
54 |
} |