author | jjg |
Tue, 22 Apr 2014 17:57:40 -0700 | |
changeset 24072 | e7549dcbc4af |
parent 24071 | b0845717434e |
child 24399 | af1a0220d0fa |
permissions | -rw-r--r-- |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
1 |
/* |
23971 | 2 |
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
4 |
* |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
8 |
* |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
13 |
* accompanied this code). |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
14 |
* |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
18 |
* |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
21 |
* questions. |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
22 |
*/ |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
23 |
|
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
24 |
/* |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
25 |
* @test |
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
19253
diff
changeset
|
26 |
* @bug 6492694 8026567 |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
27 |
* @summary Test package deprecation. |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
28 |
* @author bpatel |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
29 |
* @library ../lib/ |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
30 |
* @build JavadocTester TestPackageDeprecation |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
31 |
* @run main TestPackageDeprecation |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
32 |
*/ |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
33 |
|
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
34 |
public class TestPackageDeprecation extends JavadocTester { |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
35 |
|
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
36 |
//Javadoc arguments. |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
37 |
private static final String[] ARGS1 = new String[]{ |
24072 | 38 |
"-d", OUTPUT_DIR + "-1", "-sourcepath", SRC_DIR, "-use", "pkg", "pkg1", |
23971 | 39 |
SRC_DIR + "/C2.java", SRC_DIR + "/FooDepr.java" |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
40 |
}; |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
41 |
private static final String[] ARGS2 = new String[]{ |
24072 | 42 |
"-d", OUTPUT_DIR + "-2", "-sourcepath", SRC_DIR, "-use", "-nodeprecated", |
23971 | 43 |
"pkg", "pkg1", SRC_DIR + "/C2.java", SRC_DIR + "/FooDepr.java" |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
44 |
}; |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
45 |
|
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
46 |
//Input for string search tests. |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
47 |
private static final String[][] TEST1 = { |
24072 | 48 |
{ "pkg1/package-summary.html", |
23971 | 49 |
"<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n" + |
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
19253
diff
changeset
|
50 |
"<div class=\"block\"><span class=\"deprecationComment\">This package is Deprecated." + |
19253
b97b3e18547f
7198274: RFE : Javadoc Accessibility : Use CSS styles rather than <strong> or <i> tags
bpatel
parents:
9606
diff
changeset
|
51 |
"</span></div>" |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
52 |
}, |
24072 | 53 |
{ "deprecated-list.html", |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
54 |
"<li><a href=\"#package\">Deprecated Packages</a></li>" |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
55 |
} |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
56 |
}; |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
57 |
private static final String[][] NEGATED_TEST2 = { |
24072 | 58 |
{ "overview-summary.html", "pkg1"}, |
59 |
{ "allclasses-frame.html", "FooDepr"} |
|
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
60 |
}; |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
61 |
|
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
62 |
/** |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
63 |
* The entry point of the test. |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
64 |
* @param args the array of command line arguments. |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
65 |
*/ |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
66 |
public static void main(String[] args) { |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
67 |
TestPackageDeprecation tester = new TestPackageDeprecation(); |
24071 | 68 |
tester.run(ARGS1, TEST1, NO_TEST); |
69 |
tester.run(ARGS2, NO_TEST, NEGATED_TEST2); |
|
24072 | 70 |
if ((new java.io.File(OUTPUT_DIR + "-2/pkg1/" + |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
71 |
"package-summary.html")).exists()) { |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
72 |
throw new Error("Test Fails: packages summary should not be" + |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
73 |
"generated for deprecated package."); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
74 |
} else { |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
75 |
System.out.println("Test passes: package-summary.html not found."); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
76 |
} |
24072 | 77 |
if ((new java.io.File(OUTPUT_DIR + "-2/FooDepr.html")).exists()) { |
9606
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
78 |
throw new Error("Test Fails: FooDepr should not be" + |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
79 |
"generated as it is deprecated."); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
80 |
} else { |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
81 |
System.out.println("Test passes: FooDepr.html not found."); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
82 |
} |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
83 |
tester.printSummary(); |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
84 |
} |
e5a619cb5dd3
6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff
changeset
|
85 |
} |