author | martin |
Fri, 11 Jun 2010 18:55:45 -0700 | |
changeset 5786 | f60ef38202e7 |
parent 5520 | 86e4b9a9da40 |
child 7614 | cfadc977ca75 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
5520 | 2 |
* Copyright (c) 2001, 2003, 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 |
import java.lang.*; |
|
25 |
import java.io.*; |
|
26 |
||
27 |
/* |
|
28 |
* @test |
|
29 |
* @bug 4341304 4485668 4966728 |
|
30 |
* @summary Test that methods readResolve and writeReplace show |
|
31 |
* up in serialized-form.html the same way that readObject and writeObject do. |
|
32 |
* If the doclet includes readResolve and writeReplace in the serialized-form |
|
33 |
* documentation that same way the it includes readObject and writeObject, the |
|
34 |
* test passes. This also tests that throws tag information is correctly shown |
|
35 |
* in the serialized form page. |
|
36 |
* Make sure see tags work in serialized form. |
|
37 |
* @author jamieh |
|
38 |
* @library ../lib/ |
|
39 |
* @build JavadocTester |
|
40 |
* @build TestSerializedForm |
|
41 |
* @run main TestSerializedForm |
|
42 |
*/ |
|
43 |
||
44 |
public class TestSerializedForm extends JavadocTester implements Serializable { |
|
45 |
||
46 |
private static final String BUG_ID = "4341304-4485668-4966728"; |
|
47 |
||
48 |
private static final String[][] TEST = { |
|
49 |
{BUG_ID + FS + "serialized-form.html", |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
50 |
"protected java.lang.Object <STRONG>readResolve</STRONG>()"}, |
10 | 51 |
{BUG_ID + FS + "serialized-form.html", |
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
52 |
"protected java.lang.Object <STRONG>writeReplace</STRONG>()"}, |
10 | 53 |
{BUG_ID + FS + "serialized-form.html", |
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
54 |
"protected java.lang.Object <STRONG>readObjectNoData</STRONG>()"}, |
10 | 55 |
{BUG_ID + FS + "serialized-form.html", |
56 |
"See Also"}, |
|
57 |
}; |
|
58 |
||
59 |
private static final String[][] NEGATED_TEST = NO_TEST; |
|
60 |
private static final String[] ARGS = new String[] { |
|
61 |
"-d", BUG_ID, "-sourcepath", SRC_DIR, |
|
62 |
SRC_DIR + FS + "TestSerializedForm.java" |
|
63 |
}; |
|
64 |
||
65 |
/** |
|
66 |
* @serial |
|
67 |
* @see TestSerializedForm |
|
68 |
*/ |
|
69 |
public final int SERIALIZABLE_CONSTANT = 1; |
|
70 |
||
71 |
/** |
|
72 |
* The entry point of the test. |
|
73 |
* @param args the array of command line arguments. |
|
74 |
*/ |
|
75 |
public static void main(String[] args) { |
|
76 |
TestSerializedForm tester = new TestSerializedForm(); |
|
77 |
int actualExitCode = run(tester, ARGS, TEST, NEGATED_TEST); |
|
78 |
tester.printSummary(); |
|
79 |
} |
|
80 |
||
81 |
/** |
|
82 |
* {@inheritDoc} |
|
83 |
*/ |
|
84 |
public String getBugId() { |
|
85 |
return BUG_ID; |
|
86 |
} |
|
87 |
||
88 |
/** |
|
89 |
* {@inheritDoc} |
|
90 |
*/ |
|
91 |
public String getBugName() { |
|
92 |
return getClass().getName(); |
|
93 |
} |
|
94 |
||
95 |
/** |
|
96 |
* @throws IOException when there is an I/O error. |
|
97 |
* @serial |
|
98 |
*/ |
|
99 |
private void readObject(ObjectInputStream s) {} |
|
100 |
||
101 |
/** |
|
102 |
* @throws IOException when there is an I/O error. |
|
103 |
* @serial |
|
104 |
*/ |
|
105 |
private void writeObject(ObjectOutputStream s) {} |
|
106 |
||
107 |
/** |
|
108 |
* @throws IOException when there is an I/O error. |
|
109 |
* @serialData This is a serial data comment. |
|
110 |
*/ |
|
111 |
protected Object readResolve(){return null;} |
|
112 |
||
113 |
/** |
|
114 |
* @throws IOException when there is an I/O error. |
|
115 |
* @serialData This is a serial data comment. |
|
116 |
*/ |
|
117 |
protected Object writeReplace(){return null;} |
|
118 |
||
119 |
/** |
|
120 |
* @throws IOException when there is an I/O error. |
|
121 |
* @serialData This is a serial data comment. |
|
122 |
*/ |
|
123 |
protected Object readObjectNoData() { |
|
124 |
return null; |
|
125 |
} |
|
126 |
||
127 |
} |