author | hannesw |
Tue, 22 Mar 2016 14:23:16 +0100 | |
changeset 36690 | 06b714373aa4 |
parent 30730 | d3ce7619db2c |
permissions | -rw-r--r-- |
10 | 1 |
/* |
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
24399
diff
changeset
|
2 |
* Copyright (c) 2003, 2015, 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 |
|
26 |
* @bug 4657239 4775743 |
|
27 |
* @summary Make sure a notification is printed when an output directory must |
|
28 |
* be created. |
|
29 |
* Make sure classname is not include in javadoc usage message. |
|
30 |
* @author jamieh |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
31 |
* @library ../lib |
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
24399
diff
changeset
|
32 |
* @modules jdk.javadoc |
10 | 33 |
* @build JavadocTester |
34 |
* @run main TestNotifications |
|
35 |
*/ |
|
36 |
||
37 |
public class TestNotifications extends JavadocTester { |
|
38 |
||
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
39 |
public static void main(String... args) throws Exception { |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
40 |
TestNotifications tester = new TestNotifications(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
41 |
tester.runTests(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
42 |
} |
10 | 43 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
44 |
@Test |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
45 |
void test1() { |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
46 |
String outDir = "out"; |
10 | 47 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
48 |
// Notify that the destination directory must be created. |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
49 |
javadoc("-d", outDir, "-sourcepath", testSrc, "pkg"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
50 |
checkExit(Exit.OK); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
51 |
checkOutput(Output.NOTICE, true, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
52 |
"Creating destination directory: \"" + outDir); |
10 | 53 |
|
54 |
// No need to notify that the destination must be created because |
|
55 |
// it already exists. |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
56 |
setOutputDirectoryCheck(DirectoryCheck.NONE); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
57 |
javadoc("-d", outDir, "-sourcepath", testSrc, "pkg"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
58 |
checkExit(Exit.OK); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
59 |
checkOutput(Output.NOTICE, false, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
60 |
"Creating destination directory: \"" + outDir); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
61 |
} |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
62 |
|
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
63 |
@Test |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
64 |
void test() { |
10 | 65 |
//Make sure classname is not include in javadoc usage message. |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
66 |
setOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
67 |
javadoc("-help"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
68 |
checkOutput(Output.NOTICE, false, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24217
diff
changeset
|
69 |
"[classnames]"); |
10 | 70 |
} |
71 |
} |