equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
24 /* |
24 /* |
25 * @test |
25 * @test |
26 * @bug 4460354 |
26 * @bug 4460354 8014636 |
27 * @summary Test to make sure that relative paths are redirected in the |
27 * @summary Test to make sure that relative paths are redirected in the |
28 * output so that they are not broken. |
28 * output so that they are not broken. |
29 * NOTE: these tests have \\n instead of NL because they are user |
|
30 * generated new lines, not Java generated. |
|
31 * @author jamieh |
29 * @author jamieh |
32 * @library ../lib/ |
30 * @library ../lib/ |
33 * @build JavadocTester |
31 * @build JavadocTester |
34 * @build TestRelativeLinks |
32 * @build TestRelativeLinks |
35 * @run main TestRelativeLinks |
33 * @run main TestRelativeLinks |
36 */ |
34 */ |
37 |
35 |
38 public class TestRelativeLinks extends JavadocTester { |
36 public class TestRelativeLinks extends JavadocTester { |
39 |
37 |
40 //Test information. |
38 //Test information. |
41 private static final String BUG_ID = "4460354"; |
39 private static final String BUG_ID = "4460354-8014636"; |
42 |
40 |
43 //Javadoc arguments. |
41 //Javadoc arguments. |
44 private static final String[] ARGS = new String[] { |
42 private static final String[] ARGS = new String[] { |
45 "-d", BUG_ID, "-use", "-sourcepath", SRC_DIR, "pkg", "pkg2" |
43 "-d", BUG_ID, "-use", "-sourcepath", SRC_DIR, "pkg", "pkg2" |
46 }; |
44 }; |
56 {BUG_ID + FS + "pkg" + FS + "C.html", |
54 {BUG_ID + FS + "pkg" + FS + "C.html", |
57 "<a href=\"relative-method-link.html\">relative method link</a>"}, |
55 "<a href=\"relative-method-link.html\">relative method link</a>"}, |
58 {BUG_ID + FS + "pkg" + FS + "package-summary.html", |
56 {BUG_ID + FS + "pkg" + FS + "package-summary.html", |
59 "<a href=\"relative-package-link.html\">relative package link</a>"}, |
57 "<a href=\"relative-package-link.html\">relative package link</a>"}, |
60 {BUG_ID + FS + "pkg" + FS + "C.html", |
58 {BUG_ID + FS + "pkg" + FS + "C.html", |
61 " <a\n" + |
59 " <a" + NL + |
62 " href=\"relative-multi-line-link.html\">relative-multi-line-link</a>."}, |
60 " href=\"relative-multi-line-link.html\">relative-multi-line-link</a>."}, |
63 |
61 |
64 //These relative paths should be redirected because they are in different |
62 //These relative paths should be redirected because they are in different |
65 //places. |
63 //places. |
66 |
64 |
72 {BUG_ID + FS + "index-all.html", |
70 {BUG_ID + FS + "index-all.html", |
73 "<a href=\"./pkg/relative-method-link.html\">relative method link</a>"}, |
71 "<a href=\"./pkg/relative-method-link.html\">relative method link</a>"}, |
74 {BUG_ID + FS + "index-all.html", |
72 {BUG_ID + FS + "index-all.html", |
75 "<a href=\"./pkg/relative-package-link.html\">relative package link</a>"}, |
73 "<a href=\"./pkg/relative-package-link.html\">relative package link</a>"}, |
76 {BUG_ID + FS + "index-all.html", |
74 {BUG_ID + FS + "index-all.html", |
77 " <a\n" + |
75 " <a" + NL + |
78 " href=\"./pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."}, |
76 " href=\"./pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."}, |
79 |
77 |
80 |
78 |
81 //PACKAGE USE |
79 //PACKAGE USE |
82 {BUG_ID + FS + "pkg" + FS + "package-use.html", |
80 {BUG_ID + FS + "pkg" + FS + "package-use.html", |
90 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "C.html", |
88 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "C.html", |
91 "<a href=\"../../pkg/relative-method-link.html\">relative method link</a>"}, |
89 "<a href=\"../../pkg/relative-method-link.html\">relative method link</a>"}, |
92 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "C.html", |
90 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "C.html", |
93 "<a href=\"../../pkg/relative-package-link.html\">relative package link</a>"}, |
91 "<a href=\"../../pkg/relative-package-link.html\">relative package link</a>"}, |
94 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "C.html", |
92 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "C.html", |
95 " <a\n" + |
93 " <a" + NL + |
96 " href=\"../../pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."}, |
94 " href=\"../../pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."}, |
97 |
95 |
98 //PACKAGE OVERVIEW |
96 //PACKAGE OVERVIEW |
99 {BUG_ID + FS + "overview-summary.html", |
97 {BUG_ID + FS + "overview-summary.html", |
100 "<a href=\"./pkg/relative-package-link.html\">relative package link</a>"}, |
98 "<a href=\"./pkg/relative-package-link.html\">relative package link</a>"}, |