1 /* |
1 /* |
2 * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2016, 2018, 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. |
68 "-noindex", |
68 "-noindex", |
69 "--module-source-path", src.toString(), |
69 "--module-source-path", src.toString(), |
70 "--module", "m"); |
70 "--module", "m"); |
71 |
71 |
72 checkExit(Exit.OK); |
72 checkExit(Exit.OK); |
73 checkOutput("m-summary.html", false, |
73 checkOutput("m/module-summary.html", false, |
74 "<h3>Packages</h3>\n" |
74 "<h3>Packages</h3>\n" |
75 + "<table class=\"packagesSummary\" summary=\"Packages table, " |
75 + "<table class=\"packagesSummary\" summary=\"Packages table, " |
76 + "listing packages, and an explanation\">"); |
76 + "listing packages, and an explanation\">"); |
77 } |
77 } |
78 |
78 |
157 checkExit(Exit.OK); |
157 checkExit(Exit.OK); |
158 checkCaption("m", TabKind.EXPORTS); |
158 checkCaption("m", TabKind.EXPORTS); |
159 checkTableHead("m", ColKind.EXPORTED_TO); |
159 checkTableHead("m", ColKind.EXPORTED_TO); |
160 checkPackageRow("m", "p", "i0", "All Modules", null, " "); |
160 checkPackageRow("m", "p", "i0", "All Modules", null, " "); |
161 checkPackageRow("m", "q", "i1", |
161 checkPackageRow("m", "q", "i1", |
162 "<a href=\"other-summary.html\">other</a>", null, " "); |
162 "<a href=\"../other/module-summary.html\">other</a>", null, " "); |
163 } |
163 } |
164 |
164 |
165 @Test |
165 @Test |
166 public void exportWithConcealed(Path base) throws Exception { |
166 public void exportWithConcealed(Path base) throws Exception { |
167 Path src = base.resolve("src"); |
167 Path src = base.resolve("src"); |
245 checkCaption("m", TabKind.EXPORTS, TabKind.OPENS, TabKind.CONCEALED); |
245 checkCaption("m", TabKind.EXPORTS, TabKind.OPENS, TabKind.CONCEALED); |
246 checkTableHead("m", ColKind.EXPORTED_TO, ColKind.OPENED_TO); |
246 checkTableHead("m", ColKind.EXPORTED_TO, ColKind.OPENED_TO); |
247 checkPackageRow("m", "c", "i0", "None", "None", " "); |
247 checkPackageRow("m", "c", "i0", "None", "None", " "); |
248 checkPackageRow("m", "e.all", "i1", "All Modules", "None", " "); |
248 checkPackageRow("m", "e.all", "i1", "All Modules", "None", " "); |
249 checkPackageRow("m", "e.other", "i2", |
249 checkPackageRow("m", "e.other", "i2", |
250 "<a href=\"other-summary.html\">other</a>", "None", " "); |
250 "<a href=\"../other/module-summary.html\">other</a>", "None", " "); |
251 checkPackageRow("m", "eo", "i3", "All Modules", "All Modules", " "); |
251 checkPackageRow("m", "eo", "i3", "All Modules", "All Modules", " "); |
252 checkPackageRow("m", "o.all", "i4", "None", "All Modules", " "); |
252 checkPackageRow("m", "o.all", "i4", "None", "All Modules", " "); |
253 checkPackageRow("m", "o.other", "i5", "None", |
253 checkPackageRow("m", "o.other", "i5", "None", |
254 "<a href=\"other-summary.html\">other</a>", " "); |
254 "<a href=\"../other/module-summary.html\">other</a>", " "); |
255 } |
255 } |
256 |
256 |
257 @Test |
257 @Test |
258 public void openModule(Path base) throws Exception { |
258 public void openModule(Path base) throws Exception { |
259 Path src = base.resolve("src"); |
259 Path src = base.resolve("src"); |
365 checkExit(Exit.OK); |
365 checkExit(Exit.OK); |
366 checkCaption("m", TabKind.OPENS); |
366 checkCaption("m", TabKind.OPENS); |
367 checkTableHead("m", ColKind.OPENED_TO); |
367 checkTableHead("m", ColKind.OPENED_TO); |
368 checkPackageRow("m", "p", "i0", null, "All Modules", " "); |
368 checkPackageRow("m", "p", "i0", null, "All Modules", " "); |
369 checkPackageRow("m", "q", "i1", null, |
369 checkPackageRow("m", "q", "i1", null, |
370 "<a href=\"other-summary.html\">other</a>", " "); |
370 "<a href=\"../other/module-summary.html\">other</a>", " "); |
371 } |
371 } |
372 |
372 |
373 @Test |
373 @Test |
374 public void openWithConcealed(Path base) throws Exception { |
374 public void openWithConcealed(Path base) throws Exception { |
375 Path src = base.resolve("src"); |
375 Path src = base.resolve("src"); |
441 + "<span>" + name + "</span>" |
441 + "<span>" + name + "</span>" |
442 + "<span class=\"tabEnd\"> </span>" |
442 + "<span class=\"tabEnd\"> </span>" |
443 + "</caption>"; |
443 + "</caption>"; |
444 } |
444 } |
445 |
445 |
446 checkOutput(moduleName + "-summary.html", true, expect); |
446 checkOutput(moduleName + "/module-summary.html", true, expect); |
447 } |
447 } |
448 |
448 |
449 |
449 |
450 private void checkTableHead(String moduleName, ColKind... kinds) { |
450 private void checkTableHead(String moduleName, ColKind... kinds) { |
451 Set<ColKind> kindSet = Set.of(kinds); |
451 Set<ColKind> kindSet = Set.of(kinds); |
459 sb.append("<th class=\"colSecond\" scope=\"col\">Opened To Modules</th>\n"); |
459 sb.append("<th class=\"colSecond\" scope=\"col\">Opened To Modules</th>\n"); |
460 } |
460 } |
461 sb.append("<th class=\"colLast\" scope=\"col\">Description</th>\n" |
461 sb.append("<th class=\"colLast\" scope=\"col\">Description</th>\n" |
462 + "</tr>"); |
462 + "</tr>"); |
463 |
463 |
464 checkOutput(moduleName + "-summary.html", true, sb.toString()); |
464 checkOutput(moduleName + "/module-summary.html", true, sb.toString()); |
465 } |
465 } |
466 |
466 |
467 private void checkPackageRow(String moduleName, String packageName, |
467 private void checkPackageRow(String moduleName, String packageName, |
468 String id, String exportedTo, String openedTo, String desc) { |
468 String id, String exportedTo, String openedTo, String desc) { |
469 StringBuilder sb = new StringBuilder(); |
469 StringBuilder sb = new StringBuilder(); |