author | ksrini |
Wed, 10 Aug 2016 16:19:09 -0700 | |
changeset 40310 | a979695d72a1 |
parent 35426 | 374342e56a56 |
child 40508 | 74ef30d16fb9 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
40310
a979695d72a1
8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents:
35426
diff
changeset
|
2 |
* Copyright (c) 2002, 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 |
package p; |
|
25 |
||
40310
a979695d72a1
8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents:
35426
diff
changeset
|
26 |
import java.util.Arrays; |
35426 | 27 |
import java.util.Collections; |
40310
a979695d72a1
8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents:
35426
diff
changeset
|
28 |
import java.util.Locale; |
35426 | 29 |
import java.util.Set; |
30 |
||
31 |
import javax.lang.model.SourceVersion; |
|
32 |
||
33 |
import jdk.javadoc.doclet.Doclet; |
|
34 |
import jdk.javadoc.doclet.DocletEnvironment; |
|
40310
a979695d72a1
8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents:
35426
diff
changeset
|
35 |
import jdk.javadoc.doclet.Reporter; |
35426 | 36 |
|
10 | 37 |
/** Test that when running javadoc on a package, we only get |
38 |
* documentation for those classes for which source was provided. |
|
39 |
*/ |
|
35426 | 40 |
public class SourceOnly implements Doclet { |
40310
a979695d72a1
8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents:
35426
diff
changeset
|
41 |
NonSource dependency; // force a compilation error if not on classpath. |
a979695d72a1
8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents:
35426
diff
changeset
|
42 |
@Override |
a979695d72a1
8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents:
35426
diff
changeset
|
43 |
public boolean run(DocletEnvironment root) { |
35426 | 44 |
if (root.getIncludedClasses().size() != 1) |
40310
a979695d72a1
8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents:
35426
diff
changeset
|
45 |
throw new Error("wrong set of classes documented: " + |
a979695d72a1
8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents:
35426
diff
changeset
|
46 |
Arrays.asList(root.getIncludedClasses())); |
10 | 47 |
return true; |
48 |
} |
|
35426 | 49 |
|
50 |
@Override |
|
51 |
public String getName() { |
|
52 |
return "Test"; |
|
53 |
} |
|
54 |
||
55 |
@Override |
|
56 |
public Set<Option> getSupportedOptions() { |
|
57 |
return Collections.emptySet(); |
|
58 |
} |
|
59 |
||
60 |
@Override |
|
61 |
public SourceVersion getSupportedSourceVersion() { |
|
62 |
return SourceVersion.latest(); |
|
63 |
} |
|
40310
a979695d72a1
8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents:
35426
diff
changeset
|
64 |
|
a979695d72a1
8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents:
35426
diff
changeset
|
65 |
@Override |
a979695d72a1
8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents:
35426
diff
changeset
|
66 |
public void init(Locale locale, Reporter reporter) { |
a979695d72a1
8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents:
35426
diff
changeset
|
67 |
// do nothing |
a979695d72a1
8152054: fix @ignored langtools/test/jdk/javadoc/tool/ tests
ksrini
parents:
35426
diff
changeset
|
68 |
} |
10 | 69 |
} |