author | akulyakh |
Thu, 21 May 2015 11:41:04 -0700 | |
changeset 30730 | d3ce7619db2c |
parent 24399 | af1a0220d0fa |
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) 2001, 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 |
|
23805
3ef77c1ebf0b
8032066: Serialized form has broken links to non private inner classes of package private
bpatel
parents:
7681
diff
changeset
|
26 |
* @bug 4341304 4485668 4966728 8032066 |
10 | 27 |
* @summary Test that methods readResolve and writeReplace show |
28 |
* up in serialized-form.html the same way that readObject and writeObject do. |
|
29 |
* If the doclet includes readResolve and writeReplace in the serialized-form |
|
30 |
* documentation that same way the it includes readObject and writeObject, the |
|
31 |
* test passes. This also tests that throws tag information is correctly shown |
|
32 |
* in the serialized form page. |
|
33 |
* Make sure see tags work in serialized form. |
|
34 |
* @author jamieh |
|
35 |
* @library ../lib/ |
|
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
24399
diff
changeset
|
36 |
* @modules jdk.javadoc |
10 | 37 |
* @build JavadocTester |
38 |
* @build TestSerializedForm |
|
39 |
* @run main TestSerializedForm |
|
40 |
*/ |
|
41 |
||
24072 | 42 |
import java.io.*; |
10 | 43 |
|
24072 | 44 |
public class TestSerializedForm extends JavadocTester implements Serializable { |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
45 |
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
|
46 |
TestSerializedForm tester = new TestSerializedForm(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
47 |
tester.runTests(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
48 |
// tester.run(ARGS, TEST, NEGATED_TEST); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
49 |
// tester.run(ARGS_PRIVATE, TEST_PRIVATE, NEGATED_TEST_PRIVATE); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
50 |
// tester.printSummary(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
51 |
} |
10 | 52 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
53 |
@Test |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
54 |
void testDefault() { |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
55 |
javadoc("-d", "out-default", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
56 |
"-sourcepath", testSrc, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
57 |
testSrc("TestSerializedForm.java"), "pkg1"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
58 |
checkExit(Exit.OK); |
23805
3ef77c1ebf0b
8032066: Serialized form has broken links to non private inner classes of package private
bpatel
parents:
7681
diff
changeset
|
59 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
60 |
checkOutput("serialized-form.html", true, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
61 |
"protected java.lang.Object readResolve()", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
62 |
"protected java.lang.Object writeReplace()", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
63 |
"protected java.lang.Object readObjectNoData()", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
64 |
"See Also", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
65 |
"<h3>Class pkg1.NestedInnerClass.InnerClass.ProNestedInnerClass " |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
66 |
+ "extends java.lang.Object implements Serializable</h3>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
67 |
"<h3>Class pkg1.PrivateIncludeInnerClass.PriInnerClass extends " |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
68 |
+ "java.lang.Object implements Serializable</h3>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
69 |
"<h3>Class pkg1.ProtectedInnerClass.ProInnerClass extends " |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
70 |
+ "java.lang.Object implements Serializable</h3>"); |
10 | 71 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
72 |
checkOutput("serialized-form.html", false, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
73 |
"<h3>Class <a href=\"pkg1/NestedInnerClass.InnerClass.ProNestedInnerClass.html\" " |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
74 |
+ "title=\"class in pkg1\">pkg1.NestedInnerClass.InnerClass.ProNestedInnerClass</a> " |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
75 |
+ "extends java.lang.Object implements Serializable</h3>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
76 |
"<h3>Class <a href=\"pkg1/PrivateInnerClass.PriInnerClass.html\" title=\"class in pkg1\">" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
77 |
+ "pkg1.PrivateInnerClass.PriInnerClass</a> extends java.lang.Object implements Serializable</h3>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
78 |
"<h3>Class <a href=\"pkg1/ProtectedInnerClass.ProInnerClass.html\" title=\"class in pkg1\">" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
79 |
+ "pkg1.ProtectedInnerClass.ProInnerClass</a> extends java.lang.Object implements Serializable</h3>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
80 |
"<h3>Class pkg1.PublicExcludeInnerClass.PubInnerClass extends java.lang.Object implements " |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
81 |
+ "Serializable</h3>"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
82 |
} |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
83 |
|
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
84 |
@Test |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
85 |
void testPrivate() { |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
86 |
javadoc("-private", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
87 |
"-d", "out-private", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
88 |
"-sourcepath", testSrc, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
89 |
testSrc("TestSerializedForm.java"), "pkg1"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
90 |
checkExit(Exit.OK); |
23805
3ef77c1ebf0b
8032066: Serialized form has broken links to non private inner classes of package private
bpatel
parents:
7681
diff
changeset
|
91 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
92 |
checkOutput("serialized-form.html", true, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
93 |
"<h3>Class <a href=\"pkg1/NestedInnerClass.InnerClass.ProNestedInnerClass.html\" " |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
94 |
+ "title=\"class in pkg1\">pkg1.NestedInnerClass.InnerClass.ProNestedInnerClass</a> " |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
95 |
+ "extends java.lang.Object implements Serializable</h3>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
96 |
"<h3>Class <a href=\"pkg1/PrivateIncludeInnerClass.PriInnerClass.html\" title=\"class in pkg1\">" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
97 |
+ "pkg1.PrivateIncludeInnerClass.PriInnerClass</a> extends java.lang.Object implements Serializable</h3>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
98 |
"<h3>Class <a href=\"pkg1/ProtectedInnerClass.ProInnerClass.html\" title=\"class in pkg1\">" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
99 |
+ "pkg1.ProtectedInnerClass.ProInnerClass</a> extends java.lang.Object implements Serializable</h3>"); |
23805
3ef77c1ebf0b
8032066: Serialized form has broken links to non private inner classes of package private
bpatel
parents:
7681
diff
changeset
|
100 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
101 |
checkOutput("serialized-form.html", false, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
102 |
"<h3>Class pkg1.NestedInnerClass.InnerClass.ProNestedInnerClass " |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
103 |
+ "extends java.lang.Object implements Serializable</h3>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
104 |
"<h3>Class pkg1.PrivateInnerClass.PriInnerClass extends " |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
105 |
+ "java.lang.Object implements Serializable</h3>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
106 |
"<h3>Class pkg1.ProtectedInnerClass.ProInnerClass extends " |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
107 |
+ "java.lang.Object implements Serializable</h3>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
108 |
"<h3>Class <a href=\"pkg1/PublicExcludeInnerClass.PubInnerClass.html\" " |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
109 |
+ "title=\"class in pkg1\">pkg1.PublicExcludeInnerClass.PubInnerClass</a> " |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
110 |
+ "extends java.lang.Object implements Serializable</h3>"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
111 |
} |
10 | 112 |
|
113 |
/** |
|
114 |
* @serial |
|
115 |
* @see TestSerializedForm |
|
116 |
*/ |
|
117 |
public final int SERIALIZABLE_CONSTANT = 1; |
|
118 |
||
119 |
/** |
|
120 |
* The entry point of the test. |
|
121 |
* @param args the array of command line arguments. |
|
122 |
*/ |
|
123 |
||
124 |
/** |
|
23805
3ef77c1ebf0b
8032066: Serialized form has broken links to non private inner classes of package private
bpatel
parents:
7681
diff
changeset
|
125 |
* @param s ObjectInputStream. |
10 | 126 |
* @throws IOException when there is an I/O error. |
127 |
* @serial |
|
128 |
*/ |
|
23805
3ef77c1ebf0b
8032066: Serialized form has broken links to non private inner classes of package private
bpatel
parents:
7681
diff
changeset
|
129 |
private void readObject(ObjectInputStream s) throws IOException {} |
10 | 130 |
|
131 |
/** |
|
23805
3ef77c1ebf0b
8032066: Serialized form has broken links to non private inner classes of package private
bpatel
parents:
7681
diff
changeset
|
132 |
* @param s ObjectOutputStream. |
10 | 133 |
* @throws IOException when there is an I/O error. |
134 |
* @serial |
|
135 |
*/ |
|
23805
3ef77c1ebf0b
8032066: Serialized form has broken links to non private inner classes of package private
bpatel
parents:
7681
diff
changeset
|
136 |
private void writeObject(ObjectOutputStream s) throws IOException {} |
10 | 137 |
|
138 |
/** |
|
139 |
* @throws IOException when there is an I/O error. |
|
140 |
* @serialData This is a serial data comment. |
|
23805
3ef77c1ebf0b
8032066: Serialized form has broken links to non private inner classes of package private
bpatel
parents:
7681
diff
changeset
|
141 |
* @return an object. |
10 | 142 |
*/ |
23805
3ef77c1ebf0b
8032066: Serialized form has broken links to non private inner classes of package private
bpatel
parents:
7681
diff
changeset
|
143 |
protected Object readResolve() throws IOException {return null;} |
10 | 144 |
|
145 |
/** |
|
146 |
* @throws IOException when there is an I/O error. |
|
147 |
* @serialData This is a serial data comment. |
|
23805
3ef77c1ebf0b
8032066: Serialized form has broken links to non private inner classes of package private
bpatel
parents:
7681
diff
changeset
|
148 |
* @return an object. |
10 | 149 |
*/ |
23805
3ef77c1ebf0b
8032066: Serialized form has broken links to non private inner classes of package private
bpatel
parents:
7681
diff
changeset
|
150 |
protected Object writeReplace() throws IOException {return null;} |
10 | 151 |
|
152 |
/** |
|
153 |
* @throws IOException when there is an I/O error. |
|
154 |
* @serialData This is a serial data comment. |
|
23805
3ef77c1ebf0b
8032066: Serialized form has broken links to non private inner classes of package private
bpatel
parents:
7681
diff
changeset
|
155 |
* @return an object. |
10 | 156 |
*/ |
23805
3ef77c1ebf0b
8032066: Serialized form has broken links to non private inner classes of package private
bpatel
parents:
7681
diff
changeset
|
157 |
protected Object readObjectNoData() throws IOException { |
10 | 158 |
return null; |
159 |
} |
|
160 |
||
161 |
} |