Mercurial > hg > icedtea8-forest > langtools
changeset 4053:46c4c126f559 icedtea-3.17.1
Merge jdk8u275-ga
author | Andrew John Hughes <gnu_andrew@member.fsf.org> |
---|---|
date | Tue, 10 Nov 2020 02:47:05 +0000 |
parents | 362d946c74ce (diff) e3d069113ab6 (current diff) |
children | 67e2692358cb |
files | .hgtags |
diffstat | 250 files changed, 8631 insertions(+), 12152 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Thu Nov 05 05:11:09 2020 +0000 +++ b/.hgtags Tue Nov 10 02:47:05 2020 +0000 @@ -50,6 +50,7 @@ 9596dff460935f09684c11d156ce591f92584f0d jdk7-b73 1a66b08deed0459054b5b1bea3dfbead30d258fa jdk7-b74 2485f5641ed0829205aaaeb31ad711c2c2ef0de3 jdk7-b75 +83367f01297bf255f511f5291bbbbaa24a9c8459 icedtea7-1.12 8fb9b4be3cb1574302acde90549a4d333ef51e93 jdk7-b76 0398ae15b90ac76d87ee21844453e95ff8613e43 jdk7-b77 acc1e40a5874ebf32bebcb6ada565b3b40b7461c jdk7-b78 @@ -63,6 +64,7 @@ ef07347428f2198ae6b8144ac0b9086bbe39fd16 jdk7-b86 409db93d19c002333980df5b797c6b965150c7a0 jdk7-b87 f9b5d4867a26f8c4b90ad37fe2c345b721e93d6b jdk7-b88 +681f1f51926faf4c73d8905a429ff4ead6e9d622 icedtea7-1.13 6cea9a143208bc1185ced046942c0f4e45dbeba5 jdk7-b89 71c2c23a7c35b2896c87004023b9743b6d1b7758 jdk7-b90 97b6fa97b8ddb3a49394011c2a0ec5d6535e594c jdk7-b91 @@ -111,6 +113,7 @@ 3d7acdbb72cab55deedfd35f60d4732abc9d6ac4 jdk7-b134 9d0a61ac567b983da7cc8f4a7030f2245bb6dbab jdk7-b135 ed0f7f1f9511db4f9615b1426d22f8b961629275 jdk7-b136 +8e26c4aee63c04ee129bf9068f5eea47cc385177 icedtea-1.14 a15c9b058ae007d4ccb7e35ce44e4dfa977f090b jdk7-b137 53f212bed4f4304dce7f0bf0fa01c998c65bacd6 jdk7-b138 853b6bb99f9b58eb7cf8211c67d3b6e4f1228a3e jdk7-b139 @@ -295,6 +298,7 @@ 1a57c569cb811a897691e42049eca33da8f8d761 jdk8u20-b07 0f821eb7e92b242c878dca68ef63f9626643ee8f jdk8u20-b08 aa0cb3af23d376e012a142b0531c4f42032fdacf jdk8u20-b09 +dd7b57ab4ab1a4bb93c543af3a13f66fe85a7802 icedtea-3.0.0pre01 a0d9c18a1041c4217db9cda1817f0e348f1be885 jdk8u20-b10 7ad480b982bf95b8a7290c8769b2698f6aacaf6b jdk8u20-b11 e101a12a45a777268a2e729803499a7514255e5b jdk8u20-b12 @@ -308,6 +312,7 @@ e92effa22ecee1cb9965c278e45e2b1a6fbe0766 jdk8u20-b20 7de1481c6cd88b42d815ae65e2d5b1cd918e11d1 jdk8u20-b21 61fb0d8b169164ad5db15b6c497489cb30efb9c6 jdk8u20-b22 +948daf9c5e22c99a8c4d26d7956d9b55b888ab08 icedtea-3.0.0pre02 5c1d6da1445aa3a2e5cf6101c70e79bfbe2745a5 jdk8u20-b23 9239118487dfb47ee850d2cc9b10a0a2e510da3c jdk8u20-b24 9239118487dfb47ee850d2cc9b10a0a2e510da3c jdk8u20-b25 @@ -375,6 +380,9 @@ 94f30e5fde53e3ddcd3c4e9842349318eae8fe10 jdk8u40-b18 0c514d1fd006fc79d35b670de10c370c8d559db7 jdk8u40-b19 c3d6d1a5339952fbe4124e700407b7211446c99c jdk8u40-b20 +0d5d2b8411d9c36f180c6d0d3029629fa2070018 icedtea-3.0.0pre03 +66f265db6f474faba47a35888ca9131562fd59a1 icedtea-3.0.0pre04 +811deb5a72d392f846f0ab4e38d4ee392e9553cf icedtea-3.0.0pre05 9113c7c8d902ec94b28ca0ef4a6466bdba65fcfc jdk8u40-b21 79177246b3dbe5296fb53755d8695acdaef59fc8 jdk8u40-b22 fb294b49373bda0b3afc7f011d64ecefed73b42e jdk8u40-b23 @@ -453,6 +461,9 @@ 97328f3e2aa2c713931edf471270a1208980b963 jdk8u60-b21 d1febf79ce5ea41fb4b818ffd3589cf923e6de5f jdk8u60-b22 7f88b5dc78cebc2c5ebb716938fd9a7632b052b2 jdk8u60-b23 +69b782e543d54118f9354b6071830de5feb96b83 icedtea-3.0.0pre06 +3c76eafe1b7010bf5536add7097c318d349efb16 icedtea-3.0.0pre07 +0d3479e0bac61b3fab0f8e884fc6bda8f8f351a5 icedtea-3.0.0pre08 2af11e10da7dc24610551bbeed02c4ca3f4ae654 jdk8u60-b24 8d152d1e45944616309886e730ffcbfb5c078d22 jdk8u60-b25 3876ab6f471b85a02bb2cdaca00652f169f9e27a jdk8u60-b26 @@ -535,6 +546,7 @@ 5218bea65fe64b31cf201f3f6dd0310b74acec1e jdk8u72-b12 5b67278c6616dca433488697eb6f2f81fcbbf22d jdk8u72-b13 0ee6d8ae247d449950c18623513ccae4349e70d6 jdk8u72-b14 +076ec0ef64f0b4d71419e99ca2666ca814b508ad icedtea-3.0.0pre09 48d0c20256a37ad20d075091285ea23788186f9a jdk8u72-b15 ee6ec29fce4fa75ff846f7cbf61da162d8c5b605 jdk8u72-b31 1a1711b8d11959992c27462d652003965ef3dc36 jdk8u73-b00 @@ -570,6 +582,9 @@ ae2485fab956c636f6ce10a23812204c0ae17046 jdk8u77-b00 37a348477fe89736549913f51ec8143a8e73f71c jdk8u77-b01 47efac0d67984678edf626f407b3d3e54083c242 jdk8u77-b02 +d6b6666581f91588b9c66cadaaddadbe7266d78b icedtea-3.0.0pre10 +dd581e8047e6f15c811b345ed4eef0218ca9fe18 icedtea-3.0.0 +d05b69482d8390591cf8a1ebf9166ba46259bebd icedtea-3.0-branchpoint 094308b2ca1c6d6dd76d9412799b9f3b4299acb5 jdk8u77-b03 837f6e6559d578fadecb4932f3ceedfc31681bca jdk8u77-b31 4cbd08688ff5a39f936edf16dd765d1efa13d030 jdk8u91-b00 @@ -591,6 +606,10 @@ b86071b48b55340a3e712e91b2ba203a55a79571 jdk8u76-b12 db821ed6165c5080b09e829b4523dcf82d995a2f jdk8u92-b00 12846c3fc5a151a33e9446eff6e6704110c00362 jdk8u92-b13 +f3a9ed2cc7219a2b9b0cfd11729bbd0ef798e7ee icedtea-3.1.0pre01 +dbf29857221f4aa707e3a7acf850b06e690bcc01 icedtea-3.1.0pre02 +ff680965fa8c23cdafdd1028e1f33d0f351ad079 icedtea-3.1.0pre03 +fc69984700e156fe3290daea69e2d2ecc8acccaf icedtea-3.1.0pre04 c99c71a68555038fdd1e86a10dab9c9007ec3745 jdk8u92-b14 71176efa69475fc737d1245a28e739ddf105fd1c jdk8u92-b31 4e8ce6c84e4ca9dd385012c10e059c15dbfcc468 jdk8u92-b32 @@ -609,6 +628,8 @@ 20f3856902a522f01b28aa2aa38701606af83ab8 jdk8u101-b10 5cc23fe55ff4c64838e2335644b674bdd0888340 jdk8u101-b11 0cef544b9eee7042001a2b7f5f9e8a48ef20d779 jdk8u101-b12 +05822f2e947be716d90fa20335b57c9ce5ee62aa icedtea-3.1.0 +88f7b4f1b721ab67ca4cd72e691d2f6c7a72c64b icedtea-3.2.0pre01 8dc8f71216bf40c259bb4127270922fb6a6ca293 jdk8u101-b13 10ffafaf53404de7fd23784aa3ff6016d107b9c8 jdk8u76-b00 0caab0d65a04d8cce71976a6bdc1ca0841bcbcf0 jdk8u76-b01 @@ -630,6 +651,8 @@ 592d155cc1332eba606900a7273863c74ef082a4 jdk8u102-b11 16c58d7af5a4937e46bccd58114a56a7ffcd685c jdk8u102-b12 56b0df415b570e31dc0b97d4a1c8f28b85240089 jdk8u102-b13 +19ea84ae4992037367f85aadb746279ab489422a icedtea-3.2.0pre02 +5665ca5e1896dcf47faa2c5c50d1130b8b783944 icedtea-3.2.0pre03 0549bf2f507dae59bfcd7d11e038cdc62376fee7 jdk8u102-b14 d86027f25a9aa960d69cf3a524588a873ae888f5 jdk8u102-b31 1b511d4e93e7128ccb7100110ab6604eb2838afa jdk8u102-b32 @@ -650,6 +673,7 @@ f51f1b8a7b58355c11392effdf0e4f738a79a8ad jdk8u111-b11 8e5e70b9cff8f928d28db4890d4e5905a739d210 jdk8u111-b12 ef3134b243da77d0aed9f3cef2b3855c3be2111a jdk8u111-b13 +a553c153d37671a371767229c71189d963964996 icedtea-3.2.0 0e2e745ed6d7bb8a2233e83f4bad40e793a16949 jdk8u111-b14 27503e49de52b54dde3a12af28e2d2de473192b3 jdk8u112-b00 60a0572cd449e33b7d48b5a40065222ab5accd36 jdk8u112-b01 @@ -667,6 +691,7 @@ b353281f73db9617d993353e468342d3420c29f1 jdk8u112-b14 6116c6644be0c85556931aaeb9b4f2dbc9c79157 jdk8u112-b15 ee37eafc48cb6fb20cb6c1e31cfecfe1ccc800da jdk8u112-b16 +3ab9841babb7f624ae830024e42e75344a4fed5a icedtea-3.3.0pre01 de1c3df992adb0c704005583210d1ed6dac758cd jdk8u112-b31 c94fd1b737d005962ba62fa03106de791692f39c jdk8u112-b32 721ea56edf4196b37a081ac47206202d7560e16c jdk8u112-b33 @@ -683,6 +708,9 @@ 53c94a674d6076ff390c62a7682ea0e87a893cdc jdk8u121-b10 b634abfcd98fb8b201da9208e398ea17cabd2b32 jdk8u121-b11 7fc347da372c8c4e5530a7fa32084b5dbc4ee8b6 jdk8u121-b12 +26a274d91ee67eb2f029da07676bacc8af09f93b icedtea-3.3.0pre02 +d10a13bdc98ca6a44ef27059c8403162a7059197 icedtea-3.3.0 +a3d47fe59cc4a4d7956d68c93862c2ce1e1062f0 icedtea-3.4.0pre01 f634736433d9fc1cffbdc55611f97ecb2cd44059 jdk8u121-b13 1dc3121986c615c2ac1f5e7d6705b197c5dfcae6 jdk8u121-b31 970edd6f01b76e916cf223fbc53dcef085a0255b jdk8u121-b32 @@ -701,6 +729,8 @@ 3a62189765a88f393a51923f98020ad7b2d4fc7d jdk8u131-b08 2f2c4931d13c44bb6a0f808809e723de0677e302 jdk8u131-b09 676a07884de49a7c60379da8ac892fe1403de6b6 jdk8u131-b10 +4ef0ee9279400d2574e34afa84b74936d337573e icedtea-3.4.0 +40fe2817d64898ec28391091ba3c4e6d5124bdc0 icedtea-3.5.0pre01 5162417b51bdf68b95696198181f2e662a14ff8a jdk8u131-b11 12f40d1f41c2cea8b61d046796a753000e61196f jdk8u131-b31 508e7f6446deede595bbdbdc6d6cf9fc1ae8e728 jdk8u131-b32 @@ -721,8 +751,13 @@ b5259d2465fa61256f485860f986bd575f13fe92 jdk8u141-b12 9a5ddb594b491ec32e9fafa7008631291ab66d6e jdk8u141-b13 553043f3a2319af6fd6bc704bc8fd7fa4500ee80 jdk8u141-b14 +0456f88e5c29ac625921e57684fb203f1dd202a2 icedtea-3.5.0 027f6df9fe82624fb7d489ffd848a26796de4868 jdk8u141-b15 4c355f7002c36bb626b42d5c1d42ea91d77ba5d6 jdk8u144-b00 +74bbbc7a8bd30cdc472fe93c2938182322825b2a icedtea-3.5.1 +0456f88e5c29ac625921e57684fb203f1dd202a2 icedtea-3.6.0pre00 +74bbbc7a8bd30cdc472fe93c2938182322825b2a icedtea-3.6.0pre01 +e0f1c298f0d664b90d68f9a775441be66ea1e3f3 icedtea-3.6.0pre02 816907853a15d9b22a87032d07327a400f8568b3 jdk8u144-b01 716e712f0db45c8231208bc70ab4d2a8a40c4d3a jdk8u141-b31 09c2459991619ef7061ad2bc66373ed29f500acf jdk8u141-b32 @@ -744,6 +779,7 @@ c686a7fe765ec746c514618bae61dfc1570ce5b5 jdk8u151-b09 8fb1d9ffc81c4bb6e08330726995b9b8f2b694a1 jdk8u151-b10 607b049fabd1352893470463dfb455e0a407687d jdk8u151-b11 +61a1c711f7abeb66195623343c1cd08b0df2dc1d icedtea-3.6.0 8559c5805c2b091e2122dff3d04c7342cd15560c jdk8u151-b12 9a9ce479b92f1b4d9d436fb857d70c3d2b59a20c jdk8u122-b00 85d9e434701cc7112aaf965b0f5ee4b31ab2a445 jdk8u122-b01 @@ -771,6 +807,7 @@ afbf7275401383d6dbbd54149a8985f510f57d7d jdk8u152-b13 752a7260bb1977979243aa8dd9a588787237662e jdk8u152-b14 8c2463d627e3cf513522ba32bf71624c880beb91 jdk8u152-b15 +e32341052fe1cd792639b9e0ac48972a2e133a17 icedtea-3.7.0pre01 97dfb267d417415aca378f62b97dbf7a12a93f8a jdk8u152-b16 757f531633e3feb2d8c08b6afe748134e61ad917 jdk8u152-b31 73ffe473564c8952813473078497a5e915655665 jdk8u152-b32 @@ -836,6 +873,9 @@ 96cdc8b62d5f7263a0c42bc21bf85a205cb75ebb jdk8u161-b09 cfc40ab214f9174edbb08925a39efd081d6e4b34 jdk8u161-b10 44fd88d9e5ae96d54e6d993dae14d6f2ab53b5c1 jdk8u161-b11 +0a2dce555d35690b6bb6ce45713424cb6c36b3ac icedtea-3.7.0 +0a2dce555d35690b6bb6ce45713424cb6c36b3ac icedtea-3.8.0pre00 +2aaad794fdd168afb8255ba14b6f49263e5d7d15 icedtea-4-branchpoint cc28ef580ec551df5338083eb9365b923bceedf4 jdk8u161-b12 6d21463aeffd526c9f7f5ce9a70ae7664235e125 jdk8u162-b00 9986bf97a48d3f2f16b90f2fb72e52b398202bd0 jdk8u162-b01 @@ -849,6 +889,7 @@ e856f66901b181604c72bb8fcc7b9e746ee4593a jdk8u162-b09 29bd40939ca9433f1ab9dccc00d809c309427cce jdk8u162-b10 f112f1acb17609cdd4151abf21f069d2bae24e99 jdk8u162-b11 +831896b367a4fb12630d9f040b49ebe9cf568ade icedtea-3.8.0pre01 90286557058376d6c01260e3c192f76111f78b36 jdk8u162-b12 07db50c5408300e6a56dcf0a5a74aad27616f36e jdk8u162-b31 fdc876cee8474603fb269d8e2a78d56e0809b66c jdk8u162-b32 @@ -887,6 +928,10 @@ 6f2f6a0c04c0ce37d42ce1f2657c7b5cf4286ca7 jdk8u171-b08 bd20bc03808c33b2e8243e7cfd5b9826c6a24d26 jdk8u171-b09 32a9ad19c92dae08f87048c8ae8c413325d4a128 jdk8u171-b10 +4a11d88aab1d20bf633bd1e8a4d2a549a750add8 icedtea-3.8.0pre02 +21524ad5b91455394aabcc732f571aa6606b9a94 icedtea-3.8.0 +21524ad5b91455394aabcc732f571aa6606b9a94 icedtea-3.9.0pre00 +e4ee185e6cfe4d01d3baa2d2f00773e7620d6cc2 icedtea-3.9.0pre01 c9e49a425522f90456701e11db13e3ebc9f3939f jdk8u171-b11 53092d863cb60907700ac5fd7d12fc28ce871b2a jdk8u172-b00 47a91ecb0b875b8c03c335e11bfe5052bad4f1cf jdk8u172-b01 @@ -899,6 +944,7 @@ 44a8be4e5ab09cde08ee5a9b7599640d5acc5a43 jdk8u172-b08 3f86a51255225110eea453dd260cc4e783607a0d jdk8u172-b09 1c96dd3f4f1032dd1123c361faa73656f68c0238 jdk8u172-b10 +96b0caf1aad9d04e0ec56ee51435a7b998d1dc32 icedtea-3.9.0pre02 2c9cfdb5286826d9f176d79086d58ddb0bd61333 jdk8u172-b11 b99d109cf86fca764ff4e95cc2d876221ba96875 jdk8u172-b31 25279b209800e60fee83800a111b37579c9ce81a jdk8u172-b32 @@ -919,6 +965,10 @@ c9983154c823f2d5d680c6d2167b158a57d9a64b jdk8u181-b10 dab3e14146dcacc98a4a4cdaa1d2ab2c2f28ef23 jdk8u181-b11 3a8cdcba4ab570ce1d2608b27574fc9d63ec5c1a jdk8u181-b12 +95f8f28f68d49e81286eaddcafcdc775b57030c5 jdk8u181-b31 +8496472630c5b4b623a79c224c53ea0b0041a020 icedtea-3.9.0 +8496472630c5b4b623a79c224c53ea0b0041a020 icedtea-3.10.0pre00 +c9f44385be7ef07174ef6b907d967c28288d182a icedtea-3.10.0pre01 e910eba1327dd1abab48a85a1b5890524ebf64af jdk8u181-b13 7cfe4a92d1d51c3f6a0477e508338bcd187b520e jdk8u191-b01 1f33e21011aaeac7e0d567be4e67f8953c42f6e0 jdk8u201-b00 @@ -933,6 +983,9 @@ 5e9e2a958660fddff8a27bc567fc0dff9d86fefe jdk8u191-b10 394de93b280cb1d578614788dc229299bd5d12a5 jdk8u191-b25 f3f92df0a2947114b87b4a0934f7e8db7c7d274f jdk8u191-b11 +7036a6fa432ecc31132e6ff3a7ea7529c994fc57 icedtea-3.10.0 +7036a6fa432ecc31132e6ff3a7ea7529c994fc57 icedtea-3.11.0pre00 +aeb6ac72f4964ed179047a193a1ada67740e0d2b icedtea-3.11.0pre01 d035a731ab597cffc8e847d46913088273f49f04 jdk8u191-b12 17bb956bc44ee4b3f8177e9414d0e4dbb56af417 jdk8u191-b26 aee7802a04daf266caadc5742737bdd7d9a17937 jdk8u182-b00 @@ -950,6 +1003,7 @@ d1e08933590e00d9c074922dc13eb3fab8ca8a9d jdk8u192-b10 baf29dda8fdc9ffd971e659ac44dbeb37ab98476 jdk8u192-b25 3bf2d872627dbce9fcba73f64b7a158e67e5f46f jdk8u192-b11 +abbb38dafbc8db02ea7f3ff22ca249710387c4b2 icedtea-3.11.0pre02 3eb4c8be649b8772eb0e82ce80366e4625ea3397 jdk8u192-b12 4bbe353fcc36f1da3ead0c874e15bb649337c183 jdk8u192-b26 107b71b590ec4cb3f947674c4cac78eb97ad0899 jdk8u181-b31 @@ -971,6 +1025,7 @@ 4fbee4ebd4d32b302367c44f5e63b1bd647490f1 jdk8u201-b07 dd3348cbc2d0651582fa8ede11c58e6bdd365c61 jdk8u201-b77 8c8f74830128f0b244d878920df032e704d35eee jdk8u201-b08 +78414f4f0172bf37926faeefe54df0b7f8381d0d icedtea-3.11.0 689d7755e8c17c5e18a8b86e01e4064695e74ee5 jdk8u201-b09 7d4b8157ceddfc1adacdf1fe8fd35d7ec10b7a9b jdk8u201-b79 4466875577d86dd5c16a9f6885909ba831653acb jdk8u201-b25 @@ -983,6 +1038,8 @@ 08a36f013df27134878b8ce4af10bf7b4c280de0 jdk8u202-b05 0bab06166b752fd5dc64e0f087afbb761db7b667 jdk8u202-b06 d050098ff289bdf42e642fff35a11a15e377624e jdk8u202-b07 +517f10ee596b8498986ee09e4c3c25793202d889 icedtea-3.12.0pre01 +78414f4f0172bf37926faeefe54df0b7f8381d0d icedtea-3.12.0pre00 95f8837bfbdc0da195c6ab9a32b97921cc2dd292 jdk8u202-b08 15d8c732039b3537a3ec774b6c8df5af3fd71b57 jdk8u202-b25 c0f526208190beea95ec99b06655603537c761f0 jdk8u202-b26 @@ -994,6 +1051,7 @@ 4c4c8a86bcb2130dca9581a9aad6a60c01bfeeb0 jdk8u212-b03 075e7154cddf75a861c657c6177797fdfbf36d3f jdk8u212-b04 4c4c8a86bcb2130dca9581a9aad6a60c01bfeeb0 jdk8u212-ga +fb494039358f2a9c98da0e91b58a056506c6c42d icedtea-3.12.0 1f6b4d9449772ea511e1772c3bdd840e0e550e8c jdk8u222-b01 d91f70a5eb9d97d2ec52d3d63a512030b151250c jdk8u222-b02 12045c5cae334679b31386ddb790c3b7394525ea jdk8u222-b03 @@ -1006,7 +1064,11 @@ 6aa4f05982eb70dc746f84a152c4e5e0b4a7261e jdk8u222-b09 32df4483e2e387a85688bad69c398dc4c7bc2cfa jdk8u222-b10 32df4483e2e387a85688bad69c398dc4c7bc2cfa jdk8u222-ga +78399e0f6ae409e0c2752271cadc73b8a5688f71 icedtea-3.13.0pre01 +2008b12a91d1793332412b126bfbe5d92a13caeb icedtea-3.13.0 d859443cacf81207f0879e9f21810b102afdb240 jdk8u232-b01 +2008b12a91d1793332412b126bfbe5d92a13caeb icedtea-3.14.0pre00 +69b271efa4fa1fd972945783f250e6dde10c8205 icedtea-3.14.0pre01 19908109cb37637cebab5d6e9cc6c151836cbc27 jdk8u232-b02 671c4ba50c6f4f9780d40de2549d91f15fcb88d1 jdk8u232-b03 3de2732a8241c8c85a85942f7341ad48491976d9 jdk8u232-b04 @@ -1017,6 +1079,9 @@ 4bc16c3608302128648e92c80f3b396372471383 jdk8u232-b08 735048c9f2d6835b76a436beffd29565f28a2a36 jdk8u232-b09 735048c9f2d6835b76a436beffd29565f28a2a36 jdk8u232-ga +ccec65feaaac7f34fd84e99e7f2693c65f5e5250 icedtea-3.14.0 +ccec65feaaac7f34fd84e99e7f2693c65f5e5250 icedtea-3.15.0pre00 +80b6585d1877f003f926a47828e5e8664100e686 icedtea-3.15.0pre01 92a07f0a1bb101933e1c385b7c9d44e3c593e40d jdk8u242-b01 5b0a0cf41fc1243f32ffe5682ac5dde265902daa jdk8u242-b02 fbe99e0b4e74edb310cebd774399d80c77be636d jdk8u242-b03 @@ -1026,7 +1091,10 @@ 2b1a419389932f0367ab68ad60c4ec209e1ae417 jdk8u242-b07 b2b31daec366e7725872dd53dd800cbc9ada70c9 jdk8u242-b08 b2b31daec366e7725872dd53dd800cbc9ada70c9 jdk8u242-ga +9cb3b18d9139ca336ab14209321e2cb6e86df262 icedtea-3.15.0 +9cb3b18d9139ca336ab14209321e2cb6e86df262 icedtea-3.16.0pre00 fefafdbaeb2db73e15f2be0784538f9917235b5c jdk8u252-b00 +37c3c47b664fccb9e37f2bc58edc4555c260b504 icedtea-3.16.0pre01 dba0e28b9488325476ce34fa47af1ada3614685d jdk8u252-b01 24a2778069293cc97b79df91049265be1061c3bf jdk8u252-b02 665990488f3d9dbaef06f04e0383bfecf2d0e031 jdk8u252-b03 @@ -1038,6 +1106,9 @@ c56eceecec71d0b7f8af742ba33b50a3128de58f jdk8u252-b08 01036da3155c1ff6f5a92eab0b8be842148258f3 jdk8u252-b09 01036da3155c1ff6f5a92eab0b8be842148258f3 jdk8u252-ga +e47d37e5fe0b5e2292eed6ffbda1359786b0adcf icedtea-3.16.0 +e47d37e5fe0b5e2292eed6ffbda1359786b0adcf icedtea-3.17.0pre00 +ad7ffc1bb8e1183cf1cc7b764c620c02ab60d69e icedtea-3.17.0pre01 05fc0d4d4fbe10508ed18e2f64f42ca16a71306f jdk8u262-b01 910ec7999bd5c01dc979ea99604d5122e465ad34 jdk8u262-b02 6df22f7cfdf1154526a79982cb99fbd7684b0bbd jdk8u262-b03 @@ -1056,6 +1127,7 @@ a51cd1abb0c93552857885b1ba53592c786714d2 jdk8u272-b01 54f67143c9566104641b6c69ce33f541d0f5f350 jdk8u272-b02 4e02b68de4582b99db1331852cb731914a47adba jdk8u272-b03 +4ea625a4e1562077914fc6b5084646aec90b8635 icedtea-3.17.0pre02 a317abfcbd909b1c094e250afb0cb618e363e938 jdk8u272-b04 f1fa9a70296a0ce38c6e315fb3ee107aa32f6b42 jdk8u272-b05 b974f43a589fa0ca7be9d0a62673929229a2a4e7 jdk8u272-b06 @@ -1064,6 +1136,7 @@ acab1eb3dc4c828f87500709d05ea2293baed60c jdk8u272-b09 68a2632bf926ed13c20af12d3c5d1b3e79f3acb9 jdk8u272-b10 68a2632bf926ed13c20af12d3c5d1b3e79f3acb9 jdk8u272-ga +83b7a751f44f5c65b847f243e2e8a3c87ab144dc icedtea-3.17.0 68a2632bf926ed13c20af12d3c5d1b3e79f3acb9 jdk8u275-b00 69c56445e05a11372f82e4c0e2ad7ea083b513ad jdk8u275-b01 69c56445e05a11372f82e4c0e2ad7ea083b513ad jdk8u275-ga
--- a/.jcheck/conf Thu Nov 05 05:11:09 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -project=jdk8 -bugids=dup
--- a/make/BuildLangtools.gmk Thu Nov 05 05:11:09 2020 +0000 +++ b/make/BuildLangtools.gmk Tue Nov 10 02:47:05 2020 +0000 @@ -36,7 +36,7 @@ JAVAC := $(JAVAC), \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA), \ - FLAGS := -XDignore.symbol.file=true -g -Xlint:all$(COMMA)-deprecation -Werror)) + FLAGS := -XDignore.symbol.file=true -g -Xlint:all$(COMMA)-deprecation $(JAVAC_WERROR))) # javax.tools.JavaCompilerTool isn't really a suffix but this gets the file copied. RESOURCE_SUFFIXES := .gif .xml .css .js javax.tools.JavaCompilerTool @@ -175,7 +175,7 @@ JAVAC := "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar" \ -cp $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \ com.sun.tools.javac.Main, \ - FLAGS := -XDignore.symbol.file=true -Xlint:all$(COMMA)-deprecation -Werror, \ + FLAGS := -XDignore.symbol.file=true -Xlint:all$(COMMA)-deprecation $(JAVAC_WERROR), \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
--- a/make/build.xml Thu Nov 05 05:11:09 2020 +0000 +++ b/make/build.xml Tue Nov 10 02:47:05 2020 +0000 @@ -1027,7 +1027,7 @@ </javac> <taskdef name="genstubs" classname="anttasks.GenStubsTask" - classpath="${build.toolclasses.dir}/"/> + classpath="${build.toolclasses.dir}:${build.bootstrap.dir}/classes:${ant.home}/lib/ant.jar"/> </target> <target name="-def-javadoc-tool" depends="-check-target.java.home">
--- a/src/share/classes/com/sun/tools/classfile/Attributes.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/classfile/Attributes.java Tue Nov 10 02:47:05 2020 +0000 @@ -56,8 +56,7 @@ public Attributes(ConstantPool constant_pool, Attribute[] attrs) { this.attrs = attrs; map = new HashMap<String,Attribute>(); - for (int i = 0; i < attrs.length; i++) { - Attribute attr = attrs[i]; + for (Attribute attr : attrs) { try { map.put(attr.getName(constant_pool), attr); } catch (ConstantPoolException e) {
--- a/src/share/classes/com/sun/tools/classfile/ClassWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/classfile/ClassWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -57,11 +57,8 @@ * Write a ClassFile data structure to a file. */ public void write(ClassFile classFile, File f) throws IOException { - FileOutputStream f_out = new FileOutputStream(f); - try { + try (FileOutputStream f_out = new FileOutputStream(f)) { write(classFile, f_out); - } finally { - f_out.close(); } }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -268,13 +268,13 @@ protected ClassDoc implementsMethodInIntfac(MethodDoc method, ClassDoc[] intfacs) { - for (int i = 0; i < intfacs.length; i++) { - MethodDoc[] methods = intfacs[i].methods(); + for (ClassDoc intf : intfacs) { + MethodDoc[] methods = intf.methods(); if (methods.length > 0) { - for (int j = 0; j < methods.length; j++) { - if (methods[j].name().equals(method.name()) && - methods[j].signature().equals(method.signature())) { - return intfacs[i]; + for (MethodDoc md : methods) { + if (md.name().equals(method.name()) && + md.signature().equals(method.signature())) { + return intf; } } }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -101,14 +101,13 @@ // Display the list only if there are elements to be displayed. if (memberListSize > 0) { Content dl = new HtmlTree(HtmlTag.DL); - for (int i = 0; i < memberListSize; i++) { - Doc element = memberlist.get(i); + for (Doc element : memberlist) { if (element instanceof MemberDoc) { - addDescription((MemberDoc)element, dl); + addDescription((MemberDoc) element, dl); } else if (element instanceof ClassDoc) { - addDescription((ClassDoc)element, dl); + addDescription((ClassDoc) element, dl); } else if (element instanceof PackageDoc) { - addDescription((PackageDoc)element, dl); + addDescription((PackageDoc) element, dl); } } contentTree.addContent(dl);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -87,14 +87,13 @@ int size = list.size(); if (size > 0) { Content ul = new HtmlTree(HtmlTag.UL); - for (int i = 0; i < size; i++) { - ClassDoc local = list.get(i); + for (ClassDoc local : list) { HtmlTree li = new HtmlTree(HtmlTag.LI); li.addAttr(HtmlAttr.TYPE, LI_CIRCLE); addPartialInfo(local, li); addExtendsImplements(parent, local, li); addLevelInfo(local, classtree.subs(local, isEnum), - isEnum, li); // Recurse + isEnum, li); // Recurse ul.addContent(li); } contentTree.addContent(ul); @@ -135,10 +134,10 @@ if (interfaces.length > (cd.isInterface()? 1 : 0)) { Arrays.sort(interfaces); int counter = 0; - for (int i = 0; i < interfaces.length; i++) { - if (parent != interfaces[i]) { - if (! (interfaces[i].isPublic() || - Util.isLinkable(interfaces[i], configuration))) { + for (ClassDoc intf : interfaces) { + if (parent != intf) { + if (!(intf.isPublic() || + Util.isLinkable(intf, configuration))) { continue; } if (counter == 0) { @@ -153,7 +152,7 @@ contentTree.addContent(", "); } addPreQualifiedClassLink(LinkInfoImpl.Kind.TREE, - interfaces[i], contentTree); + intf, contentTree); counter++; } }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -150,9 +150,9 @@ * @param content HtmlTree content to which the links will be added */ protected void addContents(List<Doc> classlist, boolean wantFrames, - Content content) { - for (int i = 0; i < classlist.size(); i++) { - ClassDoc cd = (ClassDoc)classlist.get(i); + Content content) { + for (Doc doc : classlist) { + ClassDoc cd = (ClassDoc) doc; if (!Util.isCoreClass(cd)) { continue; } @@ -160,7 +160,7 @@ Content linkContent; if (wantFrames) { linkContent = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.ALL_CLASSES_FRAME, cd).label(label).target("classFrame")); + LinkInfoImpl.Kind.ALL_CLASSES_FRAME, cd).label(label).target("classFrame")); } else { linkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.DEFAULT, cd).label(label)); }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -159,22 +159,20 @@ public static void generate(ConfigurationImpl configuration, ClassTree classtree) { ClassUseMapper mapper = new ClassUseMapper(configuration.root, classtree); - ClassDoc[] classes = configuration.root.classes(); - for (int i = 0; i < classes.length; i++) { + for (ClassDoc aClass : configuration.root.classes()) { // If -nodeprecated option is set and the containing package is marked // as deprecated, do not generate the class-use page. We will still generate // the class-use page if the class is marked as deprecated but the containing // package is not since it could still be linked from that package-use page. if (!(configuration.nodeprecated && - Util.isDeprecated(classes[i].containingPackage()))) - ClassUseWriter.generate(configuration, mapper, classes[i]); + Util.isDeprecated(aClass.containingPackage()))) + ClassUseWriter.generate(configuration, mapper, aClass); } - PackageDoc[] pkgs = configuration.packages; - for (int i = 0; i < pkgs.length; i++) { + for (PackageDoc pkg : configuration.packages) { // If -nodeprecated option is set and the package is marked // as deprecated, do not generate the package-use page. - if (!(configuration.nodeprecated && Util.isDeprecated(pkgs[i]))) - PackageUseWriter.generate(configuration, mapper, pkgs[i]); + if (!(configuration.nodeprecated && Util.isDeprecated(pkg))) + PackageUseWriter.generate(configuration, mapper, pkg); } } @@ -183,9 +181,7 @@ List<? extends ProgramElementDoc> list= classMap.get(classdoc.qualifiedName()); if (list != null) { Collections.sort(list); - Iterator<? extends ProgramElementDoc> it = list.iterator(); - while (it.hasNext()) { - ProgramElementDoc doc = it.next(); + for (ProgramElementDoc doc : list) { PackageDoc pkg = doc.containingPackage(); pkgSet.add(pkg); List<ProgramElementDoc> inPkg = map.get(pkg.name()); @@ -336,13 +332,12 @@ protected void addClassList(Content contentTree) throws IOException { HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.addStyle(HtmlStyle.blockList); - for (Iterator<PackageDoc> it = pkgSet.iterator(); it.hasNext();) { - PackageDoc pkg = it.next(); + for (PackageDoc pkg : pkgSet) { Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name())); Content link = getResource("doclet.ClassUse_Uses.of.0.in.1", - getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, - classdoc)), - getPackageLink(pkg, Util.getPackageName(pkg))); + getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, + classdoc)), + getPackageLink(pkg, Util.getPackageName(pkg))); Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link); li.addContent(heading); addClassUse(pkg, li);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Tue Nov 10 02:47:05 2020 +0000 @@ -274,21 +274,20 @@ Type[] implIntfacs = classDoc.interfaceTypes(); if (implIntfacs != null && implIntfacs.length > 0) { int counter = 0; - for (int i = 0; i < implIntfacs.length; i++) { - ClassDoc classDoc = implIntfacs[i].asClassDoc(); - if (! (classDoc.isPublic() || - Util.isLinkable(classDoc, configuration))) { + for (Type implType : implIntfacs) { + ClassDoc classDoc = implType.asClassDoc(); + if (!(classDoc.isPublic() || Util.isLinkable(classDoc, configuration))) { continue; } if (counter == 0) { pre.addContent(DocletConstants.NL); - pre.addContent(isInterface? "extends " : "implements "); + pre.addContent(isInterface ? "extends " : "implements "); } else { pre.addContent(", "); } Content link = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME, - implIntfacs[i])); + LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME, + implType)); pre.addContent(link); counter++; }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java Tue Nov 10 02:47:05 2020 +0000 @@ -298,9 +298,9 @@ Map<String,PackageDoc> map = new HashMap<String,PackageDoc>(); PackageDoc pd; ClassDoc[] classes = root.classes(); - for (int i = 0; i < classes.length; i++) { - pd = classes[i].containingPackage(); - if(! map.containsKey(pd.name())) { + for (ClassDoc aClass : classes) { + pd = aClass.containingPackage(); + if (!map.containsKey(pd.name())) { map.put(pd.name(), pd); } } @@ -543,18 +543,17 @@ if (!nodeprecated) { return classarr[0]; } - for (int i = 0; i < classarr.length; i++) { - if (classarr[i].tags("deprecated").length == 0) { - return classarr[i]; + for (ClassDoc cd : classarr) { + if (cd.tags("deprecated").length == 0) { + return cd; } } return null; } protected boolean checkForDeprecation(RootDoc root) { - ClassDoc[] classarr = root.classes(); - for (int i = 0; i < classarr.length; i++) { - if (isGeneratedDoc(classarr[i])) { + for (ClassDoc cd : root.classes()) { + if (isGeneratedDoc(cd)) { return true; } }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java Tue Nov 10 02:47:05 2020 +0000 @@ -62,9 +62,8 @@ VisibleMemberMap visibleMemberMap = new VisibleMemberMap(classDoc, VisibleMemberMap.CONSTRUCTORS, configuration); List<ProgramElementDoc> constructors = new ArrayList<ProgramElementDoc>(visibleMemberMap.getMembersFor(classDoc)); - for (int i = 0; i < constructors.size(); i++) { - if ((constructors.get(i)).isProtected() || - (constructors.get(i)).isPrivate()) { + for (ProgramElementDoc constructor : constructors) { + if (constructor.isProtected() || constructor.isPrivate()) { setFoundNonPubConstructor(true); } }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -406,8 +406,8 @@ head.addContent(meta); } if (metakeywords != null) { - for (int i=0; i < metakeywords.length; i++) { - Content meta = HtmlTree.META("keywords", metakeywords[i]); + for (String metakeyword : metakeywords) { + Content meta = HtmlTree.META("keywords", metakeyword); head.addContent(meta); } } @@ -1010,9 +1010,8 @@ public Content getPackageLink(PackageDoc pkg, Content label) { boolean included = pkg != null && pkg.isIncluded(); if (! included) { - PackageDoc[] packages = configuration.packages; - for (int i = 0; i < packages.length; i++) { - if (packages[i].equals(pkg)) { + for (PackageDoc p : configuration.packages) { + if (p.equals(pkg)) { included = true; break; } @@ -1712,9 +1711,13 @@ //might be missing '>' character because the href has an inline tag. break; } - if (textBuff.substring(begin, end).indexOf("\"") != -1){ - begin = textBuff.indexOf("\"", begin) + 1; - end = textBuff.indexOf("\"", begin +1); + + String quote = textBuff.substring(begin, end); + quote = quote.contains("\"") ? "\"" : + quote.contains("\'") ? "\'" : null; + if (quote != null) { + begin = textBuff.indexOf(quote, begin) + 1; + end = textBuff.indexOf(quote, begin +1); if (begin == 0 || end == -1){ //Link is missing a quote. break; @@ -1945,15 +1948,15 @@ boolean isJava5DeclarationLocation) { List<Content> results = new ArrayList<Content>(); ContentBuilder annotation; - for (int i = 0; i < descList.length; i++) { - AnnotationTypeDoc annotationDoc = descList[i].annotationType(); + for (AnnotationDesc aDesc : descList) { + AnnotationTypeDoc annotationDoc = aDesc.annotationType(); // If an annotation is not documented, do not add it to the list. If // the annotation is of a repeatable type, and if it is not documented // and also if its container annotation is not documented, do not add it // to the list. If an annotation of a repeatable type is not documented // but its container is documented, it will be added to the list. - if (! Util.isDocumentedAnnotation(annotationDoc) && - (!isAnnotationDocumented && !isContainerDocumented)) { + if (!Util.isDocumentedAnnotation(annotationDoc) && + (!isAnnotationDocumented && !isContainerDocumented)) { continue; } /* TODO: check logic here to correctly handle declaration @@ -1964,12 +1967,12 @@ annotation = new ContentBuilder(); isAnnotationDocumented = false; LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.ANNOTATION, annotationDoc); - AnnotationDesc.ElementValuePair[] pairs = descList[i].elementValues(); + LinkInfoImpl.Kind.ANNOTATION, annotationDoc); + AnnotationDesc.ElementValuePair[] pairs = aDesc.elementValues(); // If the annotation is synthesized, do not print the container. - if (descList[i].isSynthesized()) { - for (int j = 0; j < pairs.length; j++) { - AnnotationValue annotationValue = pairs[j].value(); + if (aDesc.isSynthesized()) { + for (AnnotationDesc.ElementValuePair pair : pairs) { + AnnotationValue annotationValue = pair.value(); List<AnnotationValue> annotationTypeValues = new ArrayList<AnnotationValue>(); if (annotationValue.value() instanceof AnnotationValue[]) { AnnotationValue[] annotationArray = @@ -2006,12 +2009,12 @@ // repeatable type annotation is not documented, print the container. else { addAnnotations(annotationDoc, linkInfo, annotation, pairs, - indent, false); + indent, false); } } else { addAnnotations(annotationDoc, linkInfo, annotation, pairs, - indent, linkBreak); + indent, linkBreak); } annotation.addContent(linkBreak ? DocletConstants.NL : ""); results.add(annotation); @@ -2083,8 +2086,8 @@ */ private boolean isAnnotationArray(AnnotationDesc.ElementValuePair[] pairs) { AnnotationValue annotationValue; - for (int j = 0; j < pairs.length; j++) { - annotationValue = pairs[j].value(); + for (AnnotationDesc.ElementValuePair pair : pairs) { + annotationValue = pair.value(); if (annotationValue.value() instanceof AnnotationValue[]) { AnnotationValue[] annotationArray = (AnnotationValue[]) annotationValue.value();
--- a/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java Tue Nov 10 02:47:05 2020 +0000 @@ -342,8 +342,7 @@ ImplementedMethods implementedMethodsFinder = new ImplementedMethods(method, writer.configuration); MethodDoc[] implementedMethods = implementedMethodsFinder.build(); - for (int i = 0; i < implementedMethods.length; i++) { - MethodDoc implementedMeth = implementedMethods[i]; + for (MethodDoc implementedMeth : implementedMethods) { Type intfac = implementedMethodsFinder.getMethodHolder(implementedMeth); Content intfaclink = writer.getLink(new LinkInfoImpl( writer.configuration, LinkInfoImpl.Kind.METHOD_SPECIFIED_BY, intfac));
--- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -167,25 +167,24 @@ boolean printedHeader = false; HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.setTitle(labelContent); - for (int i = 0; i < arr.length; i++) { - if (documentedClasses != null && - !documentedClasses.contains(arr[i])) { + for (ClassDoc classDoc : arr) { + if (documentedClasses != null && !documentedClasses.contains(classDoc)) { continue; } - if (!Util.isCoreClass(arr[i]) || ! - configuration.isGeneratedDoc(arr[i])) { + if (!Util.isCoreClass(classDoc) || !configuration.isGeneratedDoc(classDoc)) { continue; } if (!printedHeader) { Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - true, labelContent); + true, labelContent); contentTree.addContent(heading); printedHeader = true; } - Content arr_i_name = new StringContent(arr[i].name()); - if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name); + Content arr_i_name = new StringContent(classDoc.name()); + if (classDoc.isInterface()) + arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name); Content link = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame")); + LinkInfoImpl.Kind.PACKAGE_FRAME, classDoc).label(arr_i_name).target("classFrame")); Content li = HtmlTree.LI(link); ul.addContent(li); }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -85,12 +85,12 @@ Content div = HtmlTree.DIV(HtmlStyle.indexContainer, heading); HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.setTitle(packagesLabel); - for(int i = 0; i < packages.length; i++) { + for (PackageDoc aPackage : packages) { // Do not list the package if -nodeprecated option is set and the // package is marked as deprecated. - if (packages[i] != null && - (!(configuration.nodeprecated && Util.isDeprecated(packages[i])))) { - ul.addContent(getPackage(packages[i])); + if (aPackage != null && + (!(configuration.nodeprecated && Util.isDeprecated(aPackage)))) { + ul.addContent(getPackage(aPackage)); } } div.addContent(ul);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -109,13 +109,12 @@ * @param body the documentation tree to which the index will be added */ protected void addIndex(Content body) { - for (int i = 0; i < groupList.size(); i++) { - String groupname = groupList.get(i); - List<PackageDoc> list = groupPackageMap.get(groupname); + for (String groupname : groupList) { + List<PackageDoc> list = groupPackageMap.get(groupname); if (list != null && list.size() > 0) { addIndexContents(list.toArray(new PackageDoc[list.size()]), - groupname, configuration.getText("doclet.Member_Table_Summary", - groupname, configuration.getText("doclet.packages")), body); + groupname, configuration.getText("doclet.Member_Table_Summary", + groupname, configuration.getText("doclet.packages")), body); } } }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -65,16 +65,13 @@ // by examining all classes in this package, find what packages // use these classes - produce a map between using package and // used classes. - ClassDoc[] content = pkgdoc.allClasses(); - for (int i = 0; i < content.length; ++i) { - ClassDoc usedClass = content[i]; + for (ClassDoc usedClass : pkgdoc.allClasses()) { Set<ClassDoc> usingClasses = mapper.classToClass.get(usedClass.qualifiedName()); if (usingClasses != null) { - for (Iterator<ClassDoc> it = usingClasses.iterator(); it.hasNext(); ) { - ClassDoc usingClass = it.next(); + for (ClassDoc usingClass : usingClasses) { PackageDoc usingPackage = usingClass.containingPackage(); Set<ClassDoc> usedClasses = usingPackageToUsedClasses - .get(usingPackage.name()); + .get(usingPackage.name()); if (usedClasses == null) { usedClasses = new TreeSet<ClassDoc>(); usingPackageToUsedClasses.put(Util.getPackageName(usingPackage), @@ -185,9 +182,7 @@ configuration.getText("doclet.Class"), configuration.getText("doclet.Description")) }; - Iterator<String> itp = usingPackageToUsedClasses.keySet().iterator(); - while (itp.hasNext()) { - String packageName = itp.next(); + for (String packageName : usingPackageToUsedClasses.keySet()) { PackageDoc usingPackage = configuration.root.packageNamed(packageName); HtmlTree li = new HtmlTree(HtmlTag.LI); li.addStyle(HtmlStyle.blockList); @@ -195,12 +190,12 @@ li.addContent(getMarkerAnchor(usingPackage.name())); } String tableSummary = configuration.getText("doclet.Use_Table_Summary", - configuration.getText("doclet.classes")); + configuration.getText("doclet.classes")); Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, tableSummary, - getTableCaption(configuration.getResource( - "doclet.ClassUse_Classes.in.0.used.by.1", - getPackageLink(pkgdoc, Util.getPackageName(pkgdoc)), - getPackageLink(usingPackage, Util.getPackageName(usingPackage))))); + getTableCaption(configuration.getResource( + "doclet.ClassUse_Classes.in.0.used.by.1", + getPackageLink(pkgdoc, Util.getPackageName(pkgdoc)), + getPackageLink(usingPackage, Util.getPackageName(usingPackage))))); table.addContent(getSummaryTableHeader(classTableHeader, "col")); Content tbody = new HtmlTree(HtmlTag.TBODY); Iterator<ClassDoc> itc =
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -159,24 +159,25 @@ boolean printedHeader = false; HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.setTitle(labelContent); - for (int i = 0; i < arr.length; i++) { - if (!isTypeInProfile(arr[i], profileValue)) { + for (ClassDoc classDoc : arr) { + if (!isTypeInProfile(classDoc, profileValue)) { continue; } - if (!Util.isCoreClass(arr[i]) || ! - configuration.isGeneratedDoc(arr[i])) { + if (!Util.isCoreClass(classDoc) || ! + configuration.isGeneratedDoc(classDoc)) { continue; } if (!printedHeader) { Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - true, labelContent); + true, labelContent); contentTree.addContent(heading); printedHeader = true; } - Content arr_i_name = new StringContent(arr[i].name()); - if (arr[i].isInterface()) arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name); + Content arr_i_name = new StringContent(classDoc.name()); + if (classDoc.isInterface()) + arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name); Content link = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.PACKAGE_FRAME, arr[i]).label(arr_i_name).target("classFrame")); + LinkInfoImpl.Kind.PACKAGE_FRAME, classDoc).label(arr_i_name).target("classFrame")); Content li = HtmlTree.LI(link); ul.addContent(li); }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -93,9 +93,9 @@ HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.setTitle(packagesLabel); PackageDoc[] packages = configuration.profilePackages.get(profileName); - for (int i = 0; i < packages.length; i++) { - if ((!(configuration.nodeprecated && Util.isDeprecated(packages[i])))) { - ul.addContent(getPackage(packages[i], profileName)); + for (PackageDoc packageDoc : packages) { + if ((!(configuration.nodeprecated && Util.isDeprecated(packageDoc)))) { + ul.addContent(getPackage(packageDoc, profileName)); } } div.addContent(ul);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ package com.sun.tools.doclets.formats.html; import java.io.*; +import java.util.*; import com.sun.javadoc.*; import com.sun.tools.doclets.formats.html.markup.*; import com.sun.tools.doclets.internal.toolkit.*; @@ -45,6 +46,8 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter implements SerializedFormWriter { + List<ClassDoc> visibleClasses; + /** * @param configuration the configuration data for the doclet * @throws IOException @@ -53,6 +56,7 @@ public SerializedFormWriterImpl(ConfigurationImpl configuration) throws IOException { super(configuration, DocPaths.SERIALIZED_FORM); + visibleClasses = Arrays.asList(configuration.root.classes()); } /** @@ -121,13 +125,23 @@ } /** + * Checks if a class is generated and is visible. + * + * @param classDoc the class being processed. + * @return true if the class, that is being processed, is generated and is visible. + */ + public boolean isVisibleClass(ClassDoc classDoc) { + return visibleClasses.contains(classDoc) && configuration.isGeneratedDoc(classDoc); + } + + /** * Get the serializable class heading. * * @param classDoc the class being processed * @return a content tree for the class header */ public Content getClassHeader(ClassDoc classDoc) { - Content classLink = (classDoc.isPublic() || classDoc.isProtected()) ? + Content classLink = (isVisibleClass(classDoc)) ? getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.DEFAULT, classDoc) .label(configuration.getClassName(classDoc))) : new StringContent(classDoc.qualifiedName());
--- a/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java Tue Nov 10 02:47:05 2020 +0000 @@ -95,21 +95,19 @@ if (rootDoc == null || outputdir == null) { return; } - PackageDoc[] pds = rootDoc.specifiedPackages(); - for (int i = 0; i < pds.length; i++) { + for (PackageDoc pd : rootDoc.specifiedPackages()) { // If -nodeprecated option is set and the package is marked as deprecated, // do not convert the package files to HTML. - if (!(configuration.nodeprecated && Util.isDeprecated(pds[i]))) - convertPackage(pds[i], outputdir); + if (!(configuration.nodeprecated && Util.isDeprecated(pd))) + convertPackage(pd, outputdir); } - ClassDoc[] cds = rootDoc.specifiedClasses(); - for (int i = 0; i < cds.length; i++) { + for (ClassDoc cd : rootDoc.specifiedClasses()) { // If -nodeprecated option is set and the class is marked as deprecated // or the containing package is deprecated, do not convert the // package files to HTML. if (!(configuration.nodeprecated && - (Util.isDeprecated(cds[i]) || Util.isDeprecated(cds[i].containingPackage())))) - convertClass(cds[i], outputdir); + (Util.isDeprecated(cd) || Util.isDeprecated(cd.containingPackage())))) + convertClass(cd, outputdir); } } @@ -123,14 +121,13 @@ if (pd == null) { return; } - ClassDoc[] cds = pd.allClasses(); - for (int i = 0; i < cds.length; i++) { + for (ClassDoc cd : pd.allClasses()) { // If -nodeprecated option is set and the class is marked as deprecated, // do not convert the package files to HTML. We do not check for // containing package deprecation since it is already check in // the calling method above. - if (!(configuration.nodeprecated && Util.isDeprecated(cds[i]))) - convertClass(cds[i], outputdir); + if (!(configuration.nodeprecated && Util.isDeprecated(cd))) + convertClass(cd, outputdir); } } @@ -161,7 +158,6 @@ return; r = new FileReader(file); } - LineNumberReader reader = new LineNumberReader(r); int lineno = 1; String line; relativePath = DocPaths.SOURCE_OUTPUT @@ -169,14 +165,12 @@ .invert(); Content body = getHeader(); Content pre = new HtmlTree(HtmlTag.PRE); - try { + try (LineNumberReader reader = new LineNumberReader(r)) { while ((line = reader.readLine()) != null) { addLineNo(pre, lineno); addLine(pre, line, lineno); lineno++; } - } finally { - reader.close(); } addBlankLines(pre); Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre); @@ -204,11 +198,8 @@ Content htmlDocument = new HtmlDocument(htmlDocType, htmlTree); configuration.message.notice("doclet.Generating_0", path.getPath()); DocFile df = DocFile.createFileForOutput(configuration, path); - Writer w = df.openWriter(); - try { + try (Writer w = df.openWriter()) { htmlDocument.write(w, true); - } finally { - w.close(); } }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -95,8 +95,8 @@ Content table = HtmlTree.TABLE(HtmlStyle.memberSummary, 0, 3, 0, mw.getTableSummary(), caption); table.addContent(getSummaryTableHeader(mw.getSummaryTableHeader(cd), "col")); - for (int i = 0; i < tableContents.size(); i++) { - table.addContent(tableContents.get(i)); + for (Content tableContent : tableContents) { + table.addContent(tableContent); } return table; }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java Tue Nov 10 02:47:05 2020 +0000 @@ -197,9 +197,9 @@ public Content seeTagOutput(Doc holder, SeeTag[] seeTags) { ContentBuilder body = new ContentBuilder(); if (seeTags.length > 0) { - for (int i = 0; i < seeTags.length; ++i) { + for (SeeTag seeTag : seeTags) { appendSeparatorIfNotEmpty(body); - body.addContent(htmlWriter.seeTagToContent(seeTags[i])); + body.addContent(htmlWriter.seeTagToContent(seeTag)); } } if (holder.isField() && ((FieldDoc)holder).constantValue() != null &&
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java Tue Nov 10 02:47:05 2020 +0000 @@ -196,10 +196,8 @@ } private static String encodeURL(String url) { - byte[] urlBytes = url.getBytes(Charset.forName("UTF-8")); StringBuilder sb = new StringBuilder(); - for (int i = 0; i < urlBytes.length; i++) { - int c = urlBytes[i]; + for (byte c : url.getBytes(Charset.forName("UTF-8"))) { if (NONENCODING_CHARS.get(c & 0xFF)) { sb.append((char) c); } else {
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java Tue Nov 10 02:47:05 2020 +0000 @@ -190,8 +190,8 @@ protected void generateClassFiles(RootDoc root, ClassTree classtree) { generateClassFiles(classtree); PackageDoc[] packages = root.specifiedPackages(); - for (int i = 0; i < packages.length; i++) { - generateClassFiles(packages[i].allClasses(), classtree); + for (PackageDoc pkg : packages) { + generateClassFiles(pkg.allClasses(), classtree); } } @@ -202,10 +202,9 @@ */ private void generateClassFiles(ClassTree classtree) { String[] packageNames = configuration.classDocCatalog.packageNames(); - for (int packageNameIndex = 0; packageNameIndex < packageNames.length; - packageNameIndex++) { + for (String packageName : packageNames) { generateClassFiles(configuration.classDocCatalog.allClasses( - packageNames[packageNameIndex]), classtree); + packageName), classtree); } } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java Tue Nov 10 02:47:05 2020 +0000 @@ -339,38 +339,39 @@ */ public int optionLength(String option) { option = StringUtils.toLowerCase(option); - if (option.equals("-author") || - option.equals("-docfilessubdirs") || - option.equals("-javafx") || - option.equals("-keywords") || - option.equals("-linksource") || - option.equals("-nocomment") || - option.equals("-nodeprecated") || - option.equals("-nosince") || - option.equals("-notimestamp") || - option.equals("-quiet") || - option.equals("-xnodate") || - option.equals("-version")) { - return 1; - } else if (option.equals("-d") || - option.equals("-docencoding") || - option.equals("-encoding") || - option.equals("-excludedocfilessubdir") || - option.equals("-link") || - option.equals("-sourcetab") || - option.equals("-noqualifier") || - option.equals("-output") || - option.equals("-sourcepath") || - option.equals("-tag") || - option.equals("-taglet") || - option.equals("-tagletpath") || - option.equals("-xprofilespath")) { - return 2; - } else if (option.equals("-group") || - option.equals("-linkoffline")) { - return 3; - } else { - return -1; // indicate we don't know about it + switch (option) { + case "-author": + case "-docfilessubdirs": + case "-javafx": + case "-keywords": + case "-linksource": + case "-nocomment": + case "-nodeprecated": + case "-nosince": + case "-notimestamp": + case "-quiet": + case "-xnodate": + case "-version": + return 1; + case "-d": + case "-docencoding": + case "-encoding": + case "-excludedocfilessubdir": + case "-link": + case "-sourcetab": + case "-noqualifier": + case "-output": + case "-sourcepath": + case "-tag": + case "-taglet": + case "-tagletpath": + case "-xprofilespath": + return 2; + case "-group": + case "-linkoffline": + return 3; + default: + return -1; // indicate we don't know about it } } @@ -434,9 +435,8 @@ private void initPackageArray() { Set<PackageDoc> set = new HashSet<PackageDoc>(Arrays.asList(root.specifiedPackages())); - ClassDoc[] classes = root.specifiedClasses(); - for (int i = 0; i < classes.length; i++) { - set.add(classes[i].containingPackage()); + for (ClassDoc aClass : root.specifiedClasses()) { + set.add(aClass.containingPackage()); } ArrayList<PackageDoc> results = new ArrayList<PackageDoc>(set); Collections.sort(results); @@ -453,8 +453,7 @@ // Some options, specifically -link and -linkoffline, require that // the output directory has already been created: so do that first. - for (int oi = 0; oi < options.length; ++oi) { - String[] os = options[oi]; + for (String[] os : options) { String opt = StringUtils.toLowerCase(os[0]); if (opt.equals("-d")) { destDirName = addTrailingFileSep(os[1]); @@ -464,8 +463,7 @@ } } - for (int oi = 0; oi < options.length; ++oi) { - String[] os = options[oi]; + for (String[] os : options) { String opt = StringUtils.toLowerCase(os[0]); if (opt.equals("-docfilessubdirs")) { copydocfilesubdirs = true; @@ -588,15 +586,13 @@ tagletManager = tagletManager == null ? new TagletManager(nosince, showversion, showauthor, javafx, message) : tagletManager; - String[] args; - for (Iterator<String[]> it = customTagStrs.iterator(); it.hasNext(); ) { - args = it.next(); + for (String[] args : customTagStrs) { if (args[0].equals("-taglet")) { tagletManager.addCustomTag(args[1], getFileManager(), tagletpath); continue; } String[] tokens = tokenize(args[1], - TagletManager.SIMPLE_TAGLET_OPT_SEPARATOR, 3); + TagletManager.SIMPLE_TAGLET_OPT_SEPARATOR, 3); if (tokens.length == 1) { String tagName = args[1]; if (tagletManager.isKnownCustomTag(tagName)) {
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java Tue Nov 10 02:47:05 2020 +0000 @@ -151,13 +151,12 @@ */ public void buildContents(XMLNode node, Content contentTree) { Content contentListTree = writer.getContentsHeader(); - PackageDoc[] packages = configuration.packages; printedPackageHeaders = new HashSet<String>(); - for (int i = 0; i < packages.length; i++) { - if (hasConstantField(packages[i]) && ! hasPrintedPackageIndex(packages[i].name())) { - writer.addLinkToPackageContent(packages[i], - parsePackageName(packages[i].name()), - printedPackageHeaders, contentListTree); + for (PackageDoc pkg : configuration.packages) { + if (hasConstantField(pkg) && !hasPrintedPackageIndex(pkg.name())) { + writer.addLinkToPackageContent(pkg, + parsePackageName(pkg.name()), + printedPackageHeaders, contentListTree); } } contentTree.addContent(writer.getContentsList(contentListTree)); @@ -170,12 +169,11 @@ * @param contentTree the tree to which the summaries will be added */ public void buildConstantSummaries(XMLNode node, Content contentTree) { - PackageDoc[] packages = configuration.packages; printedPackageHeaders = new HashSet<String>(); Content summariesTree = writer.getConstantSummaries(); - for (int i = 0; i < packages.length; i++) { - if (hasConstantField(packages[i])) { - currentPackage = packages[i]; + for (PackageDoc aPackage : configuration.packages) { + if (hasConstantField(aPackage)) { + currentPackage = aPackage; //Build the documentation for the current package. buildChildren(node, summariesTree); } @@ -211,12 +209,12 @@ DocletConstants.DEFAULT_PACKAGE_NAME); Arrays.sort(classes); Content classConstantTree = writer.getClassConstantHeader(); - for (int i = 0; i < classes.length; i++) { - if (! classDocsWithConstFields.contains(classes[i]) || - ! classes[i].isIncluded()) { + for (ClassDoc doc : classes) { + if (!classDocsWithConstFields.contains(doc) || + !doc.isIncluded()) { continue; } - currentClass = classes[i]; + currentClass = doc; //Build the documentation for the current class. buildChildren(node, classConstantTree); } @@ -241,16 +239,13 @@ * @return true if the given package has constant fields to document. */ private boolean hasConstantField(PackageDoc pkg) { - ClassDoc[] classes; - if (pkg.name().length() > 0) { - classes = pkg.allClasses(); - } else { - classes = configuration.classDocCatalog.allClasses( - DocletConstants.DEFAULT_PACKAGE_NAME); - } + ClassDoc[] classes + = (pkg.name().length() > 0) + ? pkg.allClasses() + : configuration.classDocCatalog.allClasses(DocletConstants.DEFAULT_PACKAGE_NAME); boolean found = false; - for (int j = 0; j < classes.length; j++){ - if (classes[j].isIncluded() && hasConstantField(classes[j])) { + for (ClassDoc doc : classes) { + if (doc.isIncluded() && hasConstantField(doc)) { found = true; } } @@ -267,8 +262,8 @@ VisibleMemberMap visibleMemberMapFields = new VisibleMemberMap(classDoc, VisibleMemberMap.FIELDS, configuration); List<?> fields = visibleMemberMapFields.getLeafClassMembers(configuration); - for (Iterator<?> iter = fields.iterator(); iter.hasNext(); ) { - FieldDoc field = (FieldDoc) iter.next(); + for (Object f : fields) { + FieldDoc field = (FieldDoc) f; if (field.constantValueExpression() != null) { classDocsWithConstFields.add(classDoc); return true; @@ -285,8 +280,8 @@ */ private boolean hasPrintedPackageIndex(String pkgname) { String[] list = printedPackageHeaders.toArray(new String[] {}); - for (int i = 0; i < list.length; i++) { - if (pkgname.startsWith(list[i])) { + for (String packageHeader : list) { + if (pkgname.startsWith(packageHeader)) { return true; } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java Tue Nov 10 02:47:05 2020 +0000 @@ -96,9 +96,8 @@ configuration); constructors = new ArrayList<ProgramElementDoc>(visibleMemberMap.getMembersFor(classDoc)); - for (int i = 0; i < constructors.size(); i++) { - if (constructors.get(i).isProtected() - || constructors.get(i).isPrivate()) { + for (ProgramElementDoc constructor : constructors) { + if (constructor.isProtected() || constructor.isPrivate()) { writer.setFoundNonPubConstructor(true); } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java Tue Nov 10 02:47:05 2020 +0000 @@ -475,11 +475,9 @@ */ private void buildInheritedSummary(MemberSummaryWriter writer, VisibleMemberMap visibleMemberMap, LinkedList<Content> summaryTreeList) { - for (Iterator<ClassDoc> iter = visibleMemberMap.getVisibleClassesList().iterator(); - iter.hasNext();) { - ClassDoc inhclass = iter.next(); - if (! (inhclass.isPublic() || - Util.isLinkable(inhclass, configuration))) { + for (ClassDoc inhclass : visibleMemberMap.getVisibleClassesList()) { + if (!(inhclass.isPublic() || + Util.isLinkable(inhclass, configuration))) { continue; } if (inhclass == classDoc) { @@ -493,7 +491,7 @@ for (int j = 0; j < inhmembers.size(); ++j) { writer.addInheritedMemberSummary( inhclass.isPackagePrivate() && - ! Util.isLinkable(inhclass, configuration) ? + !Util.isLinkable(inhclass, configuration) ? classDoc : inhclass, inhmembers.get(j), j == 0, @@ -523,8 +521,8 @@ if (!summaryTreeList.isEmpty()) { Content memberTree = writer.getMemberSummaryHeader( classDoc, memberSummaryTree); - for (int i = 0; i < summaryTreeList.size(); i++) { - memberTree.addContent(summaryTreeList.get(i)); + for (Content aSummaryTreeList : summaryTreeList) { + memberTree.addContent(aSummaryTreeList); } memberSummaryTree.addContent(writer.getMemberTree(memberTree)); }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java Tue Nov 10 02:47:05 2020 +0000 @@ -166,8 +166,8 @@ */ public void buildPackageSummary(XMLNode node, Content summaryContentTree) { PackageDoc[] packages = configuration.profilePackages.get(profile.name); - for (int i = 0; i < packages.length; i++) { - this.pkg = packages[i]; + for (PackageDoc aPackage : packages) { + this.pkg = aPackage; Content packageSummaryContentTree = profileWriter.getPackageSummaryHeader(this.pkg); buildChildren(node, packageSummaryContentTree); summaryContentTree.addContent(profileWriter.getPackageSummaryTree(
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java Tue Nov 10 02:47:05 2020 +0000 @@ -162,9 +162,8 @@ */ public void buildSerializedFormSummaries(XMLNode node, Content serializedTree) { Content serializedSummariesTree = writer.getSerializedSummariesHeader(); - PackageDoc[] packages = configuration.packages; - for (int i = 0; i < packages.length; i++) { - currentPackage = packages[i]; + for (PackageDoc pkg : configuration.packages) { + currentPackage = pkg; buildChildren(node, serializedSummariesTree); } serializedTree.addContent(writer.getSerializedContent( @@ -215,12 +214,12 @@ Content classSerializedTree = writer.getClassSerializedHeader(); ClassDoc[] classes = currentPackage.allClasses(false); Arrays.sort(classes); - for (int j = 0; j < classes.length; j++) { - currentClass = classes[j]; + for (ClassDoc classDoc : classes) { + currentClass = classDoc; fieldWriter = writer.getSerialFieldWriter(currentClass); methodWriter = writer.getSerialMethodWriter(currentClass); - if(currentClass.isClass() && currentClass.isSerializable()) { - if(!serialClassInclude(currentClass)) { + if (currentClass.isClass() && currentClass.isSerializable()) { + if (!serialClassInclude(currentClass)) { continue; } Content classTree = writer.getClassHeader(currentClass); @@ -239,12 +238,11 @@ */ public void buildSerialUIDInfo(XMLNode node, Content classTree) { Content serialUidTree = writer.getSerialUIDInfoHeader(); - FieldDoc[] fields = currentClass.fields(false); - for (int i = 0; i < fields.length; i++) { - if (fields[i].name().equals("serialVersionUID") && - fields[i].constantValueExpression() != null) { + for (FieldDoc field : currentClass.fields(false)) { + if (field.name().equals("serialVersionUID") && + field.constantValueExpression() != null) { writer.addSerialUIDInfo(SERIAL_VERSION_UID_HEADER, - fields[i].constantValueExpression(), serialUidTree); + field.constantValueExpression(), serialUidTree); break; } } @@ -569,9 +567,9 @@ Tag[] serial = doc.tags("serial"); if (serial.length > 0) { String serialtext = StringUtils.toLowerCase(serial[0].text()); - if (serialtext.indexOf("exclude") >= 0) { + if (serialtext.contains("exclude")) { return false; - } else if (serialtext.indexOf("include") >= 0) { + } else if (serialtext.contains("include")) { return true; } } @@ -585,8 +583,8 @@ * @return true if any of the given classes have a @serialinclude tag. */ private boolean serialClassFoundToDocument(ClassDoc[] classes) { - for (int i = 0; i < classes.length; i++) { - if (serialClassInclude(classes[i])) { + for (ClassDoc aClass : classes) { + if (serialClassInclude(aClass)) { return true; } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java Tue Nov 10 02:47:05 2020 +0000 @@ -106,13 +106,13 @@ Map<String, String> rankMap = getRankMap(input.isTypeVariableParamTag ? (Object[]) ((MethodDoc)input.element).typeParameters() : (Object[]) ((MethodDoc)input.element).parameters()); - for (int i = 0; i < tags.length; i++) { - if (rankMap.containsKey(tags[i].parameterName()) && - rankMap.get(tags[i].parameterName()).equals((input.tagId))) { + for (ParamTag tag : tags) { + if (rankMap.containsKey(tag.parameterName()) && + rankMap.get(tag.parameterName()).equals((input.tagId))) { output.holder = input.element; - output.holderTag = tags[i]; + output.holderTag = tag; output.inlineTags = input.isFirstSentence ? - tags[i].firstSentenceTags() : tags[i].inlineTags(); + tag.firstSentenceTags() : tag.inlineTags(); return; } } @@ -269,27 +269,26 @@ Set<String> alreadyDocumented) { Content result = writer.getOutputInstance(); if (paramTags.length > 0) { - for (int i = 0; i < paramTags.length; ++i) { - ParamTag pt = paramTags[i]; + for (ParamTag pt : paramTags) { String paramName = isNonTypeParams ? - pt.parameterName() : "<" + pt.parameterName() + ">"; - if (! rankMap.containsKey(pt.parameterName())) { + pt.parameterName() : "<" + pt.parameterName() + ">"; + if (!rankMap.containsKey(pt.parameterName())) { writer.getMsgRetriever().warning(pt.position(), - isNonTypeParams ? - "doclet.Parameters_warn" : - "doclet.Type_Parameters_warn", - paramName); + isNonTypeParams ? + "doclet.Parameters_warn" : + "doclet.Type_Parameters_warn", + paramName); } String rank = rankMap.get(pt.parameterName()); if (rank != null && alreadyDocumented.contains(rank)) { writer.getMsgRetriever().warning(pt.position(), - isNonTypeParams ? - "doclet.Parameters_dup_warn" : - "doclet.Type_Parameters_dup_warn", - paramName); + isNonTypeParams ? + "doclet.Parameters_dup_warn" : + "doclet.Type_Parameters_dup_warn", + paramName); } result.addContent(processParamTag(isNonTypeParams, writer, pt, - pt.parameterName(), alreadyDocumented.size() == 0)); + pt.parameterName(), alreadyDocumented.size() == 0)); alreadyDocumented.add(rank); } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/SimpleTaglet.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/SimpleTaglet.java Tue Nov 10 02:47:05 2020 +0000 @@ -112,7 +112,7 @@ this.tagName = tagName; this.header = header; locations = StringUtils.toLowerCase(locations); - if (locations.indexOf(ALL) != -1 && locations.indexOf(EXCLUDED) == -1) { + if (locations.contains(ALL) && !locations.contains(EXCLUDED)) { this.locations = PACKAGE + TYPE + FIELD + METHOD + CONSTRUCTOR + OVERVIEW; } else { this.locations = locations; @@ -134,7 +134,7 @@ * otherwise. */ public boolean inConstructor() { - return locations.indexOf(CONSTRUCTOR) != -1 && locations.indexOf(EXCLUDED) == -1; + return locations.contains(CONSTRUCTOR) && !locations.contains(EXCLUDED); } /** @@ -145,7 +145,7 @@ * otherwise. */ public boolean inField() { - return locations.indexOf(FIELD) != -1 && locations.indexOf(EXCLUDED) == -1; + return locations.contains(FIELD) && !locations.contains(EXCLUDED); } /** @@ -156,7 +156,7 @@ * otherwise. */ public boolean inMethod() { - return locations.indexOf(METHOD) != -1 && locations.indexOf(EXCLUDED) == -1; + return locations.contains(METHOD) && !locations.contains(EXCLUDED); } /** @@ -167,7 +167,7 @@ * otherwise. */ public boolean inOverview() { - return locations.indexOf(OVERVIEW) != -1 && locations.indexOf(EXCLUDED) == -1; + return locations.contains(OVERVIEW) && !locations.contains(EXCLUDED); } /** @@ -178,7 +178,7 @@ * otherwise. */ public boolean inPackage() { - return locations.indexOf(PACKAGE) != -1 && locations.indexOf(EXCLUDED) == -1; + return locations.contains(PACKAGE) && !locations.contains(EXCLUDED); } /** @@ -189,7 +189,7 @@ * otherwise. */ public boolean inType() { - return locations.indexOf(TYPE) != -1&& locations.indexOf(EXCLUDED) == -1; + return locations.contains(TYPE) && !locations.contains(EXCLUDED); } /**
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java Tue Nov 10 02:47:05 2020 +0000 @@ -370,37 +370,37 @@ return; } Taglet taglet; - for (int i = 0; i < tags.length; i++) { - String name = tags[i].name(); + for (Tag tag : tags) { + String name = tag.name(); if (name.length() > 0 && name.charAt(0) == '@') { name = name.substring(1, name.length()); } if (! (standardTags.contains(name) || customTags.containsKey(name))) { if (standardTagsLowercase.contains(StringUtils.toLowerCase(name))) { - message.warning(tags[i].position(), "doclet.UnknownTagLowercase", tags[i].name()); + message.warning(tag.position(), "doclet.UnknownTagLowercase", tag.name()); continue; } else { - message.warning(tags[i].position(), "doclet.UnknownTag", tags[i].name()); + message.warning(tag.position(), "doclet.UnknownTag", tag.name()); continue; } } //Check if this tag is being used in the wrong location. if ((taglet = customTags.get(name)) != null) { if (areInlineTags && ! taglet.isInlineTag()) { - printTagMisuseWarn(taglet, tags[i], "inline"); + printTagMisuseWarn(taglet, tag, "inline"); } if ((doc instanceof RootDoc) && ! taglet.inOverview()) { - printTagMisuseWarn(taglet, tags[i], "overview"); + printTagMisuseWarn(taglet, tag, "overview"); } else if ((doc instanceof PackageDoc) && ! taglet.inPackage()) { - printTagMisuseWarn(taglet, tags[i], "package"); + printTagMisuseWarn(taglet, tag, "package"); } else if ((doc instanceof ClassDoc) && ! taglet.inType()) { - printTagMisuseWarn(taglet, tags[i], "class"); + printTagMisuseWarn(taglet, tag, "class"); } else if ((doc instanceof ConstructorDoc) && ! taglet.inConstructor()) { - printTagMisuseWarn(taglet, tags[i], "constructor"); + printTagMisuseWarn(taglet, tag, "constructor"); } else if ((doc instanceof FieldDoc) && ! taglet.inField()) { - printTagMisuseWarn(taglet, tags[i], "field"); + printTagMisuseWarn(taglet, tag, "field"); } else if ((doc instanceof MethodDoc) && ! taglet.inMethod()) { - printTagMisuseWarn(taglet, tags[i], "method"); + printTagMisuseWarn(taglet, tag, "method"); } } } @@ -707,9 +707,8 @@ * Initialize lowercase version of standard Javadoc tags. */ private void initStandardTagsLowercase() { - Iterator<String> it = standardTags.iterator(); - while (it.hasNext()) { - standardTagsLowercase.add(StringUtils.toLowerCase(it.next())); + for (String standardTag : standardTags) { + standardTagsLowercase.add(StringUtils.toLowerCase(standardTag)); } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -204,30 +204,30 @@ tagletManager.checkTags(doc, doc.tags(), false); tagletManager.checkTags(doc, doc.inlineTags(), true); Content currentOutput = null; - for (int i = 0; i < taglets.length; i++) { + for (Taglet taglet : taglets) { currentOutput = null; - if (doc instanceof ClassDoc && taglets[i] instanceof ParamTaglet) { + if (doc instanceof ClassDoc && taglet instanceof ParamTaglet) { //The type parameters are documented in a special section away //from the tag info, so skip here. continue; } - if (taglets[i] instanceof DeprecatedTaglet) { + if (taglet instanceof DeprecatedTaglet) { //Deprecated information is documented "inline", not in tag info //section. continue; } try { - currentOutput = taglets[i].getTagletOutput(doc, writer); + currentOutput = taglet.getTagletOutput(doc, writer); } catch (IllegalArgumentException e) { //The taglet does not take a member as an argument. Let's try //a single tag. - Tag[] tags = doc.tags(taglets[i].getName()); + Tag[] tags = doc.tags(taglet.getName()); if (tags.length > 0) { - currentOutput = taglets[i].getTagletOutput(tags[0], writer); + currentOutput = taglet.getTagletOutput(tags[0], writer); } } if (currentOutput != null) { - tagletManager.seenCustomTag(taglets[i].getName()); + tagletManager.seenCustomTag(taglet.getName()); output.addContent(currentOutput); } } @@ -246,15 +246,15 @@ Tag holderTag, Tag inlineTag, TagletWriter tagletWriter) { Taglet[] definedTags = tagletManager.getInlineCustomTaglets(); //This is a custom inline tag. - for (int j = 0; j < definedTags.length; j++) { - if (("@"+definedTags[j].getName()).equals(inlineTag.name())) { + for (Taglet definedTag : definedTags) { + if (("@" + definedTag.getName()).equals(inlineTag.name())) { //Given a name of a seen custom tag, remove it from the // set of unseen custom tags. - tagletManager.seenCustomTag(definedTags[j].getName()); - Content output = definedTags[j].getTagletOutput( - holderTag != null && - definedTags[j].getName().equals("inheritDoc") ? - holderTag : inlineTag, tagletWriter); + tagletManager.seenCustomTag(definedTag.getName()); + Content output = definedTag.getTagletOutput( + holderTag != null && + definedTag.getName().equals("inheritDoc") ? + holderTag : inlineTag, tagletWriter); return output; } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ThrowsTaglet.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ThrowsTaglet.java Tue Nov 10 02:47:05 2020 +0000 @@ -64,19 +64,18 @@ exception = input.element.containingClass().findClass(input.tagId); } - ThrowsTag[] tags = ((MethodDoc)input.element).throwsTags(); - for (int i = 0; i < tags.length; i++) { - if (input.tagId.equals(tags[i].exceptionName()) || - (tags[i].exception() != null && - (input.tagId.equals(tags[i].exception().qualifiedName())))) { + for (ThrowsTag tag : ((MethodDoc)input.element).throwsTags()) { + if (input.tagId.equals(tag.exceptionName()) || + (tag.exception() != null && + (input.tagId.equals(tag.exception().qualifiedName())))) { output.holder = input.element; - output.holderTag = tags[i]; + output.holderTag = tag; output.inlineTags = input.isFirstSentence ? - tags[i].firstSentenceTags() : tags[i].inlineTags(); - output.tagList.add(tags[i]); - } else if (exception != null && tags[i].exception() != null && - tags[i].exception().subclassOf(exception)) { - output.tagList.add(tags[i]); + tag.firstSentenceTags() : tag.inlineTags(); + output.tagList.add(tag); + } else if (exception != null && tag.exception() != null && + tag.exception().subclassOf(exception)) { + output.tagList.add(tag); } } } @@ -89,17 +88,17 @@ TagletWriter writer) { Content result = writer.getOutputInstance(); //Add links to the exceptions declared but not documented. - for (int i = 0; i < declaredExceptionTypes.length; i++) { - if (declaredExceptionTypes[i].asClassDoc() != null && - ! alreadyDocumented.contains( - declaredExceptionTypes[i].asClassDoc().name()) && - ! alreadyDocumented.contains( - declaredExceptionTypes[i].asClassDoc().qualifiedName())) { + for (Type declaredExceptionType : declaredExceptionTypes) { + if (declaredExceptionType.asClassDoc() != null && + !alreadyDocumented.contains( + declaredExceptionType.asClassDoc().name()) && + !alreadyDocumented.contains( + declaredExceptionType.asClassDoc().qualifiedName())) { if (alreadyDocumented.size() == 0) { result.addContent(writer.getThrowsHeader()); } - result.addContent(writer.throwsTagOutput(declaredExceptionTypes[i])); - alreadyDocumented.add(declaredExceptionTypes[i].asClassDoc().name()); + result.addContent(writer.throwsTagOutput(declaredExceptionType)); + alreadyDocumented.add(declaredExceptionType.asClassDoc().name()); } } return result; @@ -115,14 +114,14 @@ Content result = writer.getOutputInstance(); if (holder instanceof MethodDoc) { Set<Tag> declaredExceptionTags = new LinkedHashSet<Tag>(); - for (int j = 0; j < declaredExceptionTypes.length; j++) { + for (Type declaredExceptionType : declaredExceptionTypes) { DocFinder.Output inheritedDoc = - DocFinder.search(new DocFinder.Input((MethodDoc) holder, this, - declaredExceptionTypes[j].typeName())); + DocFinder.search(new DocFinder.Input((MethodDoc) holder, this, + declaredExceptionType.typeName())); if (inheritedDoc.tagList.size() == 0) { inheritedDoc = DocFinder.search(new DocFinder.Input( - (MethodDoc) holder, this, - declaredExceptionTypes[j].qualifiedTypeName())); + (MethodDoc) holder, this, + declaredExceptionType.qualifiedTypeName())); } declaredExceptionTags.addAll(inheritedDoc.tagList); } @@ -167,11 +166,10 @@ TagletWriter writer, Set<String> alreadyDocumented, boolean allowDups) { Content result = writer.getOutputInstance(); if (throwTags.length > 0) { - for (int i = 0; i < throwTags.length; ++i) { - ThrowsTag tt = throwTags[i]; + for (ThrowsTag tt : throwTags) { ClassDoc cd = tt.exception(); if ((!allowDups) && (alreadyDocumented.contains(tt.exceptionName()) || - (cd != null && alreadyDocumented.contains(cd.qualifiedName())))) { + (cd != null && alreadyDocumented.contains(cd.qualifiedName())))) { continue; } if (alreadyDocumented.size() == 0) { @@ -179,7 +177,7 @@ } result.addContent(writer.throwsTagOutput(tt)); alreadyDocumented.add(cd != null ? - cd.qualifiedName() : tt.exceptionName()); + cd.qualifiedName() : tt.exceptionName()); } } return result;
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ValueTaglet.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ValueTaglet.java Tue Nov 10 02:47:05 2020 +0000 @@ -150,10 +150,9 @@ if (cd == null) { return null; } - FieldDoc[] fields = cd.fields(); - for (int i = 0; i < fields.length; i++) { - if (fields[i].name().equals(memberName)) { - return fields[i]; + for (FieldDoc field : cd.fields()) { + if (field.name().equals(memberName)) { + return field; } } return null;
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java Tue Nov 10 02:47:05 2020 +0000 @@ -100,8 +100,8 @@ public ClassDocCatalog (ClassDoc[] classdocs, Configuration config) { init(); this.configuration = config; - for (int i = 0; i < classdocs.length; i++) { - addClassDoc(classdocs[i]); + for (ClassDoc classdoc : classdocs) { + addClassDoc(classdoc); } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java Tue Nov 10 02:47:05 2020 +0000 @@ -123,43 +123,43 @@ * @param configuration the current configuration of the doclet. */ private void buildTree(ClassDoc[] classes, Configuration configuration) { - for (int i = 0; i < classes.length; i++) { + for (ClassDoc aClass : classes) { // In the tree page (e.g overview-tree.html) do not include // information of classes which are deprecated or are a part of a // deprecated package. if (configuration.nodeprecated && - (Util.isDeprecated(classes[i]) || - Util.isDeprecated(classes[i].containingPackage()))) { + (Util.isDeprecated(aClass) || + Util.isDeprecated(aClass.containingPackage()))) { continue; } if (configuration.javafx - && classes[i].tags("treatAsPrivate").length > 0) { + && aClass.tags("treatAsPrivate").length > 0) { continue; } - if (classes[i].isEnum()) { - processType(classes[i], configuration, baseEnums, subEnums); - } else if (classes[i].isClass()) { - processType(classes[i], configuration, baseclasses, subclasses); - } else if (classes[i].isInterface()) { - processInterface(classes[i]); - List<ClassDoc> list = implementingclasses.get(classes[i]); + if (aClass.isEnum()) { + processType(aClass, configuration, baseEnums, subEnums); + } else if (aClass.isClass()) { + processType(aClass, configuration, baseclasses, subclasses); + } else if (aClass.isInterface()) { + processInterface(aClass); + List<ClassDoc> list = implementingclasses.get(aClass); if (list != null) { Collections.sort(list); } - } else if (classes[i].isAnnotationType()) { - processType(classes[i], configuration, baseAnnotationTypes, + } else if (aClass.isAnnotationType()) { + processType(aClass, configuration, baseAnnotationTypes, subAnnotationTypes); } } Collections.sort(baseinterfaces); - for (Iterator<List<ClassDoc>> it = subinterfaces.values().iterator(); it.hasNext(); ) { - Collections.sort(it.next()); + for (List<ClassDoc> docs : subinterfaces.values()) { + Collections.sort(docs); } - for (Iterator<List<ClassDoc>> it = subclasses.values().iterator(); it.hasNext(); ) { - Collections.sort(it.next()); + for (List<ClassDoc> docs : subclasses.values()) { + Collections.sort(docs); } } @@ -190,8 +190,8 @@ } } List<Type> intfacs = Util.getAllInterfaces(cd, configuration); - for (Iterator<Type> iter = intfacs.iterator(); iter.hasNext();) { - add(implementingclasses, iter.next().asClassDoc(), cd); + for (Type intfac : intfacs) { + add(implementingclasses, intfac.asClassDoc(), cd); } } @@ -206,11 +206,11 @@ private void processInterface(ClassDoc cd) { ClassDoc[] intfacs = cd.interfaces(); if (intfacs.length > 0) { - for (int i = 0; i < intfacs.length; i++) { - if (!add(subinterfaces, intfacs[i], cd)) { + for (ClassDoc intfac : intfacs) { + if (!add(subinterfaces, intfac, cd)) { return; } else { - processInterface(intfacs[i]); // Recurse + processInterface(intfac); // Recurse } } } else { @@ -341,8 +341,7 @@ for (int i = 0; i < list.size(); i++) { cd = list.get(i); List<ClassDoc> tlist = subs(cd, isEnum); - for (int j = 0; j < tlist.size(); j++) { - ClassDoc tcd = tlist.get(j); + for (ClassDoc tcd : tlist) { if (!list.contains(tcd)) { list.add(tcd); }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassUseMapper.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassUseMapper.java Tue Nov 10 02:47:05 2020 +0000 @@ -186,44 +186,42 @@ this.classtree = classtree; // Map subclassing, subinterfacing implementing, ... - for (Iterator<ClassDoc> it = classtree.baseclasses().iterator(); it.hasNext();) { - subclasses(it.next()); + for (ClassDoc doc : classtree.baseclasses()) { + subclasses(doc); } - for (Iterator<ClassDoc> it = classtree.baseinterfaces().iterator(); it.hasNext();) { + for (ClassDoc doc : classtree.baseinterfaces()) { // does subinterfacing as side-effect - implementingClasses(it.next()); + implementingClasses(doc); } // Map methods, fields, constructors using a class. ClassDoc[] classes = root.classes(); - for (int i = 0; i < classes.length; i++) { - PackageDoc pkg = classes[i].containingPackage(); + for (ClassDoc aClass : classes) { + PackageDoc pkg = aClass.containingPackage(); mapAnnotations(classToPackageAnnotations, pkg, pkg); - ClassDoc cd = classes[i]; + ClassDoc cd = aClass; mapTypeParameters(classToClassTypeParam, cd, cd); mapAnnotations(classToClassAnnotations, cd, cd); FieldDoc[] fields = cd.fields(); - for (int j = 0; j < fields.length; j++) { - FieldDoc fd = fields[j]; + for (FieldDoc fd : fields) { mapTypeParameters(classToFieldDocTypeParam, fd, fd); mapAnnotations(annotationToFieldDoc, fd, fd); - if (! fd.type().isPrimitive()) { + if (!fd.type().isPrimitive()) { add(classToField, fd.type().asClassDoc(), fd); } } ConstructorDoc[] cons = cd.constructors(); - for (int j = 0; j < cons.length; j++) { - mapAnnotations(classToConstructorAnnotations, cons[j], cons[j]); - mapExecutable(cons[j]); + for (ConstructorDoc con : cons) { + mapAnnotations(classToConstructorAnnotations, con, con); + mapExecutable(con); } MethodDoc[] meths = cd.methods(); - for (int j = 0; j < meths.length; j++) { - MethodDoc md = meths[j]; + for (MethodDoc md : meths) { mapExecutable(md); mapTypeParameters(classToExecMemberDocTypeParam, md, md); mapAnnotations(classToExecMemberDocAnnotations, md, md); - if (! (md.returnType().isPrimitive() || md.returnType() instanceof TypeVariable)) { + if (!(md.returnType().isPrimitive() || md.returnType() instanceof TypeVariable)) { mapTypeParameters(classToExecMemberDocReturnTypeParam, - md.returnType(), md); + md.returnType(), md); add(classToMethodReturn, md.returnType().asClassDoc(), md); } } @@ -240,8 +238,8 @@ List<ClassDoc> subs = classtree.subclasses(cd); if (subs != null) { ret.addAll(subs); - for (Iterator<ClassDoc> it = subs.iterator(); it.hasNext();) { - ret.addAll(subclasses(it.next())); + for (ClassDoc sub : subs) { + ret.addAll(subclasses(sub)); } } addAll(classToSubclass, cd, ret); @@ -259,8 +257,8 @@ List<ClassDoc> subs = classtree.subinterfaces(cd); if (subs != null) { ret.addAll(subs); - for (Iterator<ClassDoc> it = subs.iterator(); it.hasNext();) { - ret.addAll(subinterfaces(it.next())); + for (ClassDoc sub : subs) { + ret.addAll(subinterfaces(sub)); } } addAll(classToSubinterface, cd, ret); @@ -281,12 +279,12 @@ List<ClassDoc> impl = classtree.implementingclasses(cd); if (impl != null) { ret.addAll(impl); - for (Iterator<ClassDoc> it = impl.iterator(); it.hasNext();) { - ret.addAll(subclasses(it.next())); + for (ClassDoc anImpl : impl) { + ret.addAll(subclasses(anImpl)); } } - for (Iterator<ClassDoc> it = subinterfaces(cd).iterator(); it.hasNext();) { - ret.addAll(implementingClasses(it.next())); + for (ClassDoc doc : subinterfaces(cd)) { + ret.addAll(implementingClasses(doc)); } addAll(classToImplementingClass, cd, ret); } @@ -298,32 +296,30 @@ * inverse mapped. */ private void mapExecutable(ExecutableMemberDoc em) { - Parameter[] params = em.parameters(); boolean isConstructor = em.isConstructor(); List<Type> classArgs = new ArrayList<Type>(); - for (int k = 0; k < params.length; k++) { - Type pcd = params[k].type(); + for (Parameter param : em.parameters()) { + Type pcd = param.type(); // primitives don't get mapped, also avoid dups - if ((! params[k].type().isPrimitive()) && - ! classArgs.contains(pcd) && - ! (pcd instanceof TypeVariable)) { - add(isConstructor? classToConstructorArgs :classToMethodArgs, - pcd.asClassDoc(), em); + if ((!param.type().isPrimitive()) && + !classArgs.contains(pcd) && + !(pcd instanceof TypeVariable)) { + add(isConstructor ? classToConstructorArgs : classToMethodArgs, + pcd.asClassDoc(), em); classArgs.add(pcd); - mapTypeParameters(isConstructor? - classToConstructorDocArgTypeParam : classToExecMemberDocArgTypeParam, - pcd, em); + mapTypeParameters(isConstructor ? + classToConstructorDocArgTypeParam : classToExecMemberDocArgTypeParam, + pcd, em); } mapAnnotations( - isConstructor ? + isConstructor ? classToConstructorParamAnnotation : classToExecMemberDocParamAnnotation, - params[k], em); + param, em); } - ClassDoc[] thr = em.thrownExceptions(); - for (int k = 0; k < thr.length; k++) { - add(isConstructor? classToConstructorThrows : classToMethodThrows, - thr[k], em); + for (ClassDoc anException : em.thrownExceptions()) { + add(isConstructor ? classToConstructorThrows : classToMethodThrows, + anException, em); } } @@ -378,8 +374,7 @@ Set<PackageDoc> pkgSet = packageSet(cd); Set<ClassDoc> clsSet = classSet(cd); // add ref's package to package map and class map - for (Iterator<ClassDoc> it = refs.iterator(); it.hasNext();) { - ClassDoc cls = it.next(); + for (ClassDoc cls : refs) { pkgSet.add(cls.containingPackage()); clsSet.add(cls); @@ -400,19 +395,16 @@ if (doc instanceof ClassDoc) { typeVariables = ((ClassDoc) doc).typeParameters(); } else if (doc instanceof WildcardType) { - Type[] extendsBounds = ((WildcardType) doc).extendsBounds(); - for (int k = 0; k < extendsBounds.length; k++) { - addTypeParameterToMap(map, extendsBounds[k], holder); + for (Type extendsBound : ((WildcardType) doc).extendsBounds()) { + addTypeParameterToMap(map, extendsBound, holder); } - Type[] superBounds = ((WildcardType) doc).superBounds(); - for (int k = 0; k < superBounds.length; k++) { - addTypeParameterToMap(map, superBounds[k], holder); + for (Type superBound : ((WildcardType) doc).superBounds()) { + addTypeParameterToMap(map, superBound, holder); } return; } else if (doc instanceof ParameterizedType) { - Type[] typeArguments = ((ParameterizedType) doc).typeArguments(); - for (int k = 0; k < typeArguments.length; k++) { - addTypeParameterToMap(map, typeArguments[k], holder); + for (Type typeArgument : ((ParameterizedType) doc).typeArguments()) { + addTypeParameterToMap(map, typeArgument, holder); } return; } else if (doc instanceof ExecutableMemberDoc) { @@ -424,10 +416,9 @@ } else { return; } - for (int i = 0; i < typeVariables.length; i++) { - Type[] bounds = typeVariables[i].bounds(); - for (int j = 0; j < bounds.length; j++) { - addTypeParameterToMap(map, bounds[j], holder); + for (TypeVariable typeVariable : typeVariables) { + for (Type bound : typeVariable.bounds()) { + addTypeParameterToMap(map, bound, holder); } } } @@ -454,8 +445,8 @@ } else { throw new DocletAbortException("should not happen"); } - for (int i = 0; i < annotations.length; i++) { - AnnotationTypeDoc annotationDoc = annotations[i].annotationType(); + for (AnnotationDesc annotation : annotations) { + AnnotationTypeDoc annotationDoc = annotation.annotationType(); if (isPackage) refList(map, annotationDoc).add(holder); else @@ -474,10 +465,8 @@ */ private <T extends PackageDoc> void mapAnnotations(Map<String,List<T>> map, PackageDoc doc, T holder) { - AnnotationDesc[] annotations; - annotations = doc.annotations(); - for (int i = 0; i < annotations.length; i++) { - AnnotationTypeDoc annotationDoc = annotations[i].annotationType(); + for (AnnotationDesc annotation : doc.annotations()) { + AnnotationTypeDoc annotationDoc = annotation.annotationType(); refList(map, annotationDoc).add(holder); } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java Tue Nov 10 02:47:05 2020 +0000 @@ -85,16 +85,12 @@ */ private void buildDeprecatedAPIInfo(Configuration configuration) { PackageDoc[] packages = configuration.packages; - PackageDoc pkg; - for (int c = 0; c < packages.length; c++) { - pkg = packages[c]; + for (PackageDoc pkg : packages) { if (Util.isDeprecated(pkg)) { getList(PACKAGE).add(pkg); } } - ClassDoc[] classes = configuration.root.classes(); - for (int i = 0; i < classes.length; i++) { - ClassDoc cd = classes[i]; + for (ClassDoc cd : configuration.root.classes()) { if (Util.isDeprecated(cd)) { if (cd.isOrdinaryClass()) { getList(CLASS).add(cd); @@ -118,7 +114,7 @@ } if (cd.isAnnotationType()) { composeDeprecatedList(getList(ANNOTATION_TYPE_MEMBER), - ((AnnotationTypeDoc) cd).elements()); + ((AnnotationTypeDoc) cd).elements()); } } sortDeprecatedLists(); @@ -131,9 +127,9 @@ * @param members members to be added in the list. */ private void composeDeprecatedList(List<Doc> list, MemberDoc[] members) { - for (int i = 0; i < members.length; i++) { - if (Util.isDeprecated(members[i])) { - list.add(members[i]); + for (MemberDoc member : members) { + if (Util.isDeprecated(member)) { + list.add(member); } } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFile.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFile.java Tue Nov 10 02:47:05 2020 +0000 @@ -132,19 +132,15 @@ * Copy the contents of another file directly to this file. */ public void copyFile(DocFile fromFile) throws IOException { - InputStream input = fromFile.openInputStream(); - OutputStream output = openOutputStream(); - try { + try (OutputStream output = openOutputStream(); + InputStream input = fromFile.openInputStream()) { byte[] bytearr = new byte[1024]; int len; while ((len = input.read(bytearr)) != -1) { output.write(bytearr, 0, len); } - } catch (FileNotFoundException exc) { - } catch (SecurityException exc) { - } finally { - input.close(); - output.close(); + } + catch (FileNotFoundException | SecurityException exc) { } } @@ -165,35 +161,26 @@ if (in == null) return; - OutputStream out = openOutputStream(); - try { + try (OutputStream out = openOutputStream()) { if (!replaceNewLine) { byte[] buf = new byte[2048]; int n; - while((n = in.read(buf))>0) out.write(buf,0,n); + while ((n = in.read(buf)) > 0) + out.write(buf, 0, n); } else { - BufferedReader reader = new BufferedReader(new InputStreamReader(in)); - BufferedWriter writer; - if (configuration.docencoding == null) { - writer = new BufferedWriter(new OutputStreamWriter(out)); - } else { - writer = new BufferedWriter(new OutputStreamWriter(out, - configuration.docencoding)); - } - try { + try (BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + BufferedWriter writer = new BufferedWriter(configuration.docencoding == null + ? new OutputStreamWriter(out) + : new OutputStreamWriter(out, configuration.docencoding))) { String line; while ((line = reader.readLine()) != null) { writer.write(line); writer.write(DocletConstants.NL); } - } finally { - reader.close(); - writer.close(); } } } finally { in.close(); - out.close(); } } catch (IOException e) { e.printStackTrace(System.err);
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFinder.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFinder.java Tue Nov 10 02:47:05 2020 +0000 @@ -220,8 +220,8 @@ // appropriate element here. MethodDoc[] implementedMethods = (new ImplementedMethods((MethodDoc) input.element, null)).build(false); - for (int i = 0; i < implementedMethods.length; i++) { - inheritedSearchInput.element = implementedMethods[i]; + for (MethodDoc implementedMethod : implementedMethods) { + inheritedSearchInput.element = implementedMethod; output = search(inheritedSearchInput); output.isValidInheritDocTag = true; if (output.inlineTags.length > 0) {
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java Tue Nov 10 02:47:05 2020 +0000 @@ -234,11 +234,10 @@ try { URL link = pkglisturlpath.toURI().resolve(DocPaths.PACKAGE_LIST.getPath()).toURL(); readPackageList(link.openStream(), urlpath, false); - } catch (URISyntaxException exc) { + } catch (URISyntaxException | MalformedURLException exc) { throw new Fault(configuration.getText("doclet.MalformedURL", pkglisturlpath.toString()), exc); - } catch (MalformedURLException exc) { - throw new Fault(configuration.getText("doclet.MalformedURL", pkglisturlpath.toString()), exc); - } catch (IOException exc) { + } + catch (IOException exc) { throw new Fault(configuration.getText("doclet.URL_error", pkglisturlpath.toString()), exc); } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java Tue Nov 10 02:47:05 2020 +0000 @@ -185,8 +185,7 @@ if (!groupList.contains(defaultGroupName)) { groupList.add(defaultGroupName); } - for (int i = 0; i < packages.length; i++) { - PackageDoc pkg = packages[i]; + for (PackageDoc pkg : packages) { String pkgName = pkg.name(); String groupName = pkgNameGroupMap.get(pkgName); // if this package is not explicitly assigned to a group, @@ -212,8 +211,7 @@ * expression list. */ String regExpGroupName(String pkgName) { - for (int j = 0; j < sortedRegExpList.size(); j++) { - String regexp = sortedRegExpList.get(j); + for (String regexp : sortedRegExpList) { if (pkgName.startsWith(regexp)) { return regExpGroupMap.get(regexp); }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ImplementedMethods.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ImplementedMethods.java Tue Nov 10 02:47:05 2020 +0000 @@ -89,8 +89,7 @@ */ private void buildImplementedMethodList(boolean sort) { List<Type> intfacs = Util.getAllInterfaces(classdoc, configuration, sort); - for (Iterator<Type> iter = intfacs.iterator(); iter.hasNext(); ) { - Type interfaceType = iter.next(); + for (Type interfaceType : intfacs) { MethodDoc found = Util.findMethod(interfaceType.asClassDoc(), method); if (found != null) { removeOverriddenMethod(found); @@ -132,8 +131,7 @@ */ private boolean overridingMethodFound(MethodDoc method) { ClassDoc containingClass = method.containingClass(); - for (int i = 0; i < methlist.size(); i++) { - MethodDoc listmethod = methlist.get(i); + for (MethodDoc listmethod : methlist) { if (containingClass == listmethod.containingClass()) { // it's the same method. return true;
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java Tue Nov 10 02:47:05 2020 +0000 @@ -132,8 +132,8 @@ * sort each element which is a list. */ protected void sortIndexMap() { - for (Iterator<List<Doc>> it = indexmap.values().iterator(); it.hasNext(); ) { - Collections.sort(it.next(), new DocComparator()); + for (List<Doc> docs : indexmap.values()) { + Collections.sort(docs, new DocComparator()); } } @@ -150,9 +150,8 @@ if (!classesOnly) { if (packages.length == 0) { Set<PackageDoc> set = new HashSet<PackageDoc>(); - PackageDoc pd; - for (int i = 0; i < classes.length; i++) { - pd = classes[i].containingPackage(); + for (ClassDoc aClass : classes) { + PackageDoc pd = aClass.containingPackage(); if (pd != null && pd.name().length() > 0) { set.add(pd); } @@ -164,9 +163,9 @@ } adjustIndexMap(classes); if (!classesOnly) { - for (int i = 0; i < classes.length; i++) { - if (shouldAddToIndexMap(classes[i])) { - putMembersInIndexMap(classes[i]); + for (ClassDoc aClass : classes) { + if (shouldAddToIndexMap(aClass)) { + putMembersInIndexMap(aClass); } } } @@ -194,19 +193,19 @@ * @param elements Array of members. */ protected void adjustIndexMap(Doc[] elements) { - for (int i = 0; i < elements.length; i++) { - if (shouldAddToIndexMap(elements[i])) { - String name = elements[i].name(); - char ch = (name.length()==0)? - '*' : - Character.toUpperCase(name.charAt(0)); - Character unicode = new Character(ch); + for (Doc element : elements) { + if (shouldAddToIndexMap(element)) { + String name = element.name(); + char ch = (name.length() == 0) ? + '*' : + Character.toUpperCase(name.charAt(0)); + Character unicode = ch; List<Doc> list = indexmap.get(unicode); if (list == null) { list = new ArrayList<Doc>(); indexmap.put(unicode, list); } - list.add(elements[i]); + list.add(element); } } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MetaKeywords.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MetaKeywords.java Tue Nov 10 02:47:05 2020 +0000 @@ -147,10 +147,9 @@ protected ArrayList<String> getMemberKeywords(MemberDoc[] memberdocs) { ArrayList<String> results = new ArrayList<String>(); String membername; - for (int i=0; i < memberdocs.length; i++) { - membername = memberdocs[i].name() - + (memberdocs[i].isMethod() ? "()" : ""); - if ( ! results.contains(membername) ) { + for (MemberDoc memberdoc : memberdocs) { + membername = memberdoc.name() + (memberdoc.isMethod() ? "()" : ""); + if (!results.contains(membername)) { results.add(membername); } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodFinder.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodFinder.java Tue Nov 10 02:47:05 2020 +0000 @@ -62,9 +62,9 @@ public MethodDoc searchInterfaces(ClassDoc cd, MethodDoc method) { MethodDoc[] implementedMethods = (new ImplementedMethods(method, null)).build(); - for (int i = 0; i < implementedMethods.length; i++) { - if (isCorrectMethod(implementedMethods[i])) { - return implementedMethods[i]; + for (MethodDoc implementedMethod : implementedMethods) { + if (isCorrectMethod(implementedMethod)) { + return implementedMethod; } } return null;
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PackageListWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PackageListWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -76,17 +76,16 @@ } protected void generatePackageListFile(RootDoc root) { - PackageDoc[] packages = configuration.packages; ArrayList<String> names = new ArrayList<String>(); - for (int i = 0; i < packages.length; i++) { + for (PackageDoc pkg : configuration.packages) { // if the -nodeprecated option is set and the package is marked as // deprecated, do not include it in the packages list. - if (!(configuration.nodeprecated && Util.isDeprecated(packages[i]))) - names.add(packages[i].name()); + if (!(configuration.nodeprecated && Util.isDeprecated(pkg))) + names.add(pkg.name()); } Collections.sort(names); - for (int i = 0; i < names.size(); i++) { - println(names.get(i)); + for (String name : names) { + println(name); } } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java Tue Nov 10 02:47:05 2020 +0000 @@ -26,7 +26,9 @@ package com.sun.tools.doclets.internal.toolkit.util; import java.io.*; +import java.lang.annotation.Documented; import java.lang.annotation.ElementType; +import java.lang.annotation.Target; import java.util.*; import javax.tools.StandardLocation; @@ -75,9 +77,9 @@ public static List<ProgramElementDoc> excludeDeprecatedMembersAsList( ProgramElementDoc[] members) { List<ProgramElementDoc> list = new ArrayList<ProgramElementDoc>(); - for (int i = 0; i < members.length; i++) { - if (members[i].tags("deprecated").length == 0) { - list.add(members[i]); + for (ProgramElementDoc member : members) { + if (member.tags("deprecated").length == 0) { + list.add(member); } } Collections.sort(list); @@ -102,8 +104,8 @@ * @return boolean True if non-public member found, false otherwise. */ public static boolean nonPublicMemberFound(ProgramElementDoc[] members) { - for (int i = 0; i < members.length; i++) { - if (!members[i].isPublic()) { + for (ProgramElementDoc member : members) { + if (!member.isPublic()) { return true; } } @@ -119,9 +121,9 @@ */ public static MethodDoc findMethod(ClassDoc cd, MethodDoc method) { MethodDoc[] methods = cd.methods(); - for (int i = 0; i < methods.length; i++) { - if (executableMembersEqual(method, methods[i])) { - return methods[i]; + for (MethodDoc m : methods) { + if (executableMembersEqual(method, m)) { + return m; } } @@ -241,9 +243,7 @@ first = false; } - } catch (SecurityException exc) { - throw new DocletAbortException(exc); - } catch (IOException exc) { + } catch (SecurityException | IOException exc) { throw new DocletAbortException(exc); } } @@ -287,18 +287,15 @@ superType = type.asClassDoc().superclassType(); } - for (int i = 0; i < interfaceTypes.length; i++) { - Type interfaceType = interfaceTypes[i]; + for (Type interfaceType : interfaceTypes) { ClassDoc interfaceClassDoc = interfaceType.asClassDoc(); - if (! (interfaceClassDoc.isPublic() || - (configuration == null || - isLinkable(interfaceClassDoc, configuration)))) { + if (!(interfaceClassDoc.isPublic() || + (configuration == null || + isLinkable(interfaceClassDoc, configuration)))) { continue; } results.put(interfaceClassDoc, interfaceType); - List<Type> superInterfaces = getAllInterfaces(interfaceType, configuration, sort); - for (Iterator<Type> iter = superInterfaces.iterator(); iter.hasNext(); ) { - Type t = iter.next(); + for (Type t : getAllInterfaces(interfaceType, configuration, sort)) { results.put(t.asClassDoc(), t); } } @@ -351,20 +348,18 @@ private static void addAllInterfaceTypes(Map<ClassDoc,Type> results, Type type, Type[] interfaceTypes, boolean raw, Configuration configuration) { - for (int i = 0; i < interfaceTypes.length; i++) { - Type interfaceType = interfaceTypes[i]; + for (Type interfaceType : interfaceTypes) { ClassDoc interfaceClassDoc = interfaceType.asClassDoc(); - if (! (interfaceClassDoc.isPublic() || - (configuration != null && - isLinkable(interfaceClassDoc, configuration)))) { + if (!(interfaceClassDoc.isPublic() || + (configuration != null && + isLinkable(interfaceClassDoc, configuration)))) { continue; } if (raw) interfaceType = interfaceType.asClassDoc(); results.put(interfaceClassDoc, interfaceType); List<Type> superInterfaces = getAllInterfaces(interfaceType, configuration); - for (Iterator<Type> iter = superInterfaces.iterator(); iter.hasNext(); ) { - Type superInterface = iter.next(); + for (Type superInterface : superInterfaces) { results.put(superInterface.asClassDoc(), superInterface); } } @@ -429,10 +424,9 @@ * @return true return true if it should be documented and false otherwise. */ public static boolean isDocumentedAnnotation(AnnotationTypeDoc annotationDoc) { - AnnotationDesc[] annotationDescList = annotationDoc.annotations(); - for (int i = 0; i < annotationDescList.length; i++) { - if (annotationDescList[i].annotationType().qualifiedName().equals( - java.lang.annotation.Documented.class.getName())){ + for (AnnotationDesc anno : annotationDoc.annotations()) { + if (anno.annotationType().qualifiedName().equals( + Documented.class.getName())) { return true; } } @@ -448,13 +442,12 @@ || !(elems[0].value().value() instanceof AnnotationValue[])) return true; // error recovery - AnnotationValue[] values = (AnnotationValue[])elems[0].value().value(); - for (int i = 0; i < values.length; i++) { - Object value = values[i].value(); + for (AnnotationValue aValue : (AnnotationValue[])elems[0].value().value()) { + Object value = aValue.value(); if (!(value instanceof FieldDoc)) return true; // error recovery - FieldDoc eValue = (FieldDoc)value; + FieldDoc eValue = (FieldDoc) value; if (Util.isJava5DeclarationElementType(eValue)) { return true; } @@ -480,10 +473,10 @@ // Annotations with no target are treated as declaration as well if (annotationDescList.length==0) return true; - for (int i = 0; i < annotationDescList.length; i++) { - if (annotationDescList[i].annotationType().qualifiedName().equals( - java.lang.annotation.Target.class.getName())) { - if (isDeclarationTarget(annotationDescList[i])) + for (AnnotationDesc anno : annotationDescList) { + if (anno.annotationType().qualifiedName().equals( + Target.class.getName())) { + if (isDeclarationTarget(anno)) return true; } } @@ -602,7 +595,7 @@ * @return the text with all tabs expanded */ public static String replaceTabs(Configuration configuration, String text) { - if (text.indexOf("\t") == -1) + if (!text.contains("\t")) return text; final int tabLength = configuration.sourcetab; @@ -664,32 +657,30 @@ */ public static void setEnumDocumentation(Configuration configuration, ClassDoc classDoc) { - MethodDoc[] methods = classDoc.methods(); - for (int j = 0; j < methods.length; j++) { - MethodDoc currentMethod = methods[j]; + for (MethodDoc currentMethod : classDoc.methods()) { if (currentMethod.name().equals("values") && - currentMethod.parameters().length == 0) { + currentMethod.parameters().length == 0) { StringBuilder sb = new StringBuilder(); sb.append(configuration.getText("doclet.enum_values_doc.main", classDoc.name())); sb.append("\n@return "); sb.append(configuration.getText("doclet.enum_values_doc.return")); currentMethod.setRawCommentText(sb.toString()); } else if (currentMethod.name().equals("valueOf") && - currentMethod.parameters().length == 1) { + currentMethod.parameters().length == 1) { Type paramType = currentMethod.parameters()[0].type(); if (paramType != null && - paramType.qualifiedTypeName().equals(String.class.getName())) { - StringBuilder sb = new StringBuilder(); - sb.append(configuration.getText("doclet.enum_valueof_doc.main", classDoc.name())); - sb.append("\n@param name "); - sb.append(configuration.getText("doclet.enum_valueof_doc.param_name")); - sb.append("\n@return "); - sb.append(configuration.getText("doclet.enum_valueof_doc.return")); - sb.append("\n@throws IllegalArgumentException "); - sb.append(configuration.getText("doclet.enum_valueof_doc.throws_ila")); - sb.append("\n@throws NullPointerException "); - sb.append(configuration.getText("doclet.enum_valueof_doc.throws_npe")); - currentMethod.setRawCommentText(sb.toString()); + paramType.qualifiedTypeName().equals(String.class.getName())) { + StringBuilder sb = new StringBuilder(); + sb.append(configuration.getText("doclet.enum_valueof_doc.main", classDoc.name())); + sb.append("\n@param name "); + sb.append(configuration.getText("doclet.enum_valueof_doc.param_name")); + sb.append("\n@return "); + sb.append(configuration.getText("doclet.enum_valueof_doc.return")); + sb.append("\n@throws IllegalArgumentException "); + sb.append(configuration.getText("doclet.enum_valueof_doc.throws_ila")); + sb.append("\n@throws NullPointerException "); + sb.append(configuration.getText("doclet.enum_valueof_doc.throws_npe")); + currentMethod.setRawCommentText(sb.toString()); } } } @@ -710,9 +701,9 @@ annotationDescList = ((PackageDoc)doc).annotations(); else annotationDescList = ((ProgramElementDoc)doc).annotations(); - for (int i = 0; i < annotationDescList.length; i++) { - if (annotationDescList[i].annotationType().qualifiedName().equals( - java.lang.Deprecated.class.getName())){ + for (AnnotationDesc anno : annotationDescList) { + if (anno.annotationType().qualifiedName().equals( + Deprecated.class.getName())) { return true; } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java Tue Nov 10 02:47:05 2020 +0000 @@ -173,8 +173,7 @@ */ private List<ProgramElementDoc> getInheritedPackagePrivateMethods(Configuration configuration) { List<ProgramElementDoc> results = new ArrayList<ProgramElementDoc>(); - for (Iterator<ClassDoc> iter = visibleClasses.iterator(); iter.hasNext(); ) { - ClassDoc currentClass = iter.next(); + for (ClassDoc currentClass : visibleClasses) { if (currentClass != classdoc && currentClass.isPackagePrivate() && !Util.isLinkable(currentClass, configuration)) { @@ -221,11 +220,11 @@ private void sort(List<ClassDoc> list) { List<ClassDoc> classes = new ArrayList<ClassDoc>(); List<ClassDoc> interfaces = new ArrayList<ClassDoc>(); - for (int i = 0; i < list.size(); i++) { - ClassDoc cd = list.get(i); + for (ClassDoc cd : list) { if (cd.isClass()) { classes.add(cd); - } else { + } + else { interfaces.add(cd); } } @@ -235,23 +234,23 @@ } private void fillMemberLevelMap(List<ProgramElementDoc> list, String level) { - for (int i = 0; i < list.size(); i++) { - Object key = getMemberKey(list.get(i)); - Map<ProgramElementDoc,String> memberLevelMap = memberNameMap.get(key); + for (ProgramElementDoc element : list) { + Object key = getMemberKey(element); + Map<ProgramElementDoc, String> memberLevelMap = memberNameMap.get(key); if (memberLevelMap == null) { - memberLevelMap = new HashMap<ProgramElementDoc,String>(); + memberLevelMap = new HashMap<ProgramElementDoc, String>(); memberNameMap.put(key, memberLevelMap); } - memberLevelMap.put(list.get(i), level); + memberLevelMap.put(element, level); } } private void purgeMemberLevelMap(List<ProgramElementDoc> list, String level) { - for (int i = 0; i < list.size(); i++) { - Object key = getMemberKey(list.get(i)); + for (ProgramElementDoc element : list) { + Object key = getMemberKey(element); Map<ProgramElementDoc, String> memberLevelMap = memberNameMap.get(key); - if (memberLevelMap != null && level.equals(memberLevelMap.get(list.get(i)))) - memberLevelMap.remove(list.get(i)); + if (memberLevelMap != null && level.equals(memberLevelMap.get(element))) + memberLevelMap.remove(element); } } @@ -273,11 +272,10 @@ } public boolean isEqual(MethodDoc member) { - for (Iterator<ProgramElementDoc> iter = members.iterator(); iter.hasNext(); ) { - MethodDoc member2 = (MethodDoc) iter.next(); - if (Util.executableMembersEqual(member, member2)) { + for (ProgramElementDoc element : members) { + if (Util.executableMembersEqual(member, (MethodDoc) element)) { members.add(member); - return true; + return true; } } return false; @@ -345,9 +343,9 @@ private void mapClass() { addMembers(mappingClass); ClassDoc[] interfaces = mappingClass.interfaces(); - for (int i = 0; i < interfaces.length; i++) { + for (ClassDoc anInterface : interfaces) { String locallevel = level + 1; - ClassMembers cm = new ClassMembers(interfaces[i], locallevel); + ClassMembers cm = new ClassMembers(anInterface, locallevel); cm.mapClass(); } if (mappingClass.isClass()) { @@ -371,13 +369,12 @@ private void addMembers(ClassDoc fromClass) { List<ProgramElementDoc> cdmembers = getClassMembers(fromClass, true); List<ProgramElementDoc> incllist = new ArrayList<ProgramElementDoc>(); - for (int i = 0; i < cdmembers.size(); i++) { - ProgramElementDoc pgmelem = cdmembers.get(i); + for (ProgramElementDoc pgmelem : cdmembers) { if (!found(members, pgmelem) && memberIsVisible(pgmelem) && !isOverridden(pgmelem, level) && !isTreatedAsPrivate(pgmelem)) { - incllist.add(pgmelem); + incllist.add(pgmelem); } } if (incllist.size() > 0) { @@ -491,18 +488,17 @@ boolean required) { AnnotationTypeElementDoc[] members = doc.elements(); List<AnnotationTypeElementDoc> targetMembers = new ArrayList<AnnotationTypeElementDoc>(); - for (int i = 0; i < members.length; i++) { - if ((required && members[i].defaultValue() == null) || - ((!required) && members[i].defaultValue() != null)){ - targetMembers.add(members[i]); + for (AnnotationTypeElementDoc member : members) { + if ((required && member.defaultValue() == null) || + ((!required) && member.defaultValue() != null)) { + targetMembers.add(member); } } return targetMembers.toArray(new AnnotationTypeElementDoc[]{}); } private boolean found(List<ProgramElementDoc> list, ProgramElementDoc elem) { - for (int i = 0; i < list.size(); i++) { - ProgramElementDoc pgmelem = list.get(i); + for (ProgramElementDoc pgmelem : list) { if (Util.matches(pgmelem, elem)) { return true; } @@ -520,10 +516,7 @@ Map<?,String> memberLevelMap = (Map<?,String>) memberNameMap.get(getMemberKey(pgmdoc)); if (memberLevelMap == null) return false; - String mappedlevel = null; - Iterator<String> iterator = memberLevelMap.values().iterator(); - while (iterator.hasNext()) { - mappedlevel = iterator.next(); + for (String mappedlevel : memberLevelMap.values()) { if (mappedlevel.equals(STARTLEVEL) || (level.startsWith(mappedlevel) && !level.equals(mappedlevel))) { @@ -749,8 +742,7 @@ } private ClassMember getClassMember(MethodDoc member) { - for (Iterator<?> iter = memberNameMap.keySet().iterator(); iter.hasNext();) { - Object key = iter.next(); + for (Object key : memberNameMap.keySet()) { if (key instanceof String) { continue; } else if (((ClassMember) key).isEqual(member)) {
--- a/src/share/classes/com/sun/tools/doclint/DocLint.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/doclint/DocLint.java Tue Nov 10 02:47:05 2020 +0000 @@ -257,8 +257,7 @@ public void init(JavacTask task, String[] args, boolean addTaskListener) { env = new Env(); - for (int i = 0; i < args.length; i++) { - String arg = args[i]; + for (String arg : args) { if (arg.equals(XMSGS_OPTION)) { env.messages.setOptions(null); } else if (arg.startsWith(XMSGS_CUSTOM_PREFIX)) {
--- a/src/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java Tue Nov 10 02:47:05 2020 +0000 @@ -218,9 +218,7 @@ return clientJavaFileManager.getClassLoader(location); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -231,9 +229,7 @@ return wrapJavaFileObjects(clientJavaFileManager.list(location, packageName, kinds, recurse)); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -244,9 +240,7 @@ return clientJavaFileManager.inferBinaryName(location, unwrap(file)); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -257,9 +251,7 @@ return clientJavaFileManager.isSameFile(unwrap(a), unwrap(b)); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -270,9 +262,7 @@ return clientJavaFileManager.handleOption(current, remaining); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -283,9 +273,7 @@ return clientJavaFileManager.hasLocation(location); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -296,9 +284,7 @@ return wrap(clientJavaFileManager.getJavaFileForInput(location, className, kind)); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -309,9 +295,7 @@ return wrap(clientJavaFileManager.getJavaFileForOutput(location, className, kind, unwrap(sibling))); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -322,9 +306,7 @@ return wrap(clientJavaFileManager.getFileForInput(location, packageName, relativeName)); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -335,9 +317,7 @@ return wrap(clientJavaFileManager.getFileForOutput(location, packageName, relativeName, unwrap(sibling))); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -348,9 +328,7 @@ clientJavaFileManager.flush(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -361,9 +339,7 @@ clientJavaFileManager.close(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -374,9 +350,7 @@ return clientJavaFileManager.isSupportedOption(option); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -400,9 +374,7 @@ return clientFileObject.toUri(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -413,9 +385,7 @@ return clientFileObject.getName(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -426,9 +396,7 @@ return clientFileObject.openInputStream(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -439,9 +407,7 @@ return clientFileObject.openOutputStream(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -452,9 +418,7 @@ return clientFileObject.openReader(ignoreEncodingErrors); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -465,9 +429,7 @@ return clientFileObject.getCharContent(ignoreEncodingErrors); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -478,9 +440,7 @@ return clientFileObject.openWriter(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -491,9 +451,7 @@ return clientFileObject.getLastModified(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -504,9 +462,7 @@ return clientFileObject.delete(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -528,9 +484,7 @@ return ((JavaFileObject)clientFileObject).getKind(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -541,9 +495,7 @@ return ((JavaFileObject)clientFileObject).isNameCompatible(simpleName, kind); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -554,9 +506,7 @@ return ((JavaFileObject)clientFileObject).getNestingKind(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -567,9 +517,7 @@ return ((JavaFileObject)clientFileObject).getAccessLevel(); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -593,9 +541,7 @@ clientDiagnosticListener.report(unwrap(diagnostic)); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -668,9 +614,7 @@ clientTaskListener.started(ev); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } } @@ -681,9 +625,7 @@ clientTaskListener.finished(ev); } catch (ClientCodeException e) { throw e; - } catch (RuntimeException e) { - throw new ClientCodeException(e); - } catch (Error e) { + } catch (RuntimeException | Error e) { throw new ClientCodeException(e); } }
--- a/src/share/classes/com/sun/tools/javac/file/FSInfo.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/file/FSInfo.java Tue Nov 10 02:47:05 2020 +0000 @@ -64,8 +64,7 @@ public List<File> getJarClassPath(File file) throws IOException { String parent = file.getParent(); - JarFile jarFile = new JarFile(file); - try { + try (JarFile jarFile = new JarFile(file)) { Manifest man = jarFile.getManifest(); if (man == null) return Collections.emptyList(); @@ -80,15 +79,14 @@ List<File> list = new ArrayList<File>(); - for (StringTokenizer st = new StringTokenizer(path); st.hasMoreTokens(); ) { + for (StringTokenizer st = new StringTokenizer(path); + st.hasMoreTokens(); ) { String elt = st.nextToken(); File f = (parent == null ? new File(elt) : new File(parent, elt)); list.add(f); } return list; - } finally { - jarFile.close(); } } }
--- a/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java Tue Nov 10 02:47:05 2020 +0000 @@ -109,8 +109,7 @@ public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException { CharBuffer cb = fileManager.getCachedContent(this); if (cb == null) { - InputStream in = new FileInputStream(file); - try { + try (InputStream in = new FileInputStream(file)) { ByteBuffer bb = fileManager.makeByteBuffer(in); JavaFileObject prev = fileManager.log.useSource(this); try { @@ -122,8 +121,6 @@ if (!ignoreEncodingErrors) { fileManager.cache(this, cb); } - } finally { - in.close(); } } return cb;
--- a/src/share/classes/com/sun/tools/javac/file/ZipArchive.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/file/ZipArchive.java Tue Nov 10 02:47:05 2020 +0000 @@ -205,8 +205,7 @@ public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException { CharBuffer cb = fileManager.getCachedContent(this); if (cb == null) { - InputStream in = zarch.zfile.getInputStream(entry); - try { + try (InputStream in = zarch.zfile.getInputStream(entry)) { ByteBuffer bb = fileManager.makeByteBuffer(in); JavaFileObject prev = fileManager.log.useSource(this); try { @@ -218,8 +217,6 @@ if (!ignoreEncodingErrors) { fileManager.cache(this, cb); } - } finally { - in.close(); } } return cb;
--- a/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java Tue Nov 10 02:47:05 2020 +0000 @@ -162,8 +162,7 @@ public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException { CharBuffer cb = fileManager.getCachedContent(this); if (cb == null) { - InputStream in = new ByteArrayInputStream(zfIndex.read(entry)); - try { + try (InputStream in = new ByteArrayInputStream(zfIndex.read(entry))) { ByteBuffer bb = fileManager.makeByteBuffer(in); JavaFileObject prev = fileManager.log.useSource(this); try { @@ -174,8 +173,6 @@ fileManager.recycleByteBuffer(bb); // save for next time if (!ignoreEncodingErrors) fileManager.cache(this, cb); - } finally { - in.close(); } } return cb;
--- a/src/share/classes/com/sun/tools/javac/file/ZipFileIndexCache.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/file/ZipFileIndexCache.java Tue Nov 10 02:47:05 2020 +0000 @@ -113,14 +113,12 @@ } public synchronized void clearCache(long timeNotUsed) { - Iterator<File> cachedFileIterator = map.keySet().iterator(); - while (cachedFileIterator.hasNext()) { - File cachedFile = cachedFileIterator.next(); + for (File cachedFile : map.keySet()) { ZipFileIndex cachedZipIndex = map.get(cachedFile); if (cachedZipIndex != null) { long timeToTest = cachedZipIndex.lastReferenceTimeStamp + timeNotUsed; if (timeToTest < cachedZipIndex.lastReferenceTimeStamp || // Overflow... - System.currentTimeMillis() > timeToTest) { + System.currentTimeMillis() > timeToTest) { map.remove(cachedFile); } }
--- a/src/share/classes/com/sun/tools/javac/jvm/JNIWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/jvm/JNIWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -697,7 +697,7 @@ // Separates parameters. if (signature != null) { - if (signature.indexOf(",") != -1) { + if (signature.contains(",")) { st = new StringTokenizer(signature, ","); if (st != null) { while (st.hasMoreTokens()) { @@ -755,13 +755,13 @@ if(paramsig != null){ - if(paramsig.indexOf("[]") != -1) { + if(paramsig.contains("[]")) { // Gets array dimension. int endindex = paramsig.indexOf("[]"); componentType = paramsig.substring(0, endindex); String dimensionString = paramsig.substring(endindex); if(dimensionString != null){ - while(dimensionString.indexOf("[]") != -1){ + while(dimensionString.contains("[]")){ paramJVMSig += "["; int beginindex = dimensionString.indexOf("]") + 1; if(beginindex < dimensionString.length()){ @@ -785,29 +785,32 @@ String JVMSig = ""; if(componentType != null){ - if(componentType.equals("void")) JVMSig += SIG_VOID ; - else if(componentType.equals("boolean")) JVMSig += SIG_BOOLEAN ; - else if(componentType.equals("byte")) JVMSig += SIG_BYTE ; - else if(componentType.equals("char")) JVMSig += SIG_CHAR ; - else if(componentType.equals("short")) JVMSig += SIG_SHORT ; - else if(componentType.equals("int")) JVMSig += SIG_INT ; - else if(componentType.equals("long")) JVMSig += SIG_LONG ; - else if(componentType.equals("float")) JVMSig += SIG_FLOAT ; - else if(componentType.equals("double")) JVMSig += SIG_DOUBLE ; - else { - if(!componentType.equals("")){ - TypeElement classNameDoc = elems.getTypeElement(componentType); + switch (componentType) { + case "void": JVMSig += SIG_VOID; break; + case "boolean": JVMSig += SIG_BOOLEAN; break; + case "byte": JVMSig += SIG_BYTE; break; + case "char": JVMSig += SIG_CHAR; break; + case "short": JVMSig += SIG_SHORT; break; + case "int": JVMSig += SIG_INT; break; + case "long": JVMSig += SIG_LONG; break; + case "float": JVMSig += SIG_FLOAT; break; + case "double": JVMSig += SIG_DOUBLE; break; + default: + if (!componentType.equals("")) { + TypeElement classNameDoc = elems.getTypeElement(componentType); - if(classNameDoc == null){ - throw new SignatureException(componentType); - }else { - String classname = classNameDoc.getQualifiedName().toString(); - String newclassname = classname.replace('.', '/'); - JVMSig += "L"; - JVMSig += newclassname; - JVMSig += ";"; + if (classNameDoc == null) { + throw new SignatureException(componentType); + } + else { + String classname = classNameDoc.getQualifiedName().toString(); + String newclassname = classname.replace('.', '/'); + JVMSig += "L"; + JVMSig += newclassname; + JVMSig += ";"; + } } - } + break; } } return JVMSig;
--- a/src/share/classes/com/sun/tools/javac/main/CommandLine.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/main/CommandLine.java Tue Nov 10 02:47:05 2020 +0000 @@ -55,8 +55,7 @@ throws IOException { ListBuffer<String> newArgs = new ListBuffer<String>(); - for (int i = 0; i < args.length; i++) { - String arg = args[i]; + for (String arg : args) { if (arg.length() > 1 && arg.charAt(0) == '@') { arg = arg.substring(1); if (arg.charAt(0) == '@') { @@ -74,17 +73,17 @@ private static void loadCmdFile(String name, ListBuffer<String> args) throws IOException { - Reader r = new BufferedReader(new FileReader(name)); - StreamTokenizer st = new StreamTokenizer(r); - st.resetSyntax(); - st.wordChars(' ', 255); - st.whitespaceChars(0, ' '); - st.commentChar('#'); - st.quoteChar('"'); - st.quoteChar('\''); - while (st.nextToken() != StreamTokenizer.TT_EOF) { - args.append(st.sval); + try (Reader r = new BufferedReader(new FileReader(name))) { + StreamTokenizer st = new StreamTokenizer(r); + st.resetSyntax(); + st.wordChars(' ', 255); + st.whitespaceChars(0, ' '); + st.commentChar('#'); + st.quoteChar('"'); + st.quoteChar('\''); + while (st.nextToken() != StreamTokenizer.TT_EOF) { + args.append(st.sval); + } } - r.close(); } }
--- a/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java Tue Nov 10 02:47:05 2020 +0000 @@ -723,13 +723,10 @@ log.error(cdef.pos(), "source.cant.overwrite.input.file", outFile); return null; } else { - BufferedWriter out = new BufferedWriter(outFile.openWriter()); - try { + try (BufferedWriter out = new BufferedWriter(outFile.openWriter())) { new Pretty(out, true).printUnit(env.toplevel, cdef); if (verbose) log.printVerbose("wrote.file", outFile); - } finally { - out.close(); } return outFile; }
--- a/src/share/classes/com/sun/tools/javac/main/Main.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/main/Main.java Tue Nov 10 02:47:05 2020 +0000 @@ -458,10 +458,8 @@ pluginsToCall.add(List.from(plugin.split("\\s+"))); } JavacTask task = null; - Iterator<Plugin> iter = sl.iterator(); - while (iter.hasNext()) { - Plugin plugin = iter.next(); - for (List<String> p: pluginsToCall) { + for (Plugin plugin : sl) { + for (List<String> p : pluginsToCall) { if (plugin.getName().equals(p.head)) { pluginsToCall.remove(p); try { @@ -640,14 +638,11 @@ final String algorithm = "MD5"; byte[] digest; MessageDigest md = MessageDigest.getInstance(algorithm); - DigestInputStream in = new DigestInputStream(url.openStream(), md); - try { + try (DigestInputStream in = new DigestInputStream(url.openStream(), md)) { byte[] buf = new byte[8192]; int n; do { n = in.read(buf); } while (n > 0); digest = md.digest(); - } finally { - in.close(); } StringBuilder sb = new StringBuilder(); for (byte b: digest)
--- a/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java Tue Nov 10 02:47:05 2020 +0000 @@ -219,8 +219,7 @@ public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException { CharBuffer cb = fileManager.getCachedContent(this); if (cb == null) { - InputStream in = openInputStream(); - try { + try (InputStream in = openInputStream()) { ByteBuffer bb = fileManager.makeByteBuffer(in); JavaFileObject prev = fileManager.log.useSource(this); try { @@ -232,8 +231,6 @@ if (!ignoreEncodingErrors) { fileManager.cache(this, cb); } - } finally { - in.close(); } } return cb;
--- a/src/share/classes/com/sun/tools/javac/sym/CreateSymbols.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/sym/CreateSymbols.java Tue Nov 10 02:47:05 2020 +0000 @@ -265,9 +265,7 @@ writeClass(pool, nestedClass, writer); } } - } catch (ClassWriter.StringOverflow ex) { - throw new RuntimeException(ex); - } catch (ClassWriter.PoolOverflow ex) { + } catch (ClassWriter.StringOverflow | ClassWriter.PoolOverflow ex) { throw new RuntimeException(ex); } }
--- a/src/share/classes/com/sun/tools/javac/sym/Profiles.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/sym/Profiles.java Tue Nov 10 02:47:05 2020 +0000 @@ -69,30 +69,24 @@ } for (int i = 1; i <= 4; i++) { - BufferedWriter out = new BufferedWriter(new FileWriter(i + ".txt")); - try { - for (String type: lists.get(i)) { + try (BufferedWriter out = new BufferedWriter(new FileWriter(i + ".txt"))) { + for (String type : lists.get(i)) { out.write(type); out.newLine(); } - } finally { - out.close(); } } } } public static Profiles read(File file) throws IOException { - BufferedInputStream in = new BufferedInputStream(new FileInputStream(file)); - try { + try (BufferedInputStream in = new BufferedInputStream(new FileInputStream(file))) { Properties p = new Properties(); p.load(in); if (p.containsKey("java/lang/Object")) return new SimpleProfiles(p); else return new MakefileProfiles(p); - } finally { - in.close(); } }
--- a/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java Tue Nov 10 02:47:05 2020 +0000 @@ -137,7 +137,7 @@ BasicConfiguration conf = getConfiguration(); int indentSource = conf.getIndentation(DiagnosticPart.SOURCE); String sourceLine = "\n" + formatSourceLine(d, indentSource); - boolean singleLine = msg.indexOf("\n") == -1; + boolean singleLine = !msg.contains("\n"); if (singleLine || getConfiguration().getSourcePosition() == SourcePosition.BOTTOM) return msg + sourceLine; else
--- a/src/share/classes/com/sun/tools/javac/util/Convert.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/util/Convert.java Tue Nov 10 02:47:05 2020 +0000 @@ -63,8 +63,8 @@ char[] cs = s.toCharArray(); int limit = Integer.MAX_VALUE / (radix/2); int n = 0; - for (int i = 0; i < cs.length; i++) { - int d = Character.digit(cs[i], radix); + for (char c : cs) { + int d = Character.digit(c, radix); if (n < 0 || n > limit || n * radix > Integer.MAX_VALUE - d) @@ -85,8 +85,8 @@ char[] cs = s.toCharArray(); long limit = Long.MAX_VALUE / (radix/2); long n = 0; - for (int i = 0; i < cs.length; i++) { - int d = Character.digit(cs[i], radix); + for (char c : cs) { + int d = Character.digit(c, radix); if (n < 0 || n > limit || n * radix > Long.MAX_VALUE - d)
--- a/src/share/classes/com/sun/tools/javac/util/ListBuffer.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/util/ListBuffer.java Tue Nov 10 02:47:05 2020 +0000 @@ -156,8 +156,8 @@ /** Append all elements in an array to buffer. */ public ListBuffer<A> appendArray(A[] xs) { - for (int i = 0; i < xs.length; i++) { - append(xs[i]); + for (A x : xs) { + append(x); } return this; }
--- a/src/share/classes/com/sun/tools/javac/util/ServiceLoader.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javac/util/ServiceLoader.java Tue Nov 10 02:47:05 2020 +0000 @@ -169,7 +169,6 @@ throws ServiceConfigurationError { InputStream in = null; - BufferedReader r = null; ArrayList<String> names = new ArrayList<>(); try { // The problem is that by default, streams opened with @@ -186,14 +185,14 @@ uc.setUseCaches(false); in = uc.getInputStream(); // ... end of workaround. - r = new BufferedReader(new InputStreamReader(in, "utf-8")); - int lc = 1; - while ((lc = parseLine(service, u, r, lc, names)) >= 0); + try (BufferedReader r = new BufferedReader(new InputStreamReader(in, "utf-8"))) { + int lc = 1; + while ((lc = parseLine(service, u, r, lc, names)) >= 0); + } } catch (IOException x) { fail(service, "Error reading configuration file", x); } finally { try { - if (r != null) r.close(); if (in != null) in.close(); } catch (IOException y) { fail(service, "Error closing configuration file", y);
--- a/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java Tue Nov 10 02:47:05 2020 +0000 @@ -962,9 +962,8 @@ } // search interfaces - ClassDoc intf[] = interfaces(); - for (int i = 0; i < intf.length; i++) { - cdi = (ClassDocImpl)intf[i]; + for (ClassDoc intf : interfaces()) { + cdi = (ClassDocImpl) intf; mdi = cdi.searchMethod(methodName, paramTypes, searched); if (mdi != null) { return mdi; @@ -1071,9 +1070,8 @@ } // search interfaces - ClassDoc intf[] = interfaces(); - for (int i = 0; i < intf.length; i++) { - cdi = (ClassDocImpl)intf[i]; + for (ClassDoc intf : interfaces()) { + cdi = (ClassDocImpl) intf; FieldDocImpl fdi = cdi.searchField(fieldName, searched); if (fdi != null) { return fdi;
--- a/src/share/classes/com/sun/tools/javadoc/Comment.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javadoc/Comment.java Tue Nov 10 02:47:05 2020 +0000 @@ -151,29 +151,39 @@ text = tx; } else { TagImpl tag; - if (tagName.equals("@exception") || tagName.equals("@throws")) { - warnIfEmpty(tagName, tx); - tag = new ThrowsTagImpl(holder, tagName, tx); - } else if (tagName.equals("@param")) { - warnIfEmpty(tagName, tx); - tag = new ParamTagImpl(holder, tagName, tx); - } else if (tagName.equals("@see")) { - warnIfEmpty(tagName, tx); - tag = new SeeTagImpl(holder, tagName, tx); - } else if (tagName.equals("@serialField")) { - warnIfEmpty(tagName, tx); - tag = new SerialFieldTagImpl(holder, tagName, tx); - } else if (tagName.equals("@return")) { - warnIfEmpty(tagName, tx); - tag = new TagImpl(holder, tagName, tx); - } else if (tagName.equals("@author")) { - warnIfEmpty(tagName, tx); - tag = new TagImpl(holder, tagName, tx); - } else if (tagName.equals("@version")) { - warnIfEmpty(tagName, tx); - tag = new TagImpl(holder, tagName, tx); - } else { - tag = new TagImpl(holder, tagName, tx); + switch (tagName) { + case "@exception": + case "@throws": + warnIfEmpty(tagName, tx); + tag = new ThrowsTagImpl(holder, tagName, tx); + break; + case "@param": + warnIfEmpty(tagName, tx); + tag = new ParamTagImpl(holder, tagName, tx); + break; + case "@see": + warnIfEmpty(tagName, tx); + tag = new SeeTagImpl(holder, tagName, tx); + break; + case "@serialField": + warnIfEmpty(tagName, tx); + tag = new SerialFieldTagImpl(holder, tagName, tx); + break; + case "@return": + warnIfEmpty(tagName, tx); + tag = new TagImpl(holder, tagName, tx); + break; + case "@author": + warnIfEmpty(tagName, tx); + tag = new TagImpl(holder, tagName, tx); + break; + case "@version": + warnIfEmpty(tagName, tx); + tag = new TagImpl(holder, tagName, tx); + break; + default: + tag = new TagImpl(holder, tagName, tx); + break; } tagList.append(tag); }
--- a/src/share/classes/com/sun/tools/javadoc/DocLocale.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javadoc/DocLocale.java Tue Nov 10 02:47:05 2020 +0000 @@ -159,12 +159,11 @@ */ private Locale searchLocale(String language, String country, String variant) { - Locale[] locales = Locale.getAvailableLocales(); - for (int i = 0; i < locales.length; i++) { - if (locales[i].getLanguage().equals(language) && - (country == null || locales[i].getCountry().equals(country)) && - (variant == null || locales[i].getVariant().equals(variant))) { - return locales[i]; + for (Locale loc : Locale.getAvailableLocales()) { + if (loc.getLanguage().equals(language) && + (country == null || loc.getCountry().equals(country)) && + (variant == null || loc.getVariant().equals(variant))) { + return loc; } } return null; @@ -231,11 +230,10 @@ * return true else return false. */ private boolean htmlSentenceTerminatorFound(String str, int index) { - for (int i = 0; i < sentenceTerminators.length; i++) { - String terminator = sentenceTerminators[i]; + for (String terminator : sentenceTerminators) { if (str.regionMatches(true, index, terminator, 0, terminator.length())) { - return true; + return true; } } return false;
--- a/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java Tue Nov 10 02:47:05 2020 +0000 @@ -210,7 +210,7 @@ Class<?>[] paramTypes = { String.class }; Object[] params = { option }; try { - retVal = invoke(methodName, new Integer(0), paramTypes, params); + retVal = invoke(methodName, 0, paramTypes, params); } catch (DocletInvokeException exc) { return -1; } @@ -308,7 +308,7 @@ if (appClassLoader != null) // will be null if doclet class provided via API Thread.currentThread().setContextClassLoader(appClassLoader); return meth.invoke(null , params); - } catch (IllegalArgumentException exc) { + } catch (IllegalArgumentException | NullPointerException exc) { messager.error(Messager.NOPOS, "main.internal_error_exception_thrown", docletClassName, methodName, exc.toString()); throw new DocletInvokeException(); @@ -316,11 +316,8 @@ messager.error(Messager.NOPOS, "main.doclet_method_not_accessible", docletClassName, methodName); throw new DocletInvokeException(); - } catch (NullPointerException exc) { - messager.error(Messager.NOPOS, "main.internal_error_exception_thrown", - docletClassName, methodName, exc.toString()); - throw new DocletInvokeException(); - } catch (InvocationTargetException exc) { + } + catch (InvocationTargetException exc) { Throwable err = exc.getTargetException(); if (apiMode) throw new ClientCodeException(err);
--- a/src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java Tue Nov 10 02:47:05 2020 +0000 @@ -385,10 +385,9 @@ private MemberDoc findReferencedMethod(String memName, String[] paramarr, ClassDoc referencedClass) { MemberDoc meth = findExecutableMember(memName, paramarr, referencedClass); - ClassDoc[] nestedclasses = referencedClass.innerClasses(); if (meth == null) { - for (int i = 0; i < nestedclasses.length; i++) { - meth = findReferencedMethod(memName, paramarr, nestedclasses[i]); + for (ClassDoc nestedClass : referencedClass.innerClasses()) { + meth = findReferencedMethod(memName, paramarr, nestedClass); if (meth != null) { return meth; }
--- a/src/share/classes/com/sun/tools/javadoc/SerializedForm.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javadoc/SerializedForm.java Tue Nov 10 02:47:05 2020 +0000 @@ -234,20 +234,19 @@ DocEnv env, ClassSymbol def) { Names names = def.name.table.names; - - SerialFieldTag[] sfTag = spfDoc.serialFieldTags(); - for (int i = 0; i < sfTag.length; i++) { - if (sfTag[i].fieldName() == null || sfTag[i].fieldType() == null) // ignore malformed @serialField tags + for (SerialFieldTag tag : spfDoc.serialFieldTags()) { + if (tag.fieldName() == null || tag.fieldType() == null) // ignore malformed @serialField tags continue; - Name fieldName = names.fromString(sfTag[i].fieldName()); + Name fieldName = names.fromString(tag.fieldName()); // Look for a FieldDocImpl that is documented by serialFieldTagImpl. - for (Scope.Entry e = def.members().lookup(fieldName); e.scope != null; e = e.next()) { + for (Scope.Entry e = def.members().lookup(fieldName); + e.scope != null; e = e.next()) { if (e.sym.kind == Kinds.VAR) { - VarSymbol f = (VarSymbol)e.sym; + VarSymbol f = (VarSymbol) e.sym; FieldDocImpl fdi = env.getFieldDoc(f); - ((SerialFieldTagImpl)(sfTag[i])).mapToFieldDocImpl(fdi); + ((SerialFieldTagImpl) (tag)).mapToFieldDocImpl(fdi); break; } }
--- a/src/share/classes/com/sun/tools/javah/JavahTool.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javah/JavahTool.java Tue Nov 10 02:47:05 2020 +0000 @@ -74,10 +74,9 @@ } public int isSupportedOption(String option) { - JavahTask.Option[] options = JavahTask.recognizedOptions; - for (int i = 0; i < options.length; i++) { - if (options[i].matches(option)) - return (options[i].hasArg ? 1 : 0); + for (JavahTask.Option opt : JavahTask.recognizedOptions) { + if (opt.matches(option)) + return (opt.hasArg ? 1 : 0); } return -1; }
--- a/src/share/classes/com/sun/tools/javah/TypeSignature.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javah/TypeSignature.java Tue Nov 10 02:47:05 2020 +0000 @@ -121,7 +121,7 @@ // Separates parameters. if (signature != null) { - if (signature.indexOf(",") != -1) { + if (signature.contains(",")) { st = new StringTokenizer(signature, ","); if (st != null) { while (st.hasMoreTokens()) { @@ -179,13 +179,13 @@ if(paramsig != null){ - if(paramsig.indexOf("[]") != -1) { + if(paramsig.contains("[]")) { // Gets array dimension. int endindex = paramsig.indexOf("[]"); componentType = paramsig.substring(0, endindex); String dimensionString = paramsig.substring(endindex); if(dimensionString != null){ - while(dimensionString.indexOf("[]") != -1){ + while(dimensionString.contains("[]")){ paramJVMSig += "["; int beginindex = dimensionString.indexOf("]") + 1; if(beginindex < dimensionString.length()){ @@ -209,29 +209,32 @@ String JVMSig = ""; if(componentType != null){ - if(componentType.equals("void")) JVMSig += SIG_VOID ; - else if(componentType.equals("boolean")) JVMSig += SIG_BOOLEAN ; - else if(componentType.equals("byte")) JVMSig += SIG_BYTE ; - else if(componentType.equals("char")) JVMSig += SIG_CHAR ; - else if(componentType.equals("short")) JVMSig += SIG_SHORT ; - else if(componentType.equals("int")) JVMSig += SIG_INT ; - else if(componentType.equals("long")) JVMSig += SIG_LONG ; - else if(componentType.equals("float")) JVMSig += SIG_FLOAT ; - else if(componentType.equals("double")) JVMSig += SIG_DOUBLE ; - else { - if(!componentType.equals("")){ - TypeElement classNameDoc = elems.getTypeElement(componentType); + switch (componentType) { + case "void": JVMSig += SIG_VOID; break; + case "boolean": JVMSig += SIG_BOOLEAN; break; + case "byte": JVMSig += SIG_BYTE; break; + case "char": JVMSig += SIG_CHAR; break; + case "short": JVMSig += SIG_SHORT; break; + case "int": JVMSig += SIG_INT; break; + case "long": JVMSig += SIG_LONG; break; + case "float": JVMSig += SIG_FLOAT; break; + case "double": JVMSig += SIG_DOUBLE; break; + default: + if (!componentType.equals("")) { + TypeElement classNameDoc = elems.getTypeElement(componentType); - if(classNameDoc == null){ - throw new SignatureException(componentType); - }else { - String classname = classNameDoc.getQualifiedName().toString(); - String newclassname = classname.replace('.', '/'); - JVMSig += "L"; - JVMSig += newclassname; - JVMSig += ";"; + if (classNameDoc == null) { + throw new SignatureException(componentType); + } + else { + String classname = classNameDoc.getQualifiedName().toString(); + String newclassname = classname.replace('.', '/'); + JVMSig += "L"; + JVMSig += newclassname; + JVMSig += ";"; + } } - } + break; } } return JVMSig;
--- a/src/share/classes/com/sun/tools/javap/AnnotationWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javap/AnnotationWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -219,8 +219,7 @@ Descriptor d = new Descriptor(index); print(d.getFieldType(constant_pool)); return; - } catch (ConstantPoolException ignore) { - } catch (InvalidDescriptor ignore) { + } catch (ConstantPoolException | InvalidDescriptor ignore) { } }
--- a/src/share/classes/com/sun/tools/javap/JavapTask.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javap/JavapTask.java Tue Nov 10 02:47:05 2020 +0000 @@ -728,8 +728,7 @@ } }; - } catch (URISyntaxException ignore) { - } catch (IOException ignore) { + } catch (URISyntaxException | IOException ignore) { } }
--- a/src/share/classes/com/sun/tools/javap/StackMapWriter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/javap/StackMapWriter.java Tue Nov 10 02:47:05 2020 +0000 @@ -82,9 +82,7 @@ ConstantPool cp = classWriter.getClassFile().constant_pool; String argString = d.getParameterTypes(cp); args = argString.substring(1, argString.length() - 1).split("[, ]+"); - } catch (ConstantPoolException e) { - return; - } catch (InvalidDescriptor e) { + } catch (ConstantPoolException | InvalidDescriptor e) { return; } boolean isStatic = m.access_flags.is(AccessFlags.ACC_STATIC);
--- a/src/share/classes/com/sun/tools/sjavac/Log.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/sjavac/Log.java Tue Nov 10 02:47:05 2020 +0000 @@ -75,11 +75,14 @@ throws ProblemException { out = o; err = e; - if (l.equals("warn")) level = WARN; - else if (l.equals("info")) level = INFO; - else if (l.equals("debug")) level = DEBUG; - else if (l.equals("trace")) level = TRACE; - else throw new ProblemException("No such log level \""+l+"\""); + switch (l) { + case "warn": level = WARN; break; + case "info": level = INFO; break; + case "debug": level = DEBUG; break; + case "trace": level = TRACE; break; + default: + throw new ProblemException("No such log level \"" + l + "\""); + } } static public boolean isTracing() {
--- a/src/share/classes/com/sun/tools/sjavac/Main.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/com/sun/tools/sjavac/Main.java Tue Nov 10 02:47:05 2020 +0000 @@ -749,8 +749,9 @@ * Look for a specific switch, return true if found. */ public static boolean findBooleanOption(String[] args, String option) { - for (int i = 0; i<args.length; ++i) { - if (args[i].equals(option)) return true; + for (String arg : args) { + if (arg.equals(option)) + return true; } return false; }
--- a/src/share/classes/javax/lang/model/SourceVersion.java Thu Nov 05 05:11:09 2020 +0000 +++ b/src/share/classes/javax/lang/model/SourceVersion.java Tue Nov 10 02:47:05 2020 +0000 @@ -158,12 +158,14 @@ try { String specVersion = System.getProperty("java.specification.version"); - if ("1.8".equals(specVersion)) - return RELEASE_8; - else if("1.7".equals(specVersion)) - return RELEASE_7; - else if("1.6".equals(specVersion)) - return RELEASE_6; + switch (specVersion) { + case "1.8": + return RELEASE_8; + case "1.7": + return RELEASE_7; + case "1.6": + return RELEASE_6; + } } catch (SecurityException se) {} return RELEASE_5;
--- a/test/com/sun/javadoc/5093723/T5093723.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/5093723/T5093723.java Tue Nov 10 02:47:05 2020 +0000 @@ -25,33 +25,24 @@ * @test * @bug 5093723 * @summary REGRESSION: ClassCastException in SingleIndexWriter - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build T5093723 * @run main T5093723 */ public class T5093723 extends JavadocTester { - private static final String BUG_ID = "5093723"; - - private static final String[] ARGS = new String[] { - "-d", BUG_ID + ".out", "-source", "5", "-Xdoclint:none", - SRC_DIR + "/DocumentedClass.java", - SRC_DIR + "/UndocumentedClass.java" - }; - - public static void main(String... args) { + public static void main(String... args) throws Exception { T5093723 tester = new T5093723(); - if (tester.runJavadoc(ARGS) != 0) - throw new AssertionError("non-zero return code from javadoc"); + tester.runTests(); } - public String getBugId() { - return BUG_ID; - } - - public String getBugName() { - return getClass().getName(); + @Test + void test() { + javadoc("-d", "out", + "-Xdoclint:none", + testSrc("DocumentedClass.java"), + testSrc("UndocumentedClass.java")); + checkExit(Exit.OK); } }
--- a/test/com/sun/javadoc/AccessAsciiArt/AccessAsciiArt.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/AccessAsciiArt/AccessAsciiArt.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,144 +26,31 @@ * @bug 4706779 4956908 * @summary Add text equivalent of class tree ASCII art for accessibility * @author dkramer + * @library ../lib + * @build JavadocTester * @run main AccessAsciiArt */ - -import com.sun.javadoc.*; -import java.util.*; -import java.io.*; - - -/** - * Runs javadoc and runs regression tests on the resulting HTML. - * It reads each file, complete with newlines, into a string to easily - * find strings that contain newlines. - */ -public class AccessAsciiArt { - - private static final String BUGID = "4706779-4956908"; - private static final String BUGNAME = "AccessAsciiArt"; - private static final String FS = System.getProperty("file.separator"); - private static final String PS = System.getProperty("path.separator"); - private static final String TMPDEST_DIR1 = "." + FS + "docs1" + FS; - private static final String TMPDEST_DIR2 = "." + FS + "docs2" + FS; +public class AccessAsciiArt extends JavadocTester { - // Subtest number. Needed because runResultsOnHTML is run twice, - // and subtestNum should increment across subtest runs. - public static int subtestNum = 0; - public static int numSubtestsPassed = 0; - - // Entry point - public static void main(String[] args) { - - // Directory that contains source files that javadoc runs on - String srcdir = System.getProperty("test.src", "."); - - // Test for all cases except the split index page - runJavadoc(new String[] {"-d", TMPDEST_DIR1, - "-sourcepath", srcdir, - "p1", "p1.subpkg"}); - runTestsOnHTML(testArray); - - printSummary(); - } - - /** Run javadoc */ - public static void runJavadoc(String[] javadocArgs) { - if (com.sun.tools.javadoc.Main.execute(javadocArgs) != 0) { - throw new Error("Javadoc failed to execute"); - } + public static void main(String... args) throws Exception { + AccessAsciiArt tester = new AccessAsciiArt(); + tester.runTests(); } - /** - * Assign value for [ stringToFind, filename ] - * NOTE: The standard doclet uses the same separator "\n" for all OS's - */ - private static final String[][] testArray = { - - // Test the top line of the class tree - { -"<li><a href=\"../../p1/C.html\" title=\"class in p1\">p1.C</a></li>", - TMPDEST_DIR1 + "p1" + FS + "subpkg" + FS + "SSC.html" }, - - // Test the second line of the class tree - { -"<li><a href=\"../../p1/SC.html\" title=\"class in p1\">p1.SC</a></li>", - TMPDEST_DIR1 + "p1" + FS + "subpkg" + FS + "SSC.html" }, - - // Test the third line of the class tree - { -"<li>p1.subpkg.SSC</li>", - TMPDEST_DIR1 + "p1" + FS + "subpkg" + FS +"SSC.html" }, - - }; - - public static void runTestsOnHTML(String[][] testArray) { - - for (int i = 0; i < testArray.length; i++) { - - subtestNum += 1; - - // Read contents of file into a string - String fileString = readFileToString(testArray[i][1]); - - // Get string to find - String stringToFind = testArray[i][0]; + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "p1", "p1.subpkg"); + checkExit(Exit.OK); - // Find string in file's contents - if (findString(fileString, stringToFind) == -1) { - System.out.println("\nSub-test " + (subtestNum) - + " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n" - + "when searching for:\n" - + stringToFind); - } else { - numSubtestsPassed += 1; - System.out.println("\nSub-test " + (subtestNum) + " passed:\n" + stringToFind); - } - } - } - - public static void printSummary() { - if ( numSubtestsPassed == subtestNum ) { - System.out.println("\nAll " + numSubtestsPassed + " subtests passed"); - } else { - throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum) - + " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n"); - } - } - - // Read the file into a String - public static String readFileToString(String filename) { - try { - File file = new File(filename); - if ( !file.exists() ) { - System.out.println("\nFILE DOES NOT EXIST: " + filename); - } - BufferedReader in = new BufferedReader(new FileReader(file)); - - // Create an array of characters the size of the file - char[] allChars = new char[(int)file.length()]; - - // Read the characters into the allChars array - in.read(allChars, 0, (int)file.length()); - in.close(); - - // Convert to a string - String allCharsString = new String(allChars); - - return allCharsString; - - } catch (FileNotFoundException e) { - System.err.println(e); - return ""; - } catch (IOException e) { - System.err.println(e); - return ""; - } - } - - public static int findString(String fileString, String stringToFind) { - return fileString.indexOf(stringToFind); + checkOutput("p1/subpkg/SSC.html", true, + // Test the top line of the class tree + "<li><a href=\"../../p1/C.html\" title=\"class in p1\">p1.C</a></li>", + // Test the second line of the class tree + "<li><a href=\"../../p1/SC.html\" title=\"class in p1\">p1.SC</a></li>", + // Test the third line of the class tree + "<li>p1.subpkg.SSC</li>"); } }
--- a/test/com/sun/javadoc/AccessFrameTitle/AccessFrameTitle.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/AccessFrameTitle/AccessFrameTitle.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,143 +26,32 @@ * @bug 4636655 * @summary Add title attribute to <FRAME> tags for accessibility * @author dkramer + * @library ../lib + * @build JavadocTester * @run main AccessFrameTitle */ - -import com.sun.javadoc.*; -import java.util.*; -import java.io.*; - - -/** - * Runs javadoc and runs regression tests on the resulting HTML. - * It reads each file, complete with newlines, into a string to easily - * find strings that contain newlines. - */ -public class AccessFrameTitle { - - private static final String BUGID = "4636655"; - private static final String BUGNAME = "AccessFrameTitle"; - private static final String FS = System.getProperty("file.separator"); - private static final String PS = System.getProperty("path.separator"); - private static final String TMPDEST_DIR1 = "." + FS + "docs1" + FS; - private static final String TMPDEST_DIR2 = "." + FS + "docs2" + FS; +public class AccessFrameTitle extends JavadocTester { - // Subtest number. Needed because runResultsOnHTML is run twice, - // and subtestNum should increment across subtest runs. - public static int subtestNum = 0; - public static int numSubtestsPassed = 0; - - // Entry point - public static void main(String[] args) { - - // Directory that contains source files that javadoc runs on - String srcdir = System.getProperty("test.src", "."); - - // Test for all cases except the split index page - runJavadoc(new String[] {"-d", TMPDEST_DIR1, - "-sourcepath", srcdir, - "p1", "p2"}); - runTestsOnHTML(testArray); - - printSummary(); - } - - /** Run javadoc */ - public static void runJavadoc(String[] javadocArgs) { - if (com.sun.tools.javadoc.Main.execute(javadocArgs) != 0) { - throw new Error("Javadoc failed to execute"); - } + public static void main(String... args) throws Exception { + AccessFrameTitle tester = new AccessFrameTitle(); + tester.runTests(); } - /** - * Assign value for [ stringToFind, filename ] - * NOTE: The standard doclet uses the same separator "\n" for all OS's - */ - private static final String[][] testArray = { - - // Testing only for the presence of the title attributes. - // To make this test more robust, only - // the initial part of each title string is tested for, - // in case the ending part of the string later changes - - { "title=\"All classes and interfaces (except non-static nested types)\"", - TMPDEST_DIR1 + "index.html" }, - - { "title=\"All Packages\"", - TMPDEST_DIR1 + "index.html" }, - - { "title=\"Package, class and interface descriptions\"", - TMPDEST_DIR1 + "index.html" }, - - }; - - public static void runTestsOnHTML(String[][] testArray) { - - for (int i = 0; i < testArray.length; i++) { - - subtestNum += 1; - - // Read contents of file into a string - String fileString = readFileToString(testArray[i][1]); - - // Get string to find - String stringToFind = testArray[i][0]; + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "p1", "p2"); + checkExit(Exit.OK); - // Find string in file's contents - if (findString(fileString, stringToFind) == -1) { - System.out.println("\nSub-test " + (subtestNum) - + " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n" - + "when searching for:\n" - + stringToFind); - } else { - numSubtestsPassed += 1; - System.out.println("\nSub-test " + (subtestNum) + " passed:\n" + stringToFind); - } - } - } - - public static void printSummary() { - if ( numSubtestsPassed == subtestNum ) { - System.out.println("\nAll " + numSubtestsPassed + " subtests passed"); - } else { - throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum) - + " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n"); - } - } - - // Read the file into a String - public static String readFileToString(String filename) { - try { - File file = new File(filename); - if ( !file.exists() ) { - System.out.println("\nFILE DOES NOT EXIST: " + filename); - } - BufferedReader in = new BufferedReader(new FileReader(file)); - - // Create an array of characters the size of the file - char[] allChars = new char[(int)file.length()]; - - // Read the characters into the allChars array - in.read(allChars, 0, (int)file.length()); - in.close(); - - // Convert to a string - String allCharsString = new String(allChars); - - return allCharsString; - - } catch (FileNotFoundException e) { - System.err.println(e); - return ""; - } catch (IOException e) { - System.err.println(e); - return ""; - } - } - - public static int findString(String fileString, String stringToFind) { - return fileString.indexOf(stringToFind); + // Testing only for the presence of the title attributes. + // To make this test more robust, only + // the initial part of each title string is tested for, + // in case the ending part of the string later changes + checkOutput("index.html", true, + "title=\"All classes and interfaces (except non-static nested types)\"", + "title=\"All Packages\"", + "title=\"Package, class and interface descriptions\""); } }
--- a/test/com/sun/javadoc/AccessH1/AccessH1.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/AccessH1/AccessH1.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,141 +26,35 @@ * @bug 4636667 7052425 8016549 * @summary Use <H1, <H2>, and <H3> in proper sequence for accessibility * @author dkramer + * @library ../lib + * @build JavadocTester * @run main AccessH1 */ -import com.sun.javadoc.*; -import java.util.*; -import java.io.*; - - -/** - * Runs javadoc and runs regression tests on the resulting HTML. - * It reads each file, complete with newlines, into a string to easily - * find strings that contain newlines. - */ -public class AccessH1 { - - private static final String BUGID = "4636667-7052425"; - private static final String BUGNAME = "AccessH1"; - private static final String FS = System.getProperty("file.separator"); - private static final String PS = System.getProperty("path.separator"); - private static final String LS = System.getProperty("line.separator"); - private static final String TMPDEST_DIR1 = "." + FS + "docs1" + FS; - private static final String TMPDEST_DIR2 = "." + FS + "docs2" + FS; +public class AccessH1 extends JavadocTester { - // Subtest number. Needed because runResultsOnHTML is run twice, - // and subtestNum should increment across subtest runs. - public static int subtestNum = 0; - public static int numSubtestsPassed = 0; - - // Entry point - public static void main(String[] args) { - - // Directory that contains source files that javadoc runs on - String srcdir = System.getProperty("test.src", "."); - - // Test for all cases except the split index page - runJavadoc(new String[] {"-d", TMPDEST_DIR1, - "-doctitle", "Document Title", - "-sourcepath", srcdir, - "p1", "p2"}); - runTestsOnHTML(testArray); - - printSummary(); - } - - /** Run javadoc */ - public static void runJavadoc(String[] javadocArgs) { - if (com.sun.tools.javadoc.Main.execute(javadocArgs) != 0) { - throw new Error("Javadoc failed to execute"); - } + public static void main(String... args) throws Exception { + AccessH1 tester = new AccessH1(); + tester.runTests(); } - /** - * Assign value for [ stringToFind, filename ] - * NOTE: The standard doclet uses the same separator "\n" for all OS's - */ - private static final String[][] testArray = { - // Test the style sheet - { - "h1 {" + LS + " font-size:20px;" + LS + - "}", - TMPDEST_DIR1 + "stylesheet.css" - }, - // Test the doc title in the overview page - { - "<h1 class=\"title\">Document Title</h1>", - TMPDEST_DIR1 + "overview-summary.html" - } - }; - - public static void runTestsOnHTML(String[][] testArray) { - - for (int i = 0; i < testArray.length; i++) { - - subtestNum += 1; - - // Read contents of file into a string - String fileString = readFileToString(testArray[i][1]); - - // Get string to find - String stringToFind = testArray[i][0]; + @Test + void test() { + javadoc("-d", "out", + "-doctitle", "Document Title", + "-sourcepath", testSrc, + "p1", "p2"); + checkExit(Exit.OK); - // Find string in file's contents - if (findString(fileString, stringToFind) == -1) { - System.out.println("\nSub-test " + (subtestNum) - + " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n" - + "when searching for:\n" - + stringToFind); - } else { - numSubtestsPassed += 1; - System.out.println("\nSub-test " + (subtestNum) + " passed:\n" + stringToFind); - } - } - } - - public static void printSummary() { - if ( numSubtestsPassed == subtestNum ) { - System.out.println("\nAll " + numSubtestsPassed + " subtests passed"); - } else { - throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum) - + " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n"); - } - } + // Test the style sheet + checkOutput("stylesheet.css", true, + "h1 {\n" + + " font-size:20px;\n" + + "}"); - // Read the file into a String - public static String readFileToString(String filename) { - try { - File file = new File(filename); - if ( !file.exists() ) { - System.out.println("\nFILE DOES NOT EXIST: " + filename); - } - BufferedReader in = new BufferedReader(new FileReader(file)); - - // Create an array of characters the size of the file - char[] allChars = new char[(int)file.length()]; - - // Read the characters into the allChars array - in.read(allChars, 0, (int)file.length()); - in.close(); - - // Convert to a string - String allCharsString = new String(allChars); - - return allCharsString; - - } catch (FileNotFoundException e) { - System.err.println(e); - return ""; - } catch (IOException e) { - System.err.println(e); - return ""; - } - } - - public static int findString(String fileString, String stringToFind) { - return fileString.indexOf(stringToFind); + // Test the doc title in the overview page + checkOutput("overview-summary.html", true, + "<h1 class=\"title\">Document Title</h1>"); } }
--- a/test/com/sun/javadoc/AccessSkipNav/AccessSkipNav.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/AccessSkipNav/AccessSkipNav.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,149 +26,40 @@ * @bug 4638136 7198273 8025633 * @summary Add ability to skip over nav bar for accessibility * @author dkramer + * @library ../lib + * @build JavadocTester * @run main AccessSkipNav */ - -import com.sun.javadoc.*; -import java.util.*; -import java.io.*; - - -/** - * Runs javadoc and runs regression tests on the resulting HTML. - * It reads each file, complete with newlines, into a string to easily - * find strings that contain newlines. - */ -public class AccessSkipNav { - - private static final String BUGID = "4638136 - 7198273"; - private static final String BUGNAME = "AccessSkipNav"; - private static final String FS = System.getProperty("file.separator"); - private static final String PS = System.getProperty("path.separator"); - private static final String LS = System.getProperty("line.separator"); - private static final String TMPDEST_DIR1 = "." + FS + "docs1" + FS; - private static final String TMPDEST_DIR2 = "." + FS + "docs2" + FS; +public class AccessSkipNav extends JavadocTester { - // Subtest number. Needed because runResultsOnHTML is run twice, - // and subtestNum should increment across subtest runs. - public static int subtestNum = 0; - public static int numSubtestsPassed = 0; - - // Entry point - public static void main(String[] args) { - - // Directory that contains source files that javadoc runs on - String srcdir = System.getProperty("test.src", "."); - - // Test for all cases except the split index page - runJavadoc(new String[] {"-d", TMPDEST_DIR1, - "-sourcepath", srcdir, - "p1", "p2"}); - runTestsOnHTML(testArray); - - printSummary(); - } - - /** Run javadoc */ - public static void runJavadoc(String[] javadocArgs) { - if (com.sun.tools.javadoc.Main.execute(javadocArgs) != 0) { - throw new Error("Javadoc failed to execute"); - } + public static void main(String... args) throws Exception { + AccessSkipNav tester = new AccessSkipNav(); + tester.runTests(); } - /** - * Assign value for [ stringToFind, filename ] - * NOTE: The standard doclet uses the same separator "\n" for all OS's - */ - private static final String[][] testArray = { - - // Testing only for the presence of the <a href> and <a name> - - // Top navbar <a href> - { "<a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a>", - TMPDEST_DIR1 + "p1" + FS + "C1.html" }, - - // Top navbar <a name> - { "<a name=\"skip.navbar.top\">" + LS + - "<!-- -->" + LS + "</a>", - TMPDEST_DIR1 + "p1" + FS + "C1.html" }, - - // Bottom navbar <a href> - { "<a href=\"#skip.navbar.bottom\" title=\"Skip navigation links\">Skip navigation links</a>", - TMPDEST_DIR1 + "p1" + FS + "C1.html" }, - - // Bottom navbar <a name> - { "<a name=\"skip.navbar.bottom\">" + LS + - "<!-- -->" + LS + "</a>", - TMPDEST_DIR1 + "p1" + FS + "C1.html" } - }; - - public static void runTestsOnHTML(String[][] testArray) { - - for (int i = 0; i < testArray.length; i++) { - - subtestNum += 1; - - // Read contents of file into a string - String fileString = readFileToString(testArray[i][1]); - - // Get string to find - String stringToFind = testArray[i][0]; + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "p1", "p2"); + checkExit(Exit.OK); - // Find string in file's contents - if (findString(fileString, stringToFind) == -1) { - System.out.println("\nSub-test " + (subtestNum) - + " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n" - + "when searching for:\n" - + stringToFind); - } else { - numSubtestsPassed += 1; - System.out.println("\nSub-test " + (subtestNum) + " passed:\n" + stringToFind); - } - } - } - - public static void printSummary() { - if ( numSubtestsPassed == subtestNum ) { - System.out.println("\nAll " + numSubtestsPassed + " subtests passed"); - } else { - throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum) - + " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n"); - } - } + // Testing only for the presence of the <a href> and <a name> + checkOutput("p1/C1.html", true, + // Top navbar <a href> + "<a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a>", + // Top navbar <a name> + "<a name=\"skip.navbar.top\">\n" + + "<!-- -->\n" + + "</a>", + // Bottom navbar <a href> + "<a href=\"#skip.navbar.bottom\" title=\"Skip navigation links\">Skip navigation links</a>", + // Bottom navbar <a name> + "<a name=\"skip.navbar.bottom\">\n" + + "<!-- -->\n" + + "</a>"); - // Read the file into a String - public static String readFileToString(String filename) { - try { - File file = new File(filename); - if ( !file.exists() ) { - System.out.println("\nFILE DOES NOT EXIST: " + filename); - } - BufferedReader in = new BufferedReader(new FileReader(file)); - // Create an array of characters the size of the file - char[] allChars = new char[(int)file.length()]; - - // Read the characters into the allChars array - in.read(allChars, 0, (int)file.length()); - in.close(); - - // Convert to a string - String allCharsString = new String(allChars); - - return allCharsString; - - } catch (FileNotFoundException e) { - System.err.println(e); - return ""; - } catch (IOException e) { - System.err.println(e); - return ""; - } - } - - public static int findString(String fileString, String stringToFind) { - return fileString.indexOf(stringToFind); } }
--- a/test/com/sun/javadoc/AccessSummary/AccessSummary.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/AccessSummary/AccessSummary.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,62 +26,35 @@ * @bug 4637604 4775148 * @summary Test the tables for summary attribute * @author dkramer - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build AccessSummary * @run main AccessSummary */ public class AccessSummary extends JavadocTester { - - private static final String BUG_ID = "4637604-4775148"; - private static final String OUTPUT_DIR1 = "docs1-" + BUG_ID + FS; - - /** - * Assign value for [ fileToSearch, stringToFind ] - */ - private static final String[][] TESTARRAY1 = { - - // Test that the summary attribute appears - { OUTPUT_DIR1 + "overview-summary.html", - "summary=\"Packages table, listing packages, and an explanation\"" }, - - // Test that the summary attribute appears - { OUTPUT_DIR1 + "p1" + FS + "C1.html", - "summary=\"Constructor Summary table, listing constructors, and an explanation\"" }, - - // Test that the summary attribute appears - { OUTPUT_DIR1 + "constant-values.html", - "summary=\"Constant Field Values table, listing constant fields, and values\"" } - }; - - // First test with -header only - private static final String[] JAVADOC_ARGS = new String[] { - "-d", OUTPUT_DIR1, - "-sourcepath", SRC_DIR, - "p1", "p2"}; - /** * The entry point of the test. * @param args the array of command line arguments. + * @throws Exception if the test fails */ - public static void main(String[] args) { - JavadocTester tester = new AccessSummary(); - run(tester, JAVADOC_ARGS, TESTARRAY1, new String[][] {}); - tester.printSummary(); // Necessary for string search + public static void main(String... args) throws Exception { + AccessSummary tester = new AccessSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void testAccessSummary() { + javadoc("-d", "out", "-sourcepath", testSrc, "p1", "p2"); + checkExit(Exit.OK); + checkOutput("overview-summary.html", true, + "summary=\"Packages table, listing packages, and an explanation\""); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + // Test that the summary attribute appears + checkOutput("p1/C1.html", true, + "summary=\"Constructor Summary table, listing constructors, and an explanation\""); + + // Test that the summary attribute appears + checkOutput("constant-values.html", true, + "summary=\"Constant Field Values table, listing constant fields, and values\""); } }
--- a/test/com/sun/javadoc/AuthorDD/AuthorDD.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/AuthorDD/AuthorDD.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,141 +26,37 @@ * @bug 4651598 8026567 * @summary Javadoc wrongly inserts </DD> tags when using multiple @author tags * @author dkramer + * @library ../lib + * @build JavadocTester * @run main AuthorDD */ - -import com.sun.javadoc.*; -import java.util.*; -import java.io.*; - - /** * Runs javadoc and runs regression tests on the resulting HTML. - * It reads each file, complete with newlines, into a string to easily - * find strings that contain newlines. */ -public class AuthorDD -{ - private static final String BUGID = "4651598"; - private static final String BUGNAME = "AuthorDD"; - private static final String FS = System.getProperty("file.separator"); - private static final String PS = System.getProperty("path.separator"); - private static final String NL = System.getProperty("line.separator"); - - // Subtest number. Needed because runResultsOnHTML is run twice, and subtestNum - // should increment across subtest runs. - public static int subtestNum = 0; - public static int numSubtestsPassed = 0; - - // Entry point - public static void main(String[] args) { +public class AuthorDD extends JavadocTester { - // Directory that contains source files that javadoc runs on - String srcdir = System.getProperty("test.src", "."); - - // Test for all cases except the split index page - runJavadoc(new String[] {"-d", BUGID, - "-author", - "-version", - "-sourcepath", srcdir, - "p1"}); - runTestsOnHTML(testArray); - - printSummary(); - } - - /** Run javadoc */ - public static void runJavadoc(String[] javadocArgs) { - if (com.sun.tools.javadoc.Main.execute(AuthorDD.class.getClassLoader(), - javadocArgs) != 0) { - throw new Error("Javadoc failed to execute"); - } + public static void main(String... args) throws Exception { + AuthorDD tester = new AuthorDD(); + tester.runTests(); } - /** - * Assign value for [ stringToFind, filename ] - * NOTE: The standard doclet uses the same separator "\n" for all OS's - */ - private static final String[][] testArray = { - - // Test single @since tag: - - { "<dt><span class=\"simpleTagLabel\">Since:</span></dt>"+NL+"<dd>JDK 1.0</dd>", - BUGID + FS + "p1" + FS + "C1.html" }, - - // Test multiple @author tags: - - { "<dt><span class=\"simpleTagLabel\">Author:</span></dt>"+NL+"<dd>Doug Kramer, Jamie, Neal</dd>", - BUGID + FS + "p1" + FS + "C1.html" }, - - }; - - public static void runTestsOnHTML(String[][] testArray) { - - for (int i = 0; i < testArray.length; i++) { - - subtestNum += 1; - - // Read contents of file into a string - String fileString = readFileToString(testArray[i][1]); - - // Get string to find - String stringToFind = testArray[i][0]; + @Test + void test() { + // Test for all cases except the split index page + javadoc("-d", "out", + "-author", + "-version", + "-sourcepath", testSrc, + "p1"); + checkExit(Exit.OK); - // Find string in file's contents - if (findString(fileString, stringToFind) == -1) { - System.out.println("\nSub-test " + (subtestNum) - + " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n" - + "when searching for:\n" - + stringToFind); - } else { - numSubtestsPassed += 1; - System.out.println("\nSub-test " + (subtestNum) + " passed:\n" + stringToFind); - } - } - } - - public static void printSummary() { - if ( numSubtestsPassed == subtestNum ) { - System.out.println("\nAll " + numSubtestsPassed + " subtests passed"); - } else { - throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum) - + " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n"); - } - } - - // Read the file into a String - public static String readFileToString(String filename) { - try { - File file = new File(filename); - if ( !file.exists() ) { - System.out.println("\nFILE DOES NOT EXIST: " + filename); - } - BufferedReader in = new BufferedReader(new FileReader(file)); - - // Create an array of characters the size of the file - char[] allChars = new char[(int)file.length()]; - - // Read the characters into the allChars array - in.read(allChars, 0, (int)file.length()); - in.close(); - - // Convert to a string - String allCharsString = new String(allChars); - - return allCharsString; - - } catch (FileNotFoundException e) { - System.err.println(e); - return ""; - } catch (IOException e) { - System.err.println(e); - return ""; - } - } - - public static int findString(String fileString, String stringToFind) { - return fileString.indexOf(stringToFind); + checkOutput("p1/C1.html", true, + // Test single @since tag: + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" + + "<dd>JDK 1.0</dd>", + // Test multiple @author tags: + "<dt><span class=\"simpleTagLabel\">Author:</span></dt>\n" + + "<dd>Doug Kramer, Jamie, Neal</dd>"); } }
--- a/test/com/sun/javadoc/DocRootSlash/DocRootSlash.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/DocRootSlash/DocRootSlash.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,13 +26,11 @@ * @bug 4524350 4662945 4633447 * @summary stddoclet: {@docRoot} inserts an extra trailing "/" * @author dkramer + * @library ../lib + * @build JavadocTester * @run main DocRootSlash */ -import com.sun.javadoc.*; -import java.util.*; -import java.io.*; -import java.nio.*; import java.util.regex.*; /** @@ -40,151 +38,55 @@ * It reads each file, complete with newlines, into a string to easily * find strings that contain newlines. */ -public class DocRootSlash -{ - private static final String BUGID = "4524350, 4662945, or 4633447"; - private static final String BUGNAME = "DocRootSlash"; - private static final String FS = System.getProperty("file.separator"); - private static final String PS = System.getProperty("path.separator"); - private static final String TMPDIR_STRING1 = "." + FS + "docs1" + FS; +public class DocRootSlash extends JavadocTester { - // Test number. Needed because runResultsOnHTMLFile is run twice, and subtestNum - // should increment across test runs. - public static int subtestNum = 0; - public static int numOfSubtestsPassed = 0; + public static void main(String... args) throws Exception { + DocRootSlash tester = new DocRootSlash(); + tester.runTests(); + } - // Entry point - public static void main(String[] args) { - + @Test + void test() { // Directory that contains source files that javadoc runs on String srcdir = System.getProperty("test.src", "."); - runJavadoc(new String[] {"-d", TMPDIR_STRING1, - "-Xdoclint:none", - "-overview", (srcdir + FS + "overview.html"), - "-header", "<A HREF=\"{@docroot}/package-list\">{@docroot}</A> <A HREF=\"{@docRoot}/help-doc\">{@docRoot}</A>", - "-sourcepath", srcdir, - "p1", "p2"}); - runTestsOnHTMLFiles(filenameArray); - - printSummary(); - } - - /** Run javadoc */ - public static void runJavadoc(String[] javadocArgs) { - if (com.sun.tools.javadoc.Main.execute(javadocArgs) != 0) { - throw new Error("Javadoc failed to execute"); - } - } + javadoc("-d", "out", + "-Xdoclint:none", + "-overview", (srcdir + "/overview.html"), + "-header", "<A HREF=\"{@docroot}/package-list\">{@docroot}</A> <A HREF=\"{@docRoot}/help-doc\">{@docRoot}</A>", + "-sourcepath", srcdir, + "p1", "p2"); - /** The array of filenames to test */ - private static final String[] filenameArray = { - TMPDIR_STRING1 + "p1" + FS + "C1.html" , - TMPDIR_STRING1 + "p1" + FS + "package-summary.html", - TMPDIR_STRING1 + "overview-summary.html" - }; - - public static void runTestsOnHTMLFiles(String[] filenameArray) { - String fileString; - - // Bugs 4524350 4662945 - for (int i = 0; i < filenameArray.length; i++ ) { - - // Read contents of file (whose filename is in filenames) into a string - fileString = readFileToString(filenameArray[i]); - - System.out.println("\nSub-tests for file: " + filenameArray[i] - + " --------------"); - - // Loop over all tests in a single file - for ( int j = 0; j < 11; j++ ) { - subtestNum += 1; - - // Compare actual to expected string for a single subtest - compareActualToExpected(fileString); - } - } + checkFiles( + "p1/C1.html" , + "p1/package-summary.html", + "overview-summary.html"); // Bug 4633447: Special test for overview-frame.html // Find two strings in file "overview-frame.html" - String filename = TMPDIR_STRING1 + "overview-frame.html"; - fileString = readFileToString(filename); - - // Find first string <A HREF="./package-list"> in overview-frame.html - subtestNum += 1; - String stringToFind = "<A HREF=\"./package-list\">"; - String result; - if ( fileString.indexOf(stringToFind) == -1 ) { - result = "FAILED"; - } else { - result = "succeeded"; - numOfSubtestsPassed += 1; - } - System.out.println("\nSub-test " + (subtestNum) - + " for bug " + BUGID + " (" + BUGNAME + ") " + result + "\n" - + "when searching for:\n" - + stringToFind + "\n" - + "in file " + filename); - - // Find second string <A HREF="./help-doc"> in overview-frame.html - subtestNum += 1; - stringToFind = "<A HREF=\"./help-doc\">"; - if ( fileString.indexOf(stringToFind) == -1 ) { - result = "FAILED"; - } else { - result = "succeeded"; - numOfSubtestsPassed += 1; - } - System.out.println("\nSub-test " + (subtestNum) - + " for bug " + BUGID + " (" + BUGNAME + ") " + result + "\n" - + "when searching for:\n" - + stringToFind + "\n" - + "in file " + filename); + checkOutput("overview-frame.html", true, + "<A HREF=\"./package-list\">", + "<A HREF=\"./help-doc\">"); } - public static void printSummary() { - System.out.println(""); - if ( numOfSubtestsPassed == subtestNum ) { - System.out.println("\nAll " + numOfSubtestsPassed + " subtests passed"); - } else { - throw new Error("\n" + (subtestNum - numOfSubtestsPassed) + " of " + (subtestNum) - + " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n"); - } - } - - // Read the contents of the file into a String - public static String readFileToString(String filename) { - try { - File file = new File(filename); - if ( !file.exists() ) { - System.out.println("\nFILE DOES NOT EXIST: " + filename); - } + void checkFiles(String... filenameArray) { + int count = 0; - BufferedReader in = new BufferedReader(new FileReader(file)); - - // Create an array of characters the size of the file - char[] allChars = new char[(int)file.length()]; - - // Read the characters into the allChars array - in.read(allChars, 0, (int)file.length()); - in.close(); + for (String f : filenameArray) { + // Read contents of file into a string + String fileString = readFile(f); + System.out.println("\nSub-tests for file: " + f + " --------------"); + // Loop over all tests in a single file + for ( int j = 0; j < 11; j++ ) { - // Convert to a string - String allCharsString = new String(allChars); - - return allCharsString; - } catch (FileNotFoundException e) { - System.err.println(e); - return ""; - } catch (IOException e) { - System.err.println(e); - return ""; + // Compare actual to expected string for a single subtest + compareActualToExpected(++count, fileString); + } } } /** - * Regular expression pattern matching code adapted from Eric's - * /java/pubs/dev/linkfix/src/LinkFix.java + * Regular expression pattern matching code * * Prefix Pattern: * flag (?i) (case insensitive, so "a href" == "A HREF" and all combinations) @@ -199,34 +101,33 @@ * group4 (.*?) (label - zero or more characters) * group5 (</a>) (end tag) */ - static String prefix = "(?i)(<a\\s+href="; // <a href= (start group1) - static String ref1 = "\")([^\"]*)(\".*?>)"; // doublequotes (end group1, group2, group3) - static String ref2 = ")(\\S+?)([^<>]*>)"; // no quotes (end group1, group2, group3) - static String label = "(.*?)"; // text label (group4) - static String end = "(</a>)"; // </a> (group5) + private static final String prefix = "(?i)(<a\\s+href="; // <a href= (start group1) + private static final String ref1 = "\")([^\"]*)(\".*?>)"; // doublequotes (end group1, group2, group3) + private static final String ref2 = ")(\\S+?)([^<>]*>)"; // no quotes (end group1, group2, group3) + private static final String label = "(.*?)"; // text label (group4) + private static final String end = "(</a>)"; // </a> (group5) /** * Compares the actual string to the expected string in the specified string - * str String to search through + * @param str String to search through */ - static void compareActualToExpected(String str) { - // Pattern must be compiled each run because subtestNum is incremented + void compareActualToExpected(int count, String str) { + checking("comparison for " + str); + + // Pattern must be compiled each run because numTestsRun is incremented Pattern actualLinkPattern1 = - Pattern.compile("Sub-test " + subtestNum + " Actual: " + prefix + ref1, Pattern.DOTALL); + Pattern.compile("Sub-test " + count + " Actual: " + prefix + ref1, Pattern.DOTALL); Pattern expectLinkPattern1 = - Pattern.compile("Sub-test " + subtestNum + " Expect: " + prefix + ref1, Pattern.DOTALL); + Pattern.compile("Sub-test " + count + " Expect: " + prefix + ref1, Pattern.DOTALL); // Pattern linkPattern2 = Pattern.compile(prefix + ref2 + label + end, Pattern.DOTALL); - CharBuffer charBuffer = CharBuffer.wrap(str); - Matcher actualLinkMatcher1 = actualLinkPattern1.matcher(charBuffer); - Matcher expectLinkMatcher1 = expectLinkPattern1.matcher(charBuffer); - String result; - if ( expectLinkMatcher1.find() && actualLinkMatcher1.find() ) { + Matcher actualLinkMatcher1 = actualLinkPattern1.matcher(str); + Matcher expectLinkMatcher1 = expectLinkPattern1.matcher(str); + if (expectLinkMatcher1.find() && actualLinkMatcher1.find()) { String expectRef = expectLinkMatcher1.group(2); String actualRef = actualLinkMatcher1.group(2); - if ( actualRef.equals(expectRef) ) { - result = "succeeded"; - numOfSubtestsPassed += 1; + if (actualRef.equals(expectRef)) { + passed(expectRef); // System.out.println("pattern: " + actualLinkPattern1.pattern()); // System.out.println("actualRef: " + actualRef); // System.out.println("group0: " + actualLinkMatcher1.group()); @@ -235,15 +136,13 @@ // System.out.println("group3: " + actualLinkMatcher1.group(3)); // System.exit(0); } else { - result = "FAILED"; + failed("\n" + + "Actual: \"" + actualRef + "\"\n" + + "Expect: \"" + expectRef + "\""); } - System.out.println("\nSub-test " + (subtestNum) - + " for bug " + BUGID + " (" + BUGNAME + ") " + result + "\n" - + "Actual: \"" + actualRef + "\"" + "\n" - + "Expect: \"" + expectRef + "\""); } else { - System.out.println("Didn't find <A HREF> that fits the pattern: " - + expectLinkPattern1.pattern() ); + failed("Didn't find <A HREF> that fits the pattern: " + + expectLinkPattern1.pattern()); } } }
--- a/test/com/sun/javadoc/InheritDocForUserTags/DocTest.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/InheritDocForUserTags/DocTest.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,11 +26,11 @@ * @bug 8008768 * @summary Using {@inheritDoc} in simple tag defined via -tag fails * @author Mike Duigou + * @library ../lib + * @build JavadocTester * @run main DocTest */ -import java.io.*; - /** * DocTest documentation. * @@ -38,41 +38,27 @@ * @implSpec DocTest implementation spec. * @implNote DocTest implementation note. */ -public class DocTest { +public class DocTest extends JavadocTester { public static void main(String... args) throws Exception { - String[] javadoc_args = { - "-verbose", - "-d", "DocTest", - "-tag", "apiNote:optcm:<em>API Note</em>", - "-tag", "implSpec:optcm:<em>Implementation Requirements</em>:", - "-tag", "implNote:optcm:<em>Implementation Note</em>:", - "-package", - new File(System.getProperty("test.src"), "DocTest.java").getPath() - }; + DocTest tester = new DocTest(); + tester.runTests(); + } + + @Test + void test() { + javadoc("-verbose", + "-d", "DocTest", + "-tag", "apiNote:optcm:<em>API Note</em>", + "-tag", "implSpec:optcm:<em>Implementation Requirements</em>:", + "-tag", "implNote:optcm:<em>Implementation Note</em>:", + "-package", + testSrc("DocTest.java") + ); + checkExit(Exit.OK); // javadoc does not report an exit code for an internal exception (!) // so monitor stderr for stack dumps. - PrintStream prevErr = System.err; - ByteArrayOutputStream err_baos = new ByteArrayOutputStream(); - PrintStream err_ps = new PrintStream(err_baos); - System.setErr(err_ps); - - int rc; - try { - rc = com.sun.tools.javadoc.Main.execute(javadoc_args); - } finally { - err_ps.close(); - System.setErr(prevErr); - } - - String err = err_baos.toString(); - System.err.println(err); - - if (rc != 0) - throw new Exception("javadoc exited with rc=" + rc); - - if (err.contains("at com.sun.")) - throw new Exception("javadoc output contains stack trace"); + checkOutput(Output.STDERR, false, "at com.sun"); } /**
--- a/test/com/sun/javadoc/JavascriptWinTitle/JavascriptWinTitle.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/JavascriptWinTitle/JavascriptWinTitle.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,171 +27,49 @@ * @summary Javascript IE load error when linked by -linkoffline * Window title shouldn't change when loading left frames (javascript) * @author dkramer + * @library ../lib + * @build JavadocTester * @run main JavascriptWinTitle */ - -import com.sun.javadoc.*; -import java.util.*; -import java.io.*; - - -/** - * Runs javadoc and runs regression tests on the resulting HTML. - * It reads each file, complete with newlines, into a string to easily - * find strings that contain newlines. - */ -public class JavascriptWinTitle { - - private static final String BUGID = "4645058"; - private static final String BUGNAME = "JavascriptWinTitle"; - private static final String FS = System.getProperty("file.separator"); - private static final String PS = System.getProperty("path.separator"); - private static final String LS = System.getProperty("line.separator"); - private static final String TMPDEST_DIR1 = "." + FS + "docs1" + FS; - private static final String TMPDEST_DIR2 = "." + FS + "docs2" + FS; - - // Subtest number. Needed because runResultsOnHTML is run twice, - // and subtestNum should increment across subtest runs. - public static int subtestNum = 0; - public static int numSubtestsPassed = 0; +public class JavascriptWinTitle extends JavadocTester { - // Entry point - public static void main(String[] args) { - - // Directory that contains source files that javadoc runs on - String srcdir = System.getProperty("test.src", "."); - - // Test for all cases except the split index page - runJavadoc(new String[] {"-d", TMPDEST_DIR1, - "-doctitle", "Document Title", - "-windowtitle", "Window Title", - "-overview", (srcdir + FS + "overview.html"), - "-linkoffline", - "http://java.sun.com/j2se/1.4/docs/api", srcdir, - "-sourcepath", srcdir, - "p1", "p2"}); - runTestsOnHTML(testArray); - - printSummary(); - } - - /** Run javadoc */ - public static void runJavadoc(String[] javadocArgs) { - if (com.sun.tools.javadoc.Main.execute(javadocArgs) != 0) { - throw new Error("Javadoc failed to execute"); - } + public static void main(String... args) throws Exception { + JavascriptWinTitle tester = new JavascriptWinTitle(); + tester.runTests(); } - /** - * Assign value for [ stringToFind, filename ] - * NOTE: The standard doclet uses the same separator "\n" for all OS's - */ - private static final String[][] testArray = { - - // Test the javascript "type" attribute is present: - { "<script type=\"text/javascript\">", - TMPDEST_DIR1 + "overview-summary.html" }, - - // Test onload is absent: - { "<body>", - TMPDEST_DIR1 + "overview-summary.html" }, - - // Test onload is present: - { "<body>", - TMPDEST_DIR1 + FS + "p1" + FS + "package-summary.html" }, - - // Test that "onload" is not present in BODY tag: - { "<body>", - TMPDEST_DIR1 + "overview-frame.html" }, - - // Test that "onload" is not present in BODY tag: - { "<body>", - TMPDEST_DIR1 + "allclasses-frame.html" }, - - // Test that "onload" is not present in BODY tag: - { "<body>", - TMPDEST_DIR1 + FS + "p1" + FS + "package-frame.html" }, - - // Test that win title javascript is followed by NOSCRIPT code. - {"<script type=\"text/javascript\"><!--" + LS + - " try {" + LS + - " if (location.href.indexOf('is-external=true') == -1) {" + LS + - " parent.document.title=\"C (Window Title)\";" + LS + - " }" + LS + - " }" + LS + - " catch(err) {" + LS + - " }" + LS + "//-->" + LS + "</script>", - TMPDEST_DIR1 + FS + "p1" + FS + "C.html" - } - - }; - - public static void runTestsOnHTML(String[][] testArray) { - - for (int i = 0; i < testArray.length; i++) { - - subtestNum += 1; - - // Read contents of file into a string - String fileString = readFileToString(testArray[i][1]); + @Test + void test() { + javadoc("-d", "out", + "-doctitle", "Document Title", + "-windowtitle", "Window Title", + "-overview", testSrc("overview.html"), + "-linkoffline", "http://java.sun.com/j2se/1.4/docs/api", testSrc, + "-sourcepath", testSrc, + "p1", "p2"); + checkExit(Exit.OK); + checkOutput("overview-summary.html", true, + "<script type=\"text/javascript\">", + "<body>"); - // Get string to find - String stringToFind = testArray[i][0]; - - // Find string in file's contents - if (findString(fileString, stringToFind) == -1) { - System.out.println("\nSub-test " + (subtestNum) - + " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n" - + "when searching for:\n" - + stringToFind); - } else { - numSubtestsPassed += 1; - System.out.println("\nSub-test " + (subtestNum) + " passed:\n" + stringToFind); - } - } - } - - public static void printSummary() { - if ( numSubtestsPassed == subtestNum ) { - System.out.println("\nAll " + numSubtestsPassed + " subtests passed"); - } else { - throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum) - + " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n"); - } - } + // Test that "onload" is not present in BODY tag: + checkOutput("p1/package-summary.html", true, "<body>"); + checkOutput("overview-frame.html", true, "<body>"); + checkOutput("allclasses-frame.html", true, "<body>"); + checkOutput("p1/package-frame.html", true, "<body>"); - // Read the file into a String - public static String readFileToString(String filename) { - try { - File file = new File(filename); - if ( !file.exists() ) { - System.out.println("\nFILE DOES NOT EXIST: " + filename); - } - BufferedReader in = new BufferedReader(new FileReader(file)); - - // Create an array of characters the size of the file - char[] allChars = new char[(int)file.length()]; - - // Read the characters into the allChars array - in.read(allChars, 0, (int)file.length()); - in.close(); - - // Convert to a string - String allCharsString = new String(allChars); - - return allCharsString; - - } catch (FileNotFoundException e) { - System.err.println(e); - return ""; - } catch (IOException e) { - System.err.println(e); - return ""; - } - } - - public static int findString(String fileString, String stringToFind) { - return fileString.indexOf(stringToFind); + // Test that win title javascript is followed by NOSCRIPT code. + checkOutput("p1/C.html", true, + "<script type=\"text/javascript\"><!--\n" + + " try {\n" + + " if (location.href.indexOf('is-external=true') == -1) {\n" + + " parent.document.title=\"C (Window Title)\";\n" + + " }\n" + + " }\n" + + " catch(err) {\n" + + " }\n" + + "//-->\n" + + "</script>"); } }
--- a/test/com/sun/javadoc/MetaTag/MetaTag.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/MetaTag/MetaTag.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,133 +21,94 @@ * questions. */ -import java.text.SimpleDateFormat; -import java.util.Date; - /* * @test * @bug 4034096 4764726 6235799 * @summary Add support for HTML keywords via META tag for * class and member names to improve API search * @author dkramer - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build MetaTag * @run main MetaTag */ +import java.text.SimpleDateFormat; +import java.util.Date; + public class MetaTag extends JavadocTester { - //Test information. - private static final String BUG_ID = "4034096-4764726-6235799"; - private static final String OUTPUT_DIR = "docs-" + BUG_ID; - private static final SimpleDateFormat m_dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", OUTPUT_DIR, - "-sourcepath", SRC_DIR, - "-keywords", - "-doctitle", "Sample Packages", - "p1", "p2" - }; - - private static final String[] ARGS_NO_TIMESTAMP_NO_KEYWORDS = new String[] { - "-d", OUTPUT_DIR + "-2", - "-sourcepath", SRC_DIR, - "-notimestamp", - "-doctitle", "Sample Packages", - "p1", "p2" - }; - - //Input for string search tests. - private static final String[][] TEST = { - - { OUTPUT_DIR + FS + "p1" + FS + "C1.html", - "<meta name=\"keywords\" content=\"p1.C1 class\">" }, - - { OUTPUT_DIR + FS + "p1" + FS + "C1.html", - "<meta name=\"keywords\" content=\"field1\">" }, - - { OUTPUT_DIR + FS + "p1" + FS + "C1.html", - "<meta name=\"keywords\" content=\"field2\">" }, - - { OUTPUT_DIR + FS + "p1" + FS + "C1.html", - "<meta name=\"keywords\" content=\"method1()\">" }, - - { OUTPUT_DIR + FS + "p1" + FS + "C1.html", - "<meta name=\"keywords\" content=\"method2()\">" }, - - { OUTPUT_DIR + FS + "p1" + FS + "package-summary.html", - "<meta name=\"keywords\" content=\"p1 package\">" }, - - { OUTPUT_DIR + FS + "overview-summary.html", - "<meta name=\"keywords\" content=\"Overview, Sample Packages\">" }, - - //NOTE: Hopefully, this regression test is not run at midnight. If the output - //was generated yesterday and this test is run today, the test will fail. - {OUTPUT_DIR + FS + "overview-summary.html", - "<meta name=\"date\" " - + "content=\"" + m_dateFormat.format(new Date()) + "\">"}, - }; - - private static final String[][] NEGATED_TEST = NO_TEST; - - private static final String[][] TEST2 = NO_TEST; - private static final String[][] NEGATED_TEST2 = { - //No keywords when -keywords is not used. - { OUTPUT_DIR + "-2" + FS + "p1" + FS + "C1.html", - "<META NAME=\"keywords\" CONTENT=\"p1.C1 class\">" }, - - { OUTPUT_DIR + "-2" + FS + "p1" + FS + "C1.html", - "<META NAME=\"keywords\" CONTENT=\"field1\">" }, - - { OUTPUT_DIR + "-2" + FS + "p1" + FS + "C1.html", - "<META NAME=\"keywords\" CONTENT=\"field2\">" }, - - { OUTPUT_DIR + "-2" + FS + "p1" + FS + "C1.html", - "<META NAME=\"keywords\" CONTENT=\"method1()\">" }, - - { OUTPUT_DIR + "-2" + FS + "p1" + FS + "C1.html", - "<META NAME=\"keywords\" CONTENT=\"method2()\">" }, - - { OUTPUT_DIR + "-2" + FS + "p1" + FS + "package-summary.html", - "<META NAME=\"keywords\" CONTENT=\"p1 package\">" }, - - { OUTPUT_DIR + "-2" + FS + "overview-summary.html", - "<META NAME=\"keywords\" CONTENT=\"Overview Summary, Sample Packages\">" }, - - //The date metatag should not show up when -notimestamp is used. - - //NOTE: Hopefully, this regression test is not run at midnight. If the output - //was generated yesterday and this test is run today, the test will fail. - {OUTPUT_DIR + "-2" + FS + "overview-summary.html", - "<META NAME=\"date\" " - + "CONTENT=\"" + m_dateFormat.format(new Date()) + "\">"}, - }; - /** * The entry point of the test. - * @param args the array of command line arguments. + * @param args the array of command line arguments + * @throws Exception if the test fails */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { MetaTag tester = new MetaTag(); - run(tester, ARGS, TEST, NEGATED_TEST); - run(tester, ARGS_NO_TIMESTAMP_NO_KEYWORDS, TEST2, NEGATED_TEST2); - tester.printSummary(); + tester.runTests(); + } + + @Test + void testStandard() { + javadoc("-d", "out-1", + "-sourcepath", testSrc, + "-keywords", + "-doctitle", "Sample Packages", + "p1", "p2"); + + checkExit(Exit.OK); + + checkOutput("p1/C1.html", true, + "<meta name=\"keywords\" content=\"p1.C1 class\">", + "<meta name=\"keywords\" content=\"field1\">", + "<meta name=\"keywords\" content=\"field2\">", + "<meta name=\"keywords\" content=\"method1()\">", + "<meta name=\"keywords\" content=\"method2()\">"); + + checkOutput("p1/package-summary.html", true, + "<meta name=\"keywords\" content=\"p1 package\">"); + + checkOutput("overview-summary.html", true, + "<meta name=\"keywords\" content=\"Overview, Sample Packages\">"); + + // NOTE: Hopefully, this regression test is not run at midnight. If the output + // was generated yesterday and this test is run today, the test will fail. + checkOutput("overview-summary.html", true, + "<meta name=\"date\" content=\"" + date() + "\">"); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void testNoTimestamp() { + javadoc("-d", "out-2", + "-sourcepath", testSrc, + "-notimestamp", + "-doctitle", "Sample Packages", + "p1", "p2"); + checkExit(Exit.OK); + + // No keywords when -keywords is not used. + checkOutput("p1/C1.html", false, + "<META NAME=\"keywords\" CONTENT=\"p1.C1 class\">", + "<META NAME=\"keywords\" CONTENT=\"field1\">", + "<META NAME=\"keywords\" CONTENT=\"field2\">", + "<META NAME=\"keywords\" CONTENT=\"method1()\">", + "<META NAME=\"keywords\" CONTENT=\"method2()\">"); + + checkOutput("p1/package-summary.html", false, + "<META NAME=\"keywords\" CONTENT=\"p1 package\">"); + + checkOutput("overview-summary.html", false, + "<META NAME=\"keywords\" CONTENT=\"Overview Summary, Sample Packages\">"); + + // The date metatag should not show up when -notimestamp is used. + // NOTE: Hopefully, this regression test is not run at midnight. If the output + // was generated yesterday and this test is run today, the test will fail. + checkOutput("overview-summary.html", false, + "<META NAME=\"date\" CONTENT=\"" + date() + "\">"); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + + String date() { + return dateFormat.format(new Date()); } }
--- a/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,103 +28,62 @@ * is present for three sets of options: (1) -header, * (2) -packagesheader, and (3) -header -packagesheader * @author dkramer - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build PackagesHeader * @run main PackagesHeader */ public class PackagesHeader extends JavadocTester { - //Test information. - private static final String BUG_ID = "4766385"; - private static final String OUTPUT_DIR = "docs-" + BUG_ID; + public static void main(String... args) throws Exception { + JavadocTester tester = new PackagesHeader(); + tester.runTests(); + } - private static final String OUTPUT_DIR1 = "docs1-" + BUG_ID + FS; - private static final String OUTPUT_DIR2 = "docs2-" + BUG_ID + FS; - private static final String OUTPUT_DIR3 = "docs3-" + BUG_ID + FS; - - /** - * Assign value for [ fileToSearch, stringToFind ] - */ - private static final String[][] TESTARRAY1 = { + @Test + void testHeader() { + // First test with -header only + javadoc("-d", "out-header", + "-header", "Main Frame Header", + "-sourcepath", testSrc, + "p1", "p2"); + checkExit(Exit.OK); // Test that the -header shows up in the packages frame - { OUTPUT_DIR1 + "overview-frame.html", - "Main Frame Header" } - }; + checkOutput("overview-frame.html", true, + "Main Frame Header"); + } - private static final String[][] TESTARRAY2 = { + @Test + void testPackagesHeader() { + // Second test with -packagesheader only + javadoc("-d", "out-packages-header", + "-packagesheader", "Packages Frame Header", + "-sourcepath", testSrc, + "p1", "p2"); + checkExit(Exit.OK); // Test that the -packagesheader string shows // up in the packages frame + checkOutput("overview-frame.html", true, + "Packages Frame Header"); + } - { OUTPUT_DIR2 + "overview-frame.html", - "Packages Frame Header" } - }; - - private static final String[][] TESTARRAY3 = { + @Test + void testBothHeaders() { + // Third test with both -packagesheader and -header + javadoc("-d", "out-both", + "-packagesheader", "Packages Frame Header", + "-header", "Main Frame Header", + "-sourcepath", testSrc, + "p1", "p2"); + checkExit(Exit.OK); // Test that the both headers show up and are different - - { OUTPUT_DIR3 + "overview-frame.html", - "Packages Frame Header" }, - - { OUTPUT_DIR3 + "overview-summary.html", - "Main Frame Header" } - }; - - // First test with -header only - private static final String[] JAVADOC_ARGS1 = new String[] { - "-d", OUTPUT_DIR1, - "-header", "Main Frame Header", - "-sourcepath", SRC_DIR, - "p1", "p2"}; - - // Second test with -packagesheader only - private static final String[] JAVADOC_ARGS2 = new String[] { - "-d", OUTPUT_DIR2, - "-packagesheader", "Packages Frame Header", - "-sourcepath", SRC_DIR, - "p1", "p2"}; - - // Third test with both -packagesheader and -header - private static final String[] JAVADOC_ARGS3 = new String[] { - "-d", OUTPUT_DIR3, - "-packagesheader", "Packages Frame Header", - "-header", "Main Frame Header", - "-sourcepath", SRC_DIR, - "p1", "p2"}; + checkOutput("overview-frame.html", true, + "Packages Frame Header"); - - //Input for string search tests. - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - JavadocTester tester = new PackagesHeader(); - - run(tester, JAVADOC_ARGS1, TESTARRAY1, NEGATED_TEST); - run(tester, JAVADOC_ARGS2, TESTARRAY2, NEGATED_TEST); - run(tester, JAVADOC_ARGS3, TESTARRAY3, NEGATED_TEST); - - tester.printSummary(); - } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("overview-summary.html", true, + "Main Frame Header"); } }
--- a/test/com/sun/javadoc/T6735320/T6735320.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/T6735320/T6735320.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,33 +25,24 @@ * @test * @bug 6735320 * @summary javadoc throws exception if serialField value is missing - * @library ../lib/ - * @build JavadocTester T6735320 + * @library ../lib + * @build JavadocTester * @run main T6735320 */ + public class T6735320 extends JavadocTester { - private static final String BUG_ID = "6735320"; - private static final String[] ARGS = new String[]{ - "-d", BUG_ID + ".out", - SRC_DIR + FS + "SerialFieldTest.java" - }; - - public String getBugId() { - return BUG_ID; + public static void main(String... args) throws Exception { + T6735320 tester = new T6735320(); + tester.runTests(); } - public String getBugName() { - return getClass().getName(); - } - - public static void main(String... args) { - T6735320 tester = new T6735320(); - if (tester.runJavadoc(ARGS) == 0) { - throw new AssertionError("zero return code from javadoc"); - } - if (tester.getErrorOutput().contains("StringIndexOutOfBoundsException")) { - throw new AssertionError("javadoc threw StringIndexOutOfBoundsException"); - } + @Test + void test() { + javadoc("-d", "out", + testSrc("SerialFieldTest.java")); + checkExit(Exit.FAILED); + checkOutput(Output.STDERR, false, + "StringIndexOutOfBoundsException"); } }
--- a/test/com/sun/javadoc/ValidHtml/ValidHtml.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/ValidHtml/ValidHtml.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,173 +30,52 @@ * <NOFRAMES> not allowed outside <FRAMESET> element * HTML table tags inserted in wrong place in pakcage use page * @author dkramer + * @library ../lib + * @build JavadocTester * @run main ValidHtml */ -import com.sun.javadoc.*; -import java.util.*; -import java.io.*; - -/** - * Runs javadoc and runs regression tests on the resulting HTML. - * It reads each file, complete with newlines, into a string to easily - * find strings that contain newlines. - */ -public class ValidHtml { +public class ValidHtml extends JavadocTester { - private static final String BUGID = "4275630"; - private static final String BUGNAME = "ValidHtml"; - private static final String FS = System.getProperty("file.separator"); - private static final String PS = System.getProperty("path.separator"); - private static final String LS = System.getProperty("line.separator"); - private static final String TMPDEST_DIR1 = "." + FS + "docs1" + FS; - private static final String TMPDEST_DIR2 = "." + FS + "docs2" + FS; + public static void main(String... args) throws Exception { + ValidHtml tester = new ValidHtml(); + tester.runTests(); + } - // Subtest number. Needed because runResultsOnHTML is run twice, - // and subtestNum should increment across subtest runs. - public static int subtestNum = 0; - public static int numSubtestsPassed = 0; - - // Entry point - public static void main(String[] args) { - - // Directory that contains source files that javadoc runs on - String srcdir = System.getProperty("test.src", "."); - + @Test + void test() { // Test for all cases except the split index page - runJavadoc(new String[]{"-d", TMPDEST_DIR1, + javadoc("-d", "out", "-doctitle", "Document Title", "-windowtitle", "Window Title", "-use", - "-overview", (srcdir + FS + "overview.html"), - "-sourcepath", srcdir, - "p1", "p2" - }); - runTestsOnHTML(testArray); + "-overview", testSrc("overview.html"), + "-sourcepath", testSrc, + "p1", "p2"); + checkExit(Exit.OK); - printSummary(); - } + // Test the proper DOCTYPE element are present: + checkOutput("index.html", true, FRAMESET); + checkOutput("overview-summary.html", true, LOOSE); + checkOutput("p1/package-summary.html", true, LOOSE); + checkOutput("p1/C.html", true, LOOSE); + checkOutput("overview-frame.html", true, LOOSE); + checkOutput("allclasses-frame.html", true, LOOSE); + checkOutput("p1/package-frame.html", true, LOOSE); - /** Run javadoc */ - public static void runJavadoc(String[] javadocArgs) { - if (com.sun.tools.javadoc.Main.execute(javadocArgs) != 0) { - throw new Error("Javadoc failed to execute"); - } + // Test that <NOFRAMES> is inside <FRAMESET> element: + checkOutput("index.html", true, + "</noframes>\n" + + "</frameset>"); + + // Test the table elements are in the correct order: + checkOutput("p1/package-use.html", true, + "</td>\n" + + "</tr>"); } - /** - * Assign value for [ stringToFind, filename ] - * NOTE: The standard doclet uses the same separator "\n" for all OS's - */ - private static final String[][] testArray = { - // Test the proper DOCTYPE element is present: - { - "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">", - TMPDEST_DIR1 + "index.html" - }, - // Test the proper DOCTYPE element is present: - { - "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">", - TMPDEST_DIR1 + "overview-summary.html" - }, - // Test the proper DOCTYPE element is present: - { - "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">", - TMPDEST_DIR1 + "p1" + FS + "package-summary.html" - }, - // Test the proper DOCTYPE element is present: - { - "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">", - TMPDEST_DIR1 + "p1" + FS + "C.html" - }, - // Test the proper DOCTYPE element is present: - { - "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">", - TMPDEST_DIR1 + "overview-frame.html" - }, - // Test the proper DOCTYPE element is present: - { - "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">", - TMPDEST_DIR1 + "allclasses-frame.html" - }, - // Test the proper DOCTYPE element is present: - { - "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">", - TMPDEST_DIR1 + "p1" + FS + "package-frame.html" - }, - // Test that <NOFRAMES> is inside <FRAMESET> element: - { - "</noframes>" + LS + "</frameset>", - TMPDEST_DIR1 + "index.html" - }, - // Test the table elements are in the correct order: - { - "</td>" + LS + "</tr>", - TMPDEST_DIR1 + FS + "p1" + FS + "package-use.html" - } - }; - - public static void runTestsOnHTML(String[][] testArray) { - - for (int i = 0; i < testArray.length; i++) { - - subtestNum += 1; - - // Read contents of file into a string - String fileString = readFileToString(testArray[i][1]); - - // Get string to find - String stringToFind = testArray[i][0]; - - // Find string in file's contents - if (findString(fileString, stringToFind) == -1) { - System.out.println("\nSub-test " + (subtestNum) + " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n" + "when searching for:\n" + stringToFind); - } else { - numSubtestsPassed += 1; - System.out.println("\nSub-test " + (subtestNum) + " passed:\n" + stringToFind); - } - } - } - - public static void printSummary() { - if (numSubtestsPassed == subtestNum) { - System.out.println("\nAll " + numSubtestsPassed + " subtests passed"); - } else { - throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum) + " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n"); - } - } - - // Read the file into a String - public static String readFileToString(String filename) { - try { - File file = new File(filename); - if (!file.exists()) { - System.out.println("\nFILE DOES NOT EXIST: " + filename); - } - BufferedReader in = new BufferedReader(new FileReader(file)); - - // Create an array of characters the size of the file - char[] allChars = new char[(int) file.length()]; - - // Read the characters into the allChars array - in.read(allChars, 0, (int) file.length()); - in.close(); - - // Convert to a string - String allCharsString = new String(allChars); - - return allCharsString; - - } catch (FileNotFoundException e) { - System.err.println(e); - return ""; - } catch (IOException e) { - System.err.println(e); - return ""; - } - } - - public static int findString(String fileString, String stringToFind) { - return fileString.indexOf(stringToFind); - } + private static final String FRAMESET = + "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">"; + private static final String LOOSE = + "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"; }
--- a/test/com/sun/javadoc/VersionNumber/VersionNumber.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/VersionNumber/VersionNumber.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,134 +26,31 @@ * @bug 4720849 * @summary com.sun.tools.doclets.standard.Standard contains hard-coded version number * @author dkramer + * @library ../lib + * @build JavadocTester * @run main VersionNumber */ -import com.sun.javadoc.*; -import java.util.*; -import java.io.*; - - /** * Runs javadoc and runs regression tests on the resulting HTML. - * It reads each file, complete with newlines, into a string to easily - * find strings that contain newlines. */ -public class VersionNumber { - - private static final String BUGID = "4720849"; - private static final String BUGNAME = "VersionNumber"; - private static final String FS = System.getProperty("file.separator"); - private static final String PS = System.getProperty("path.separator"); - private static final String LS = System.getProperty("line.separator"); - private static final String TMPDEST_DIR1 = "." + FS + "docs1" + FS; - private static final String TMPDEST_DIR2 = "." + FS + "docs2" + FS; - - // Subtest number. Needed because runResultsOnHTML is run twice, - // and subtestNum should increment across subtest runs. - public static int subtestNum = 0; - public static int numSubtestsPassed = 0; +public class VersionNumber extends JavadocTester { - // Entry point - public static void main(String[] args) { - - // Directory that contains source files that javadoc runs on - String srcdir = System.getProperty("test.src", "."); - - // Test for all cases except the split index page - runJavadoc(new String[] {"-d", TMPDEST_DIR1, - "p1"}); - runTestsOnHTML(testArray); - - printSummary(); - } - - /** Run javadoc */ - public static void runJavadoc(String[] javadocArgs) { - if (com.sun.tools.javadoc.Main.execute(javadocArgs) != 0) { - throw new Error("Javadoc failed to execute"); - } + public static void main(String... args) throws Exception { + VersionNumber tester = new VersionNumber(); + tester.runTests(); } - /** - * Assign value for [ stringToFind, filename ] - * NOTE: The standard doclet uses the same separator "\n" for all OS's - */ - private static final String[][] testArray = { - - // Test the proper DOCTYPE element is present: - { - "<!-- Generated by javadoc (", - TMPDEST_DIR1 + "p1" + FS + "C.html" }, - - }; - - public static void runTestsOnHTML(String[][] testArray) { - - for (int i = 0; i < testArray.length; i++) { + @Test + void test() { + javadoc("-d", "out", + "p1"); + checkExit(Exit.OK); - subtestNum += 1; - - // Read contents of file into a string - String fileString = readFileToString(testArray[i][1]); - - // Get string to find - String stringToFind = testArray[i][0]; - - // Find string in file's contents - if (findString(fileString, stringToFind) == -1) { - System.out.println("\nSub-test " + (subtestNum) - + " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n" - + "when searching for:\n" - + stringToFind); - } else { - numSubtestsPassed += 1; - System.out.println("\nSub-test " + (subtestNum) + " passed:\n" + stringToFind); - } - } + // Test the proper DOCTYPE element is present: + checkOutput("p1/C.html", true, + "<!-- Generated by javadoc ("); } - public static void printSummary() { - if ( numSubtestsPassed == subtestNum ) { - System.out.println("\nAll " + numSubtestsPassed + " subtests passed"); - } else { - throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum) - + " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n"); - } - } - - // Read the file into a String - public static String readFileToString(String filename) { - try { - File file = new File(filename); - if ( !file.exists() ) { - System.out.println("\nFILE DOES NOT EXIST: " + filename); - } - BufferedReader in = new BufferedReader(new FileReader(file)); - - // Create an array of characters the size of the file - char[] allChars = new char[(int)file.length()]; - - // Read the characters into the allChars array - in.read(allChars, 0, (int)file.length()); - in.close(); - - // Convert to a string - String allCharsString = new String(allChars); - - return allCharsString; - - } catch (FileNotFoundException e) { - System.err.println(e); - return ""; - } catch (IOException e) { - System.err.println(e); - return ""; - } - } - - public static int findString(String fileString, String stringToFind) { - return fileString.indexOf(stringToFind); - } }
--- a/test/com/sun/javadoc/WindowTitles/WindowTitles.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/WindowTitles/WindowTitles.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,196 +26,62 @@ * @bug 4530730 * @summary stddoclet: With frames off, window titles have "()" appended * @author dkramer + * @library ../lib + * @build JavadocTester * @run main WindowTitles */ - -import com.sun.javadoc.*; -import java.util.*; -import java.io.*; - -// If needing regular expression pattern matching, -// see /java/pubs/dev/linkfix/src/LinkFix.java - /** * Runs javadoc and runs regression tests on the resulting HTML. - * It reads each file, complete with newlines, into a string to easily - * find strings that contain newlines. */ -public class WindowTitles -{ - private static final String BUGID = "4530730"; - private static final String BUGNAME = "WindowTitles"; - private static final String FS = System.getProperty("file.separator"); - private static final String PS = System.getProperty("path.separator"); - private static final String LS = System.getProperty("line.separator"); - private static final String TMPDIR_STRING1 = "." + FS + "docs1" + FS; - private static final String TMPDIR_STRING2 = "." + FS + "docs2" + FS; - - // Subtest number. Needed because runResultsOnHTML is run twice, and subtestNum - // should increment across subtest runs. - public static int subtestNum = 0; - public static int numSubtestsPassed = 0; - - // Entry point - public static void main(String[] args) { - - // Directory that contains source files that javadoc runs on - String srcdir = System.getProperty("test.src", "."); +public class WindowTitles extends JavadocTester { - // Test for all cases except the split index page - runJavadoc(new String[] {"-d", TMPDIR_STRING1, - "-use", - "-sourcepath", srcdir, - "p1", "p2"}); - runTestsOnHTML(testArray); - - // Test only for the split-index case (and run on only one package) - System.out.println(""); // blank line - runJavadoc(new String[] {"-d", TMPDIR_STRING2, - "-splitindex", - "-sourcepath", System.getProperty("test.src", "."), - "p1"}); - runTestsOnHTML(testSplitIndexArray); - - printSummary(); - } - - /** Run javadoc */ - public static void runJavadoc(String[] javadocArgs) { - if (com.sun.tools.javadoc.Main.execute(javadocArgs) != 0) { - throw new Error("Javadoc failed to execute"); - } + public static void main(String... args) throws Exception { + WindowTitles tester = new WindowTitles(); + tester.runTests(); } - /** - * Assign value for [ stringToFind, filename ] - * NOTE: The standard doclet uses platform-specific line separators (LS) - */ - private static final String[][] testArray = { - - { "<title>Overview</title>", - TMPDIR_STRING1 + "overview-summary.html" }, - - { "<title>Class Hierarchy</title>", - TMPDIR_STRING1 + "overview-tree.html" }, - - { "<title>Overview List</title>", - TMPDIR_STRING1 + "overview-frame.html" }, - - { "<title>p1</title>", - TMPDIR_STRING1 + "p1" + FS + "package-summary.html" }, - - { "<title>p1</title>", - TMPDIR_STRING1 + "p1" + FS + "package-frame.html" }, - - { "<title>p1 Class Hierarchy</title>", - TMPDIR_STRING1 + "p1" + FS + "package-tree.html" }, - - { "<title>Uses of Package p1</title>", - TMPDIR_STRING1 + "p1" + FS + "package-use.html" }, - - { "<title>C1</title>", - TMPDIR_STRING1 + "p1" + FS + "C1.html" }, - - { "<title>All Classes</title>", - TMPDIR_STRING1 + "allclasses-frame.html" }, - - { "<title>All Classes</title>", - TMPDIR_STRING1 + "allclasses-noframe.html" }, - - { "<title>Constant Field Values</title>", - TMPDIR_STRING1 + "constant-values.html" }, - - { "<title>Deprecated List</title>", - TMPDIR_STRING1 + "deprecated-list.html" }, + @Test + void test() { + // Test for all cases except the split index page + javadoc("-d", "out-1", + "-use", + "-sourcepath", testSrc, + "p1", "p2"); + checkExit(Exit.OK); - { "<title>Serialized Form</title>", - TMPDIR_STRING1 + "serialized-form.html" }, - - { "<title>API Help</title>", - TMPDIR_STRING1 + "help-doc.html" }, - - { "<title>Index</title>", - TMPDIR_STRING1 + "index-all.html" }, - - { "<title>Uses of Class p1.C1</title>", - TMPDIR_STRING1 + "p1" + FS + "class-use" + FS + "C1.html" }, - }; - - /** - * Assign value for [ stringToFind, filename ] for split index page - */ - private static final String[][] testSplitIndexArray = { - { "<title>C-Index</title>", - TMPDIR_STRING2 + "index-files" + FS + "index-1.html" }, - }; - - public static void runTestsOnHTML(String[][] testArray) { - - for (int i = 0; i < testArray.length; i++) { - - subtestNum += 1; - - // Read contents of file into a string - String fileString = readFileToString(testArray[i][1]); - - // Get string to find - String stringToFind = testArray[i][0]; - - // Find string in file's contents - if (findString(fileString, stringToFind) == -1) { - System.out.println("\nSub-test " + (subtestNum) - + " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n" - + "when searching for:\n" - + stringToFind); - } else { - numSubtestsPassed += 1; - System.out.println("\nSub-test " + (subtestNum) + " passed:\n" + stringToFind); - } - } + checkTitle("overview-summary.html", "Overview"); + checkTitle("overview-tree.html", "Class Hierarchy"); + checkTitle("overview-frame.html", "Overview List"); + checkTitle("p1/package-summary.html", "p1"); + checkTitle("p1/package-frame.html", "p1"); + checkTitle("p1/package-tree.html", "p1 Class Hierarchy"); + checkTitle("p1/package-use.html", "Uses of Package p1"); + checkTitle("p1/C1.html", "C1"); + checkTitle("allclasses-frame.html", "All Classes"); + checkTitle("allclasses-noframe.html", "All Classes"); + checkTitle("constant-values.html", "Constant Field Values"); + checkTitle("deprecated-list.html", "Deprecated List"); + checkTitle("serialized-form.html", "Serialized Form"); + checkTitle("help-doc.html", "API Help"); + checkTitle("index-all.html", "Index"); + checkTitle("p1/class-use/C1.html", "Uses of Class p1.C1"); } - public static void printSummary() { - if ( numSubtestsPassed == subtestNum ) { - System.out.println("\nAll " + numSubtestsPassed + " subtests passed"); - } else { - throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum) - + " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n"); - } + @Test + void test2() { + // Test only for the split-index case (and run on only one package) + javadoc("-d", "out-2", + "-splitindex", + "-sourcepath", testSrc, + "p1"); + checkExit(Exit.OK); + + checkTitle("index-files/index-1.html", "C-Index"); } - // Read the file into a String - public static String readFileToString(String filename) { - try { - File file = new File(filename); - if ( !file.exists() ) { - System.out.println("\nFILE DOES NOT EXIST: " + filename); - } - BufferedReader in = new BufferedReader(new FileReader(file)); - - // Create an array of characters the size of the file - char[] allChars = new char[(int)file.length()]; - - // Read the characters into the allChars array - in.read(allChars, 0, (int)file.length()); - in.close(); - - // Convert to a string - String allCharsString = new String(allChars); - - return allCharsString; - - } catch (FileNotFoundException e) { - System.err.println(e); - return ""; - } catch (IOException e) { - System.err.println(e); - return ""; - } + void checkTitle(String file, String title) { + checkOutput(file, true, "<title>" + title + "</title>"); } - public static int findString(String fileString, String stringToFind) { - return fileString.indexOf(stringToFind); - } }
--- a/test/com/sun/javadoc/_template/Template.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/_template/Template.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,10 +33,6 @@ public class Template extends JavadocTester { - //Test information. - private static final String BUG_ID = "<BUG ID>"; - private static final String OUTPUT_DIR = "docs-" + BUG_ID; - //Javadoc arguments. private static final String[] ARGS = new String[] { "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR @@ -52,21 +48,7 @@ */ public static void main(String[] args) { Template tester = new Template(); - run(tester, ARGS, TEST, NEGATED_TEST); + tester.run(ARGS, TEST, NEGATED_TEST); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } }
--- a/test/com/sun/javadoc/_template/TemplateComplete.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/_template/TemplateComplete.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,10 +33,6 @@ public class TemplateComplete extends JavadocTester { - //Test information. - private static final String BUG_ID = "<BUG ID>"; - private static final String OUTPUT_DIR = "docs-" + BUG_ID; - //Javadoc arguments. private static final String[] ARGS = new String[] { "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR @@ -51,6 +47,8 @@ //Input for file diff test. + private static final String DIFFDIR1 = null; + private static final String DIFFDIR2 = null; private static final String[][] FILES_TO_DIFF = {}; /** @@ -59,23 +57,9 @@ */ public static void main(String[] args) { TemplateComplete tester = new TemplateComplete(); - int actualExitCode = run(tester, ARGS, TEST, NEGATED_TEST); + int actualExitCode = tester.run(ARGS, TEST, NEGATED_TEST); tester.checkExitCode(EXPECTED_EXIT_CODE, actualExitCode); - tester.runDiffs(FILES_TO_DIFF, false); + tester.runDiffs(DIFFDIR1, DIFFDIR2, FILES_TO_DIFF, false); tester.printSummary(); } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } }
--- a/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,57 +26,30 @@ * @bug 4504730 4526070 5077317 * @summary Test the generation of constant-values.html. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestConstantValuesDriver * @run main TestConstantValuesDriver */ public class TestConstantValuesDriver extends JavadocTester { - private static final String BUG_ID = "4504730-4526070-5077317"; - private static final String[] ARGS = new String[] { - "-d", BUG_ID, SRC_DIR + FS + "TestConstantValues.java", - SRC_DIR + FS + "TestConstantValues2.java", - SRC_DIR + FS + "A.java" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - String[][] tests = new String[5][2]; - for (int i = 0; i < tests.length-1; i++) { - tests[i][0] = BUG_ID + FS + "constant-values.html"; - tests[i][1] = "TEST"+(i+1)+"PASSES"; - } - tests[tests.length-1][0] = BUG_ID + FS + "constant-values.html"; - tests[tests.length-1][1] = "<code>\"<Hello World>\"</code>"; + public static void main(String... args) throws Exception { TestConstantValuesDriver tester = new TestConstantValuesDriver(); - run(tester, ARGS, tests, NO_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + testSrc("TestConstantValues.java"), + testSrc("TestConstantValues2.java"), + testSrc("A.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("constant-values.html", true, + "TEST1PASSES", + "TEST2PASSES", + "TEST3PASSES", + "TEST4PASSES", + "<code>\"<Hello World>\"</code>"); } - - /** - * @throws java.io.IOException Test 1 passes - * @throws java.io.IOException Test 2 passes - * @throws java.lang.NullPointerException comment three - * @throws java.io.IOException Test 3 passes - */ - public void method(){} - }
--- a/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,45 +26,28 @@ * @bug 4525364 * @summary Determine if duplicate throws tags can be used. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestDupThrowsTags * @run main TestDupThrowsTags */ public class TestDupThrowsTags extends JavadocTester { - private static final String BUG_ID = "4525364"; - private static final String[] ARGS = new String[] { - "-d", BUG_ID, SRC_DIR + FS + "TestDupThrowsTags.java" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - String[][] tests = new String[4][2]; - for (int i = 0; i < tests.length; i++) { - tests[i][0] = BUG_ID + FS + "TestDupThrowsTags.html"; - tests[i][1] = "Test "+(i+1)+" passes"; - } + public static void main(String... args) throws Exception { TestDupThrowsTags tester = new TestDupThrowsTags(); - run(tester, ARGS, tests, NO_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + testSrc("TestDupThrowsTags.java")); + checkExit(Exit.FAILED); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("TestDupThrowsTags.html", true, + "Test 1 passes", + "Test 2 passes", + "Test 3 passes", + "Test 4 passes"); } /** @@ -73,6 +56,6 @@ * @throws java.lang.NullPointerException Test 3 passes * @throws java.io.IOException Test 4 passes */ - public void method(){} + public void method() {} }
--- a/test/com/sun/javadoc/lib/JavadocTester.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/lib/JavadocTester.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,549 +21,468 @@ * questions. */ -import com.sun.javadoc.*; -import java.util.*; -import java.io.*; +import java.io.BufferedWriter; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.FilenameFilter; +import java.io.IOException; +import java.io.PrintStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.lang.annotation.Annotation; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.ref.SoftReference; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** - * Runs javadoc and then runs regression tests on the resulting output. - * This class currently contains three tests: - * <ul> - * <li> String search: Reads each file, complete with newlines, - * into a string. Lets you search for strings that contain - * newlines. String matching is case-sensitive. - * You can run javadoc multiple times with different arguments, - * generating output into different destination directories, and - * then perform a different array of tests on each one. - * To do this, the run method accepts a test array for testing - * that a string is found, and a negated test array for testing - * that a string is not found. - * <li> Run diffs: Iterate through the list of given file pairs - * and diff the pairs. - * <li> Check exit code: Check the exit code of Javadoc and - * record whether the test passed or failed. - * </ul> + * Test framework for running javadoc and performing tests on the resulting output. + * + * <p> + * Tests are typically written as subtypes of JavadocTester, with a main + * method that creates an instance of the test class and calls the runTests() + * method. The runTests() methods calls all the test methods declared in the class, + * and then calls a method to print a summary, and throw an exception if + * any of the test methods reported a failure. + * + * <p> + * Test methods are identified with a @Test annotation. They have no parameters. + * The name of the method is not important, but if you have more than one, it is + * recommended that the names be meaningful and suggestive of the test case + * contained therein. + * + * <p> + * Typically, a test method will invoke javadoc, and then perform various + * checks on the results. The standard checks are: + * + * <dl> + * <dt>checkExitCode + * <dd>Check the exit code returned from javadoc. + * <dt>checkOutput + * <dd>Perform a series of checks on the contents on a file or output stream + * generated by javadoc. + * The checks can be either that a series of strings are found or are not found. + * <dt>checkFiles + * <dd>Perform a series of checks on the files generated by javadoc. + * The checks can be that a series of files are found or are not found. + * </dl> + * + * <pre><code> + * public class MyTester extends JavadocTester { + * public static void main(String... args) throws Exception { + * MyTester tester = new MyTester(); + * tester.runTests(); + * } + * + * // test methods... + * @Test + * void test() { + * javadoc(<i>args</i>); + * checkExit(Exit.OK); + * checkOutput(<i>file</i>, true, + * <i>strings-to-find</i>); + * checkOutput(<i>file</i>, false, + * <i>strings-to-not-find</i>); + * } + * } + * </code></pre> + * + * <p> + * If javadoc is run more than once in a test method, you can compare the + * results that are generated with the diff method. Since files written by + * javadoc typically contain a timestamp, you may want to use the -notimestamp + * option if you are going to compare the results from two runs of javadoc. + * + * <p> + * If you have many calls of checkOutput that are very similar, you can write + * your own check... method to reduce the amount of duplication. For example, + * if you want to check that many files contain the same string, you could + * write a method that takes a varargs list of files and calls checkOutput + * on each file in turn with the string to be checked. + * + * <p> + * You can also write you own custom check methods, which can use + * readFile to get the contents of a file generated by javadoc, + * and then use pass(...) or fail(...) to report whether the check + * succeeded or not. + * + * <p> + * You can have many separate test methods, each identified with a @Test + * annotation. However, you should <b>not</b> assume they will be called + * in the order declared in your source file. If the order of a series + * of javadoc invocations is important, do that within a single method. + * If the invocations are independent, for better clarity, use separate + * test methods, each with their own set of checks on the results. * * @author Doug Kramer * @author Jamie Ho - * @since 1.4.2 + * @author Jonathan Gibbons (rewrite) */ public abstract class JavadocTester { - protected static final String FS = System.getProperty("file.separator"); - protected static final String PS = System.getProperty("path.separator"); - protected static final String NL = System.getProperty("line.separator"); - protected static final String SRC_DIR = System.getProperty("test.src", "."); - protected static final String JAVA_VERSION = System.getProperty("java.version"); - protected static final String[][] NO_TEST = new String[][] {}; - protected static final String[] NO_FILE_TEST = new String[] {}; + public static final String FS = System.getProperty("file.separator"); + public static final String PS = System.getProperty("path.separator"); + public static final String NL = System.getProperty("line.separator"); - /** - * Use this as the file name in the test array when you want to search - * for a string in the error output. - */ - public static final String ERROR_OUTPUT = "ERROR_OUTPUT"; - - /** - * Use this as the file name in the test array when you want to search - * for a string in the notice output. - */ - public static final String NOTICE_OUTPUT = "NOTICE_OUTPUT"; - - /** - * Use this as the file name in the test array when you want to search - * for a string in the warning output. - */ - public static final String WARNING_OUTPUT = "WARNING_OUTPUT"; + public enum Output { + /** The name for error output from javadoc. */ + ERROR, + /** The name for the notice output from javadoc. */ + NOTICE, + /** The name for the warning output from javadoc. */ + WARNING, + /** The name for any output written to System.out. */ + STDOUT, + /** The name for any output written to System.err. */ + STDERR + } - /** - * Use this as the file name in the test array when you want to search - * for a string in standard output. - */ - public static final String STANDARD_OUTPUT = "STANDARD_OUTPUT"; + /** The output directory used in the most recent call of javadoc. */ + protected File outputDir; - /** - * The default doclet. - */ - public static final String DEFAULT_DOCLET_CLASS = "com.sun.tools.doclets.formats.html.HtmlDoclet"; - public static final String DEFAULT_DOCLET_CLASS_OLD = "com.sun.tools.doclets.standard.Standard"; + /** The exit code of the most recent call of javadoc. */ + private int exitCode; + + /** The output generated by javadoc to the various writers and streams. */ + private final Map<Output, String> outputMap = new EnumMap<>(Output.class); - /** - * The writer to write error messages. - */ - public StringWriter errors; + /** A cache of file content, to avoid reading files unnecessarily. */ + private final Map<File,SoftReference<String>> fileContentCache = new HashMap<>(); - /** - * The writer to write notices. - */ - public StringWriter notices; + /** Stream used for logging messages. */ + private final PrintStream out = System.out; - /** - * The writer to write warnings. - */ - public StringWriter warnings; + /** The directory containing the source code for the test. */ + public static final String testSrc = System.getProperty("test.src"); /** - * The buffer of warning output.. - */ - public StringBuffer standardOut; - - /** - * The current subtest number. - */ - private static int numTestsRun = 0; - - /** - * The number of subtests passed. - */ - private static int numTestsPassed = 0; - - /** - * The current run of javadoc - */ - private static int javadocRunNum = 0; - - /** - * Whether or not to match newlines exactly. - * Set this value to false if the match strings - * contain text from javadoc comments containing - * non-platform newlines. - */ - protected boolean exactNewlineMatch = true; - - /** - * Construct a JavadocTester. + * Get the path for a source file in the test source directory. + * @param path the path of a file or directory in the source directory + * @return the full path of the specified file */ - public JavadocTester() { - } - - /** - * Return the bug id. - * @return the bug id - */ - public abstract String getBugId(); - - /** - * Return the name of the bug. - * @return the name of the bug - */ - public abstract String getBugName(); - - /** - * Execute the tests. - * - * @param tester the tester to execute - * @param args the arguments to pass to Javadoc - * @param testArray the array of tests - * @param negatedTestArray the array of negated tests - * @return the return code for the execution of Javadoc - */ - public static int run(JavadocTester tester, String[] args, - String[][] testArray, String[][] negatedTestArray) { - int returnCode = tester.runJavadoc(args); - tester.runTestsOnHTML(testArray, negatedTestArray); - return returnCode; + public static String testSrc(String path) { + return new File(testSrc, path).getPath(); } /** - * Execute the tests. - * - * @param tester the tester to execute - * @param args the arguments to pass to Javadoc - * @param testArray the array of tests - * @param negatedTestArray the array of negated tests - * @param fileTestArray the array of file tests - * @param negatedFileTestArray the array of negated file tests - * @return the return code for the execution of Javadoc + * Alternatives for checking the contents of a directory. */ - public static int run(JavadocTester tester, String[] args, - String[][] testArray, String[][] negatedTestArray, String[] fileTestArray, - String[] negatedFileTestArray) { - int returnCode = tester.runJavadoc(args); - tester.runTestsOnHTML(testArray, negatedTestArray); - tester.runTestsOnFile(fileTestArray, negatedFileTestArray); - return returnCode; + public enum DirectoryCheck { + /** + * Check that the directory is empty. + */ + EMPTY((file, name) -> true), + /** + * Check that the directory does not contain any HTML files, + * such as may have been generated by a prior run of javadoc + * using this directory. + * For now, the check is only performed on the top level directory. + */ + NO_HTML_FILES((file, name) -> name.endsWith(".html")), + /** + * No check is performed on the directory contents. + */ + NONE(null) { @Override void check(File dir) { } }; + + /** The filter used to detect that files should <i>not</i> be present. */ + FilenameFilter filter; + + DirectoryCheck(FilenameFilter f) { + filter = f; + } + + void check(File dir) { + if (dir.isDirectory()) { + String[] contents = dir.list(filter); + if (contents == null) + throw new Error("cannot list directory: " + dir); + if (contents.length > 0) + throw new Error("directory has unexpected content: " + dir); + } + } } - /** - * Execute Javadoc using the default doclet. - * - * @param args the arguments to pass to Javadoc - * @return the return code from the execution of Javadoc - */ - public int runJavadoc(String[] args) { - float javaVersion = Float.parseFloat(JAVA_VERSION.substring(0,3)); - String docletClass = javaVersion < 1.5 ? - DEFAULT_DOCLET_CLASS_OLD : DEFAULT_DOCLET_CLASS; - return runJavadoc(docletClass, args); - } + private DirectoryCheck outputDirectoryCheck = DirectoryCheck.EMPTY; + + /** The current subtest number. Incremented when checking(...) is called. */ + private int numTestsRun = 0; + + /** The number of subtests passed. Incremented when passed(...) is called. */ + private int numTestsPassed = 0; + /** The current run of javadoc. Incremented when javadoc is called. */ + private int javadocRunNum = 0; + + /** The name of the standard doclet. */ + // This ought not to be necessary; there ought to be a javadoc entry point + // that does not require this to be know externally. + private static final String standardDocletClassName = + "com.sun.tools.doclets.standard.Standard"; + + /** Marker annotation for test methods to be invoked by runTests. */ + @Retention(RetentionPolicy.RUNTIME) + @interface Test { } /** - * Execute Javadoc. - * - * @param docletClass the doclet being tested. - * @param args the arguments to pass to Javadoc - * @return the return code from the execution of Javadoc + * Run all methods annotated with @Test, followed by printSummary. + * Typically called on a tester object in main() + * @throws Exception if any errors occurred */ - public int runJavadoc(String docletClass, String[] args) { - javadocRunNum++; - if (javadocRunNum == 1) { - System.out.println("\n" + "Running javadoc..."); - } else { - System.out.println("\n" + "Running javadoc (run " - + javadocRunNum + ")..."); + public void runTests() throws Exception { + for (Method m: getClass().getDeclaredMethods()) { + Annotation a = m.getAnnotation(Test.class); + if (a != null) { + try { + out.println("Running test " + m.getName()); + m.invoke(this, new Object[] { }); + } catch (InvocationTargetException e) { + Throwable cause = e.getCause(); + throw (cause instanceof Exception) ? ((Exception) cause) : e; + } + out.println(); + } } - initOutputBuffers(); - - ByteArrayOutputStream stdout = new ByteArrayOutputStream(); - PrintStream prevOut = System.out; - System.setOut(new PrintStream(stdout)); - - ByteArrayOutputStream stderr = new ByteArrayOutputStream(); - PrintStream prevErr = System.err; - System.setErr(new PrintStream(stderr)); - - int returnCode = com.sun.tools.javadoc.Main.execute( - getBugName(), - new PrintWriter(errors, true), - new PrintWriter(warnings, true), - new PrintWriter(notices, true), - docletClass, - getClass().getClassLoader(), - args); - System.setOut(prevOut); - standardOut = new StringBuffer(stdout.toString()); - System.setErr(prevErr); - errors.write(NL + stderr.toString()); - - printJavadocOutput(); - return returnCode; + printSummary(); } /** - * Create new string writer buffers - */ - private void initOutputBuffers() { - errors = new StringWriter(); - notices = new StringWriter(); - warnings = new StringWriter(); - } - - /** - * Run array of tests on the resulting HTML. - * This method accepts a testArray for testing that a string is found - * and a negatedTestArray for testing that a string is not found. + * Run javadoc. + * The output directory used by this call and the final exit code + * will be saved for later use. + * To aid the reader, it is recommended that calls to this method + * put each option and the arguments it takes on a separate line. * - * @param testArray the array of tests - * @param negatedTestArray the array of negated tests + * Example: + * <pre><code> + * javadoc("-d", "out", + * "-sourcepath", testSrc, + * "-notimestamp", + * "pkg1", "pkg2", "pkg3/C.java"); + * </code></pre> + * + * @param args the arguments to pass to javadoc */ - public void runTestsOnHTML(String[][] testArray, String[][] negatedTestArray) { - runTestsOnHTML(testArray, false); - runTestsOnHTML(negatedTestArray, true); - } + public void javadoc(String... args) { + outputMap.clear(); + fileContentCache.clear(); + + javadocRunNum++; + if (javadocRunNum == 1) { + out.println("Running javadoc..."); + } else { + out.println("Running javadoc (run " + + javadocRunNum + ")..."); + } + outputDir = new File("."); + for (int i = 0; i < args.length - 2; i++) { + if (args[i].equals("-d")) { + outputDir = new File(args[++i]); + break; + } + } +// log.setOutDir(outputDir); + + outputDirectoryCheck.check(outputDir); - /** - * Run array of tests on the generated files. - * This method accepts a fileTestArray for testing if a file is generated - * and a negatedFileTestArray for testing if a file is not found. - * - * @param testArray the array of file tests - * @param negatedTestArray the array of negated file tests - */ - public void runTestsOnFile(String[] fileTestArray, String[] negatedFileTestArray) { - runTestsOnFile(fileTestArray, false); - runTestsOnFile(negatedFileTestArray, true); + // These are the primary streams used by javadoc + WriterOutput errOut = new WriterOutput(); + WriterOutput warnOut = new WriterOutput(); + WriterOutput noticeOut = new WriterOutput(); + // These are to catch output to System.out and System.err, + // in case these are used instead of the primary streams + StreamOutput sysOut = new StreamOutput(System.out, System::setOut); + StreamOutput sysErr = new StreamOutput(System.err, System::setErr); + + try { + exitCode = com.sun.tools.javadoc.Main.execute( + "javadoc", + errOut.pw, warnOut.pw, noticeOut.pw, + standardDocletClassName, + args); + } finally { + outputMap.put(Output.STDOUT, sysOut.close()); + outputMap.put(Output.STDERR, sysErr.close()); + outputMap.put(Output.ERROR, errOut.close()); + outputMap.put(Output.WARNING, warnOut.close()); + outputMap.put(Output.NOTICE, noticeOut.close()); + } + + outputMap.forEach((name, text) -> { + if (!text.isEmpty()) { + out.println("javadoc " + name + ":"); + out.println(text); + } + }); } /** - * Run the array of tests on the resulting HTML. - * - * @param testArray the array of tests - * @param isNegated true if test is negated; false otherwise + * Set the kind of check for the initial contents of the output directory + * before javadoc is run. + * The filter should return true for files that should <b>not</b> appear. + * @param c the kind of check to perform */ - private void runTestsOnHTML(String[][] testArray , boolean isNegated) { - for (int i = 0; i < testArray.length; i++) { + public void setOutputDirectoryCheck(DirectoryCheck c) { + outputDirectoryCheck = c; + } - numTestsRun++; + public enum Exit { + OK(0), + FAILED(1); + + Exit(int code) { + this.code = code; + } + + final int code; + } - System.out.print("Running subtest #" + numTestsRun + "... "); - - // Get string to find - String stringToFind = testArray[i][1]; + /** + * Check the exit code of the most recent call of javadoc. + * + * @param expected the exit code that is required for the test + * to pass. + */ + public void checkExit(Exit expected) { + checking("check exit code"); + if (exitCode == expected.code) { + passed("return code " + exitCode); + } else { + failed("return code " + exitCode +"; expected " + expected.code + " (" + expected + ")"); + } + } - // Read contents of file into a string - String fileString; - try { - fileString = readFileToString(testArray[i][0]); - } catch (Error e) { - if (isNegated) { - System.out.println( "FAILED" + "\n" - + "for bug " + getBugId() - + " (" + getBugName() + ") " - + "due to " - + e + "\n"); - continue; - } - throw e; + /** + * Check for content in (or not in) the generated output. + * Within the search strings, the newline character \n + * will be translated to the platform newline character sequence. + * @param path a path within the most recent output directory + * or the name of one of the output buffers, identifying + * where to look for the search strings. + * @param expectedFound true if all of the search strings are expected + * to be found, or false if all of the strings are expected to be + * not found + * @param strings the strings to be searched for + */ + public void checkOutput(String path, boolean expectedFound, String... strings) { + // Read contents of file + String fileString; + try { + fileString = readFile(outputDir, path); + } catch (Error e) { + if (!expectedFound) { + failed("Error reading file: " + e); + return; } + throw e; + } + checkOutput(path, fileString, expectedFound, strings); + } + + /** + * Check for content in (or not in) the one of the output streams written by + * javadoc. Within the search strings, the newline character \n + * will be translated to the platform newline character sequence. + * @param output the output stream to check + * @param expectedFound true if all of the search strings are expected + * to be found, or false if all of the strings are expected to be + * not found + * @param strings the strings to be searched for + */ + public void checkOutput(Output output, boolean expectedFound, String... strings) { + checkOutput(output.toString(), outputMap.get(output), expectedFound, strings); + } + + private void checkOutput(String path, String fileString, boolean expectedFound, String... strings) { + for (String stringToFind : strings) { +// log.logCheckOutput(path, expectedFound, stringToFind); + checking("checkOutput"); // Find string in file's contents boolean isFound = findString(fileString, stringToFind); - if ((isNegated && !isFound) || (!isNegated && isFound) ) { - numTestsPassed += 1; - System.out.println( "Passed" + "\n" - + (isNegated ? "not found:" : "found:") + "\n" - + stringToFind + " in " + testArray[i][0] + "\n"); + if (isFound == expectedFound) { + passed(path + ": " + (isFound ? "found:" : "not found:") + "\n" + + stringToFind + "\n"); } else { - System.out.println( "FAILED" + "\n" - + "for bug " + getBugId() - + " (" + getBugName() + ")" + "\n" - + "when searching for:" + "\n" - + stringToFind - + " in " + testArray[i][0] + "\n"); + failed(path + ": " + (isFound ? "found:" : "not found:") + "\n" + + stringToFind + "\n"); } } } /** - * Run the array of file tests on the generated files. - * - * @param testArray the array of file tests - * @param isNegated true if test is negated; false otherwise - */ - private void runTestsOnFile(String[] testArray, boolean isNegated) { - String fileName; - String failedString; - String passedString; - for (int i = 0; i < testArray.length; i++) { - numTestsRun++; - fileName = testArray[i]; - failedString = "FAILED" + "\n" - + "for bug " + getBugId() + " (" + getBugName() + ") " - + "file (" + fileName + ") found" + "\n"; - passedString = "Passed" + "\n" + - "file (" + fileName + ") not found" + "\n"; - System.out.print("Running subtest #" + numTestsRun + "... "); - try { - File file = new File(fileName); - if ((file.exists() && !isNegated) || (!file.exists() && isNegated)) { - numTestsPassed += 1; - System.out.println(passedString); - } else { - System.out.println(failedString); - } - } catch (Error e) { - System.err.println(e); + * Check for files in (or not in) the generated output. + * @param expectedFound true if all of the files are expected + * to be found, or false if all of the files are expected to be + * not found + * @param paths the files to check, within the most recent output directory. + * */ + public void checkFiles(boolean expectedFound, String... paths) { + for (String path: paths) { +// log.logCheckFile(path, expectedFound); + checking("checkFile"); + File file = new File(outputDir, path); + boolean isFound = file.exists(); + if (isFound == expectedFound) { + passed(path + ": " + (isFound ? "found:" : "not found:") + "\n"); + } else { + failed(path + ": " + (isFound ? "found:" : "not found:") + "\n"); } } } /** - * Iterate through the list of given file pairs and diff each file. - * - * @param filePairs the pairs of files to diff. - * @throws an Error is thrown if any differences are found between - * file pairs. - */ - public void runDiffs(String[][] filePairs) throws Error { - runDiffs(filePairs, true); - } - - /** - * Iterate through the list of given file pairs and diff each file. - * - * @param filePairs the pairs of files to diff. - * @param throwErrorIFNoMatch flag to indicate whether or not to throw - * an error if the files do not match. - * - * @throws an Error is thrown if any differences are found between - * file pairs and throwErrorIFNoMatch is true. + * Check that a series of strings are found in order in a file in + * the generated output. + * @param path the file to check + * @param strings the strings whose order to check */ - public void runDiffs(String[][] filePairs, boolean throwErrorIfNoMatch) throws Error { - for (int i = 0; i < filePairs.length; i++) { - diff(filePairs[i][0], filePairs[i][1], throwErrorIfNoMatch); - } - } - - /** - * Check the exit code of Javadoc and record whether the test passed - * or failed. - * - * @param expectedExitCode The exit code that is required for the test - * to pass. - * @param actualExitCode The actual exit code from the previous run of - * Javadoc. - */ - public void checkExitCode(int expectedExitCode, int actualExitCode) { - numTestsRun++; - if (expectedExitCode == actualExitCode) { - System.out.println( "Passed" + "\n" + " got return code " + - actualExitCode); - numTestsPassed++; - } else { - System.out.println( "FAILED" + "\n" + "for bug " + getBugId() - + " (" + getBugName() + ")" + "\n" + "Expected return code " + - expectedExitCode + " but got " + actualExitCode); - } - } - - /** - * Print a summary of the test results. - */ - protected void printSummary() { - if ( numTestsRun != 0 && numTestsPassed == numTestsRun ) { - // Test passed - System.out.println("\n" + "All " + numTestsPassed - + " subtests passed"); - } else { - // Test failed - throw new Error("\n" + (numTestsRun - numTestsPassed) - + " of " + (numTestsRun) - + " subtests failed for bug " + getBugId() - + " (" + getBugName() + ")" + "\n"); + public void checkOrder(String path, String... strings) { + String fileString = readOutputFile(path); + int prevIndex = -1; + for (String s : strings) { + int currentIndex = fileString.indexOf(s); + checking(s + " at index " + currentIndex); + if (currentIndex >= prevIndex) { + passed(s + "is in the correct order"); + } else { + failed(s + " is in the wrong order."); + } + prevIndex = currentIndex; } } /** - * Print the output stored in the buffers. - */ - protected void printJavadocOutput() { - System.out.println(STANDARD_OUTPUT + " : \n" + getStandardOutput()); - System.err.println(ERROR_OUTPUT + " : \n" + getErrorOutput()); - System.err.println(WARNING_OUTPUT + " : \n" + getWarningOutput()); - System.out.println(NOTICE_OUTPUT + " : \n" + getNoticeOutput()); - } - - /** - * Read the file and return it as a string. + * Compare a set of files in each of two directories. * - * @param fileName the name of the file to read - * @return the file in string format + * @param baseDir1 the directory containing the first set of files + * @param baseDir2 the directory containing the second set of files + * @param files the set of files to be compared */ - public String readFileToString(String fileName) throws Error { - if (fileName.equals(ERROR_OUTPUT)) { - return getErrorOutput(); - } else if (fileName.equals(NOTICE_OUTPUT)) { - return getNoticeOutput(); - } else if (fileName.equals(WARNING_OUTPUT)) { - return getWarningOutput(); - } else if (fileName.equals(STANDARD_OUTPUT)) { - return getStandardOutput(); - } - try { - File file = new File(fileName); - if ( !file.exists() ) { - System.out.println("\n" + "FILE DOES NOT EXIST: " + fileName); - } - BufferedReader in = new BufferedReader(new FileReader(file)); - - // Create an array of characters the size of the file - char[] allChars = new char[(int)file.length()]; - - // Read the characters into the allChars array - in.read(allChars, 0, (int)file.length()); - in.close(); - - // Convert to a string - String allCharsString = new String(allChars); - return allCharsString; - } catch (FileNotFoundException e) { - System.err.println(e); - throw new Error("File not found: " + fileName); - } catch (IOException e) { - System.err.println(e); - throw new Error("Error reading file: " + fileName); + public void diff(String baseDir1, String baseDir2, String... files) { + File bd1 = new File(baseDir1); + File bd2 = new File(baseDir2); + for (String file : files) { + diff(bd1, bd2, file); } } /** - * Compare the two given files. - * - * @param file1 the first file to compare. - * @param file2 the second file to compare. - * @param throwErrorIFNoMatch flag to indicate whether or not to throw - * an error if the files do not match. - * @return true if the files are the same and false otherwise. - */ - public boolean diff(String file1, String file2, boolean throwErrorIFNoMatch) throws Error { - String file1Contents = readFileToString(file1); - String file2Contents = readFileToString(file2); - numTestsRun++; - if (file1Contents.trim().compareTo(file2Contents.trim()) == 0) { - System.out.println("Diff successful: " + file1 + ", " + file2); - numTestsPassed++; - return true; - } else if (throwErrorIFNoMatch) { - throw new Error("Diff failed: " + file1 + ", " + file2); - } else { - return false; - } - } - - /** - * Search for the string in the given file and return true - * if the string was found. - * If exactNewlineMatch is false, newlines will be normalized - * before the comparison. - * - * @param fileString the contents of the file to search through - * @param stringToFind the string to search for - * @return true if the string was found - */ - private boolean findString(String fileString, String stringToFind) { - if (exactNewlineMatch) { - return fileString.indexOf(stringToFind) >= 0; - } else { - return fileString.replace(NL, "\n").indexOf(stringToFind.replace(NL, "\n")) >= 0; - } - } - - - /** - * Return the standard output. - * @return the standard output - */ - public String getStandardOutput() { - return standardOut.toString(); - } - - /** - * Return the error output. - * @return the error output - */ - public String getErrorOutput() { - return errors.getBuffer().toString(); - } - - /** - * Return the notice output. - * @return the notice output - */ - public String getNoticeOutput() { - return notices.getBuffer().toString(); - } - - /** - * Return the warning output. - * @return the warning output - */ - public String getWarningOutput() { - return warnings.getBuffer().toString(); - } - - /** * A utility to copy a directory from one place to another. - * We may possibly want to move this to our doclet toolkit in - * the near future and maintain it from there. * * @param targetDir the directory to copy. * @param destDir the destination to copy the directory to. */ - public static void copyDir(String targetDir, String destDir) { - if (targetDir.endsWith("SCCS")) { - return; - } + // TODO: convert to using java.nio.Files.walkFileTree + public void copyDir(String targetDir, String destDir) { try { File targetDirObj = new File(targetDir); File destDirParentObj = new File(destDir); @@ -575,12 +494,12 @@ destDirObj.mkdir(); } String[] files = targetDirObj.list(); - for (int i = 0; i < files.length; i++) { - File srcFile = new File(targetDirObj, files[i]); - File destFile = new File(destDirObj, files[i]); + for (String file : files) { + File srcFile = new File(targetDirObj, file); + File destFile = new File(destDirObj, file); if (srcFile.isFile()) { - System.out.println("Copying " + srcFile + " to " + destFile); - copyFile(destFile, srcFile); + out.println("Copying " + srcFile + " to " + destFile); + copyFile(destFile, srcFile); } else if(srcFile.isDirectory()) { copyDir(srcFile.getAbsolutePath(), destDirObj.getAbsolutePath()); } @@ -593,26 +512,237 @@ /** * Copy source file to destination file. * - * @throws SecurityException + * @param destfile the destination file + * @param srcfile the source file * @throws IOException */ - public static void copyFile(File destfile, File srcfile) - throws IOException { - byte[] bytearr = new byte[512]; - int len = 0; - FileInputStream input = new FileInputStream(srcfile); - File destDir = destfile.getParentFile(); - destDir.mkdirs(); - FileOutputStream output = new FileOutputStream(destfile); + public void copyFile(File destfile, File srcfile) throws IOException { + Files.copy(srcfile.toPath(), destfile.toPath()); + } + + /** + * Read a file from the output directory. + * + * @param fileName the name of the file to read + * @return the file in string format + */ + public String readOutputFile(String fileName) throws Error { + return readFile(outputDir, fileName); + } + + protected String readFile(String fileName) throws Error { + return readFile(outputDir, fileName); + } + + protected String readFile(String baseDir, String fileName) throws Error { + return readFile(new File(baseDir), fileName); + } + + /** + * Read the file and return it as a string. + * + * @param baseDir the directory in which to locate the file + * @param fileName the name of the file to read + * @return the file in string format + */ + private String readFile(File baseDir, String fileName) throws Error { try { - while ((len = input.read(bytearr)) != -1) { - output.write(bytearr, 0, len); + File file = new File(baseDir, fileName); + SoftReference<String> ref = fileContentCache.get(file); + String content = (ref == null) ? null : ref.get(); + if (content != null) + return content; + + content = new String(Files.readAllBytes(file.toPath())); + fileContentCache.put(file, new SoftReference(content)); + return content; + } catch (FileNotFoundException e) { + System.err.println(e); + throw new Error("File not found: " + fileName); + } catch (IOException e) { + System.err.println(e); + throw new Error("Error reading file: " + fileName); + } + } + + protected void checking(String message) { + numTestsRun++; + print("Starting subtest " + numTestsRun, message); + } + + protected void passed(String message) { + numTestsPassed++; + print("Passed", message); + } + + protected void failed(String message) { + print("FAILED", message); + } + + private void print(String prefix, String message) { + if (message.isEmpty()) + out.println(prefix); + else { + out.print(prefix); + out.print(": "); + out.println(message.replace("\n", NL)); + } + } + + /** + * Print a summary of the test results. + */ + protected void printSummary() { +// log.write(); + if (numTestsRun != 0 && numTestsPassed == numTestsRun) { + // Test passed + out.println(); + out.println("All " + numTestsPassed + " subtests passed"); + } else { + // Test failed + throw new Error((numTestsRun - numTestsPassed) + + " of " + (numTestsRun) + + " subtests failed"); + } + } + + /** + * Search for the string in the given file and return true + * if the string was found. + * + * @param fileString the contents of the file to search through + * @param stringToFind the string to search for + * @return true if the string was found + */ + private boolean findString(String fileString, String stringToFind) { + // javadoc (should) always use the platform newline sequence, + // but in the strings to find it is more convenient to use the Java + // newline character. So we translate \n to NL before we search. + stringToFind = stringToFind.replace("\n", NL); + return fileString.contains(stringToFind); + } + + /** + * Compare the two given files. + * + * @param baseDir1 the directory in which to locate the first file + * @param baseDir2 the directory in which to locate the second file + * @param file the file to compare in the two base directories + * @param throwErrorIFNoMatch flag to indicate whether or not to throw + * an error if the files do not match. + * @return true if the files are the same and false otherwise. + */ + private void diff(File baseDir1, File baseDir2, String file) { + String file1Contents = readFile(baseDir1, file); + String file2Contents = readFile(baseDir2, file); + checking("diff " + new File(baseDir1, file) + ", " + new File(baseDir2, file)); + if (file1Contents.trim().compareTo(file2Contents.trim()) == 0) { + passed("files are equal"); + } else { + failed("files differ"); + } + } + + /** + * Utility class to simplify the handling of temporarily setting a + * new stream for System.out or System.err. + */ + private static class StreamOutput { + // functional interface to set a stream. + private interface Initializer { + void set(PrintStream s); + } + + private final ByteArrayOutputStream baos = new ByteArrayOutputStream(); + private final PrintStream ps = new PrintStream(baos); + private final PrintStream prev; + private final Initializer init; + + StreamOutput(PrintStream s, Initializer init) { + prev = s; + init.set(ps); + this.init = init; + } + + String close() { + init.set(prev); + ps.close(); + return baos.toString(); + } + } + + /** + * Utility class to simplify the handling of creating an in-memory PrintWriter. + */ + private static class WriterOutput { + private final StringWriter sw = new StringWriter(); + final PrintWriter pw = new PrintWriter(sw); + String close() { + pw.close(); + return sw.toString(); + } + } + + +// private final Logger log = new Logger(); + + //--------- Logging -------------------------------------------------------- + // + // This class writes out the details of calls to checkOutput and checkFile + // in a canonical way, so that the resulting file can be checked against + // similar files from other versions of JavadocTester using the same logging + // facilities. + + static class Logger { + private static final int PREFIX = 40; + private static final int SUFFIX = 20; + private static final int MAX = PREFIX + SUFFIX; + List<String> tests = new ArrayList<>(); + String outDir; + String rootDir = rootDir(); + + static String rootDir() { + File f = new File(".").getAbsoluteFile(); + while (!new File(f, ".hg").exists()) + f = f.getParentFile(); + return f.getPath(); + } + + void setOutDir(File outDir) { + this.outDir = outDir.getPath(); + } + + void logCheckFile(String file, boolean positive) { + // Strip the outdir because that will typically not be the same + if (file.startsWith(outDir + "/")) + file = file.substring(outDir.length() + 1); + tests.add(file + " " + positive); + } + + void logCheckOutput(String file, boolean positive, String text) { + // Compress the string to be displayed in the log file + String simpleText = text.replaceAll("\\s+", " ").replace(rootDir, "[ROOT]"); + if (simpleText.length() > MAX) + simpleText = simpleText.substring(0, PREFIX) + + "..." + simpleText.substring(simpleText.length() - SUFFIX); + // Strip the outdir because that will typically not be the same + if (file.startsWith(outDir + "/")) + file = file.substring(outDir.length() + 1); + // The use of text.hashCode ensure that all of "text" is taken into account + tests.add(file + " " + positive + " " + text.hashCode() + " " + simpleText); + } + + void write() { + // sort the log entries because the subtests may not be executed in the same order + tests.sort((a, b) -> a.compareTo(b)); + try (BufferedWriter bw = new BufferedWriter(new FileWriter("tester.log"))) { + for (String t: tests) { + bw.write(t); + bw.newLine(); + } + } catch (IOException e) { + throw new Error("problem writing log: " + e); } - } catch (FileNotFoundException exc) { - } catch (SecurityException exc) { - } finally { - input.close(); - output.close(); } } }
--- a/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,49 +26,31 @@ * @bug 4640745 * @summary This test verifys that the -link option handles absolute paths. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestAbsLinkPath * @run main TestAbsLinkPath */ public class TestAbsLinkPath extends JavadocTester { - private static final String BUG_ID = "4640745"; - private static final String[][] TEST = { - {"tmp" + FS + "pkg1" + FS + "C1.html", "C2.html"}}; - private static final String[][] NEGATED_TEST = NO_TEST; - - private static final String[] ARGS1 = - new String[] { - "-d", "tmp2", "-sourcepath", SRC_DIR, "pkg2"}; - private static final String[] ARGS2 = - new String[] { - "-d", "tmp", "-sourcepath", SRC_DIR, - "-link", ".." + FS + "tmp2", "pkg1"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestAbsLinkPath tester = new TestAbsLinkPath(); - run(tester, ARGS1, NO_TEST, NO_TEST); - run(tester, ARGS2, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test1() { + String out1 = "out1"; + javadoc("-d", out1, "-sourcepath", testSrc, "pkg2"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + javadoc("-d", "out2", + "-sourcepath", testSrc, + "-link", "../" + out1, + "pkg1"); + checkExit(Exit.OK); + + checkOutput("pkg1/C1.html", true, + "C2.html"); } }
--- a/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,95 +27,72 @@ * @summary Make sure that the abstract method is identified correctly * if the abstract modifier is present explicitly or implicitly. * @author bpatel - * @library ../lib/ - * @build JavadocTester TestAbstractMethod + * @library ../lib + * @build JavadocTester * @run main TestAbstractMethod */ public class TestAbstractMethod extends JavadocTester { - //Test information. - private static final String BUG_ID = "8004891"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "A.html", - "<td class=\"colFirst\"><code>default void</code></td>"}, - {BUG_ID + FS + "pkg" + FS + "A.html", - "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + - "All Methods</span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t2\" class=\"tableTab\"><span>" + - "<a href=\"javascript:show(2);\">Instance Methods</a></span>" + - "<span class=\"tabEnd\"> </span></span><span id=\"t3\" " + - "class=\"tableTab\"><span><a href=\"javascript:show(4);\">" + - "Abstract Methods</a></span><span class=\"tabEnd\"> </span>" + - "</span><span id=\"t5\" class=\"tableTab\"><span>" + - "<a href=\"javascript:show(16);\">Default Methods</a></span>" + - "<span class=\"tabEnd\"> </span></span></caption>"}, - {BUG_ID + FS + "pkg" + FS + "B.html", - "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + - "All Methods</span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t2\" class=\"tableTab\"><span>" + - "<a href=\"javascript:show(2);\">Instance Methods</a></span>" + - "<span class=\"tabEnd\"> </span></span><span id=\"t3\" " + - "class=\"tableTab\"><span><a href=\"javascript:show(4);\">Abstract " + - "Methods</a></span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t4\" class=\"tableTab\"><span>" + - "<a href=\"javascript:show(8);\">Concrete Methods</a></span>" + - "<span class=\"tabEnd\"> </span></span></caption>"}, - {BUG_ID + FS + "pkg" + FS + "B.html", - "<td class=\"colFirst\"><code>abstract void</code></td>"}, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + - "All Methods</span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t2\" class=\"tableTab\"><span>" + - "<a href=\"javascript:show(2);\">Instance Methods</a></span>" + - "<span class=\"tabEnd\"> </span></span>" + - "<span id=\"t5\" class=\"tableTab\"><span>" + - "<a href=\"javascript:show(16);\">Default Methods</a></span>" + - "<span class=\"tabEnd\"> </span></span></caption>"}, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<td class=\"colFirst\"><code>default void</code></td>"} - }; - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg" + FS + "A.html", - "<td class=\"colFirst\"><code>abstract void</code></td>"}, - {BUG_ID + FS + "pkg" + FS + "B.html", - "<span><a href=\"javascript:show(16);\">Default Methods</a></span>" + - "<span class=\"tabEnd\"> </span>"}, - {BUG_ID + FS + "pkg" + FS + "B.html", - "<td class=\"colFirst\"><code>default void</code></td>"}, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<span><a href=\"javascript:show(4);\">Abstract Methods</a></span>" + - "<span class=\"tabEnd\"> </span>"} - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestAbstractMethod tester = new TestAbstractMethod(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); + + checkOutput("pkg/A.html", true, + "<td class=\"colFirst\"><code>default void</code></td>", + "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + + "All Methods</span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t2\" class=\"tableTab\"><span>" + + "<a href=\"javascript:show(2);\">Instance Methods</a></span>" + + "<span class=\"tabEnd\"> </span></span><span id=\"t3\" " + + "class=\"tableTab\"><span><a href=\"javascript:show(4);\">" + + "Abstract Methods</a></span><span class=\"tabEnd\"> </span>" + + "</span><span id=\"t5\" class=\"tableTab\"><span>" + + "<a href=\"javascript:show(16);\">Default Methods</a></span>" + + "<span class=\"tabEnd\"> </span></span></caption>"); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/B.html", true, + "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + + "All Methods</span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t2\" class=\"tableTab\"><span>" + + "<a href=\"javascript:show(2);\">Instance Methods</a></span>" + + "<span class=\"tabEnd\"> </span></span><span id=\"t3\" " + + "class=\"tableTab\"><span><a href=\"javascript:show(4);\">Abstract " + + "Methods</a></span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t4\" class=\"tableTab\"><span>" + + "<a href=\"javascript:show(8);\">Concrete Methods</a></span>" + + "<span class=\"tabEnd\"> </span></span></caption>", + "<td class=\"colFirst\"><code>abstract void</code></td>"); + + checkOutput("pkg/C.html", true, + "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + + "All Methods</span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t2\" class=\"tableTab\"><span>" + + "<a href=\"javascript:show(2);\">Instance Methods</a></span>" + + "<span class=\"tabEnd\"> </span></span>" + + "<span id=\"t5\" class=\"tableTab\"><span>" + + "<a href=\"javascript:show(16);\">Default Methods</a></span>" + + "<span class=\"tabEnd\"> </span></span></caption>", + "<td class=\"colFirst\"><code>default void</code></td>"); + + checkOutput("pkg/A.html", false, + "<td class=\"colFirst\"><code>abstract void</code></td>"); + + checkOutput("pkg/B.html", false, + "<span><a href=\"javascript:show(16);\">Default Methods</a></span>" + + "<span class=\"tabEnd\"> </span>", + "<td class=\"colFirst\"><code>default void</code></td>"); + + checkOutput("pkg/C.html", false, + "<span><a href=\"javascript:show(4);\">Abstract Methods</a></span>" + + "<span class=\"tabEnd\"> </span>"); } }
--- a/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,265 +26,136 @@ * @bug 8025633 8025524 * @summary Test for valid name attribute in HTML anchors. * @author Bhavesh Patel - * @library ../lib/ - * @build JavadocTester TestAnchorNames + * @library ../lib + * @build JavadocTester * @run main TestAnchorNames */ public class TestAnchorNames extends JavadocTester { - private static final String BUG_ID = "8025633"; - - //Input for string search tests. - private static final String[][] TEST = { - - //Test some section markers and links to these markers - - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"skip.navbar.top\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"#skip.navbar.top\" title=\"Skip navigation links\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"nested.class.summary\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"#nested.class.summary\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"method.summary\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"#method.summary\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"field.detail\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"#field.detail\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"constructor.detail\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"#constructor.detail\">" - }, - - //Test some members and link to these members + private static final String[] ARGS = new String[] { - //The marker for this appears in the serialized-form.html which we will - //test below - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../serialized-form.html#pkg1.RegClass\">" - }, - //Test some fields - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"Z:Z_\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../pkg1/RegClass.html#Z:Z_\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"Z:Z_:D\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../pkg1/RegClass.html#Z:Z_:D\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"Z:Z:D_\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../pkg1/RegClass.html#Z:Z:D_\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"Z:Z:Dfield\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../pkg1/RegClass.html#Z:Z:Dfield\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"fieldInCla:D:D\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../pkg1/RegClass.html#fieldInCla:D:D\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"S_:D:D:D:D:DINT\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../pkg1/RegClass.html#S_:D:D:D:D:DINT\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"method:D:D\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../pkg1/RegClass.html#method:D:D\">" - }, - {BUG_ID + FS + "pkg1" + FS + "DeprMemClass.html", - "<a name=\"Z:Z_field_In_Class\">" - }, - {BUG_ID + FS + "pkg1" + FS + "DeprMemClass.html", - "<a href=\"../pkg1/DeprMemClass.html#Z:Z_field_In_Class\">" - }, - //Test constructor - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"RegClass-java.lang.String-int-\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../pkg1/RegClass.html#RegClass-java.lang.String-int-\">" - }, - //Test some methods - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"Z:Z_methodInClass-java.lang.String-\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../pkg1/RegClass.html#Z:Z_methodInClass-java.lang.String-\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"method--\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../pkg1/RegClass.html#method--\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"foo-java.util.Map-\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../pkg1/RegClass.html#foo-java.util.Map-\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"methodInCla:Ds-java.lang.String:A-\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../pkg1/RegClass.html#methodInCla:Ds-java.lang.String:A-\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"Z:Z_methodInClas:D-java.lang.String-int-\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../pkg1/RegClass.html#Z:Z_methodInClas:D-java.lang.String-int-\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"methodD-pkg1.RegClass.:DA-\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../pkg1/RegClass.html#methodD-pkg1.RegClass.:DA-\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a name=\"methodD-pkg1.RegClass.D:A-\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - "<a href=\"../pkg1/RegClass.html#methodD-pkg1.RegClass.D:A-\">" - }, - {BUG_ID + FS + "pkg1" + FS + "DeprMemClass.html", - "<a name=\"Z:Z:Dmethod_In_Class--\">" - }, - {BUG_ID + FS + "pkg1" + FS + "DeprMemClass.html", - "<a href=\"../pkg1/DeprMemClass.html#Z:Z:Dmethod_In_Class--\">" - }, - - //Test enum - - {BUG_ID + FS + "pkg1" + FS + "RegClass.Te$t_Enum.html", - "<a name=\"Z:Z:DFLD2\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.Te$t_Enum.html", - "<a href=\"../pkg1/RegClass.Te$t_Enum.html#Z:Z:DFLD2\">" - }, - - //Test nested class - - {BUG_ID + FS + "pkg1" + FS + "RegClass._NestedClas$.html", - "<a name=\"Z:Z_NestedClas:D--\">" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass._NestedClas$.html", - "<a href=\"../pkg1/RegClass._NestedClas$.html#Z:Z_NestedClas:D--\">" - }, - - //Test class use page - - {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "DeprMemClass.html", - "<a href=\"../../pkg1/RegClass.html#d____mc\">" - }, - - //Test deprecated list page - - {BUG_ID + FS + "deprecated-list.html", - "<a href=\"pkg1/DeprMemClass.html#Z:Z_field_In_Class\">" - }, - {BUG_ID + FS + "deprecated-list.html", - "<a href=\"pkg1/DeprMemClass.html#Z:Z:Dmethod_In_Class--\">" - }, - - //Test constant values page - - {BUG_ID + FS + "constant-values.html", - "<a href=\"pkg1/RegClass.html#S_:D:D:D:D:DINT\">" - }, - - //Test serialized form page - - //This is the marker for the link that appears in the pkg1.RegClass.html page - {BUG_ID + FS + "serialized-form.html", - "<a name=\"pkg1.RegClass\">" - }, - - //Test member name index page - - {BUG_ID + FS + "index-all.html", - "<a name=\"I:Z:Z:D\">" - }, - {BUG_ID + FS + "index-all.html", - "<a href=\"#I:Z:Z:D\">$" - }, - {BUG_ID + FS + "index-all.html", - "<a href=\"#I:Z:Z_\">_" - } }; - private static final String[][] NEGATED_TEST = { - //The marker name conversion should only affect HTML anchors. It should not - //affect the lables. - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - " Z:Z_" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - " Z:Z:Dfield" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - " Z:Z_field_In_Class" - }, - {BUG_ID + FS + "pkg1" + FS + "RegClass.html", - " S_:D:D:D:D:DINT" - }, - }; - - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ public static void main(String[] args) throws Exception { TestAnchorNames tester = new TestAnchorNames(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-use", + "pkg1"); + checkExit(Exit.OK); + + // Test some section markers and links to these markers + checkOutput("pkg1/RegClass.html", true, + "<a name=\"skip.navbar.top\">", + "<a href=\"#skip.navbar.top\" title=\"Skip navigation links\">", + "<a name=\"nested.class.summary\">", + "<a href=\"#nested.class.summary\">", + "<a name=\"method.summary\">", + "<a href=\"#method.summary\">", + "<a name=\"field.detail\">", + "<a href=\"#field.detail\">", + "<a name=\"constructor.detail\">", + "<a href=\"#constructor.detail\">"); + + // Test some members and link to these members + checkOutput("pkg1/RegClass.html", true, + //The marker for this appears in the serialized-form.html which we will + //test below + "<a href=\"../serialized-form.html#pkg1.RegClass\">"); + + // Test some fields + checkOutput("pkg1/RegClass.html", true, + "<a name=\"Z:Z_\">", + "<a href=\"../pkg1/RegClass.html#Z:Z_\">", + "<a name=\"Z:Z_:D\">", + "<a href=\"../pkg1/RegClass.html#Z:Z_:D\">", + "<a name=\"Z:Z:D_\">", + "<a href=\"../pkg1/RegClass.html#Z:Z:D_\">", + "<a name=\"Z:Z:Dfield\">", + "<a href=\"../pkg1/RegClass.html#Z:Z:Dfield\">", + "<a name=\"fieldInCla:D:D\">", + "<a href=\"../pkg1/RegClass.html#fieldInCla:D:D\">", + "<a name=\"S_:D:D:D:D:DINT\">", + "<a href=\"../pkg1/RegClass.html#S_:D:D:D:D:DINT\">", + "<a name=\"method:D:D\">", + "<a href=\"../pkg1/RegClass.html#method:D:D\">"); + + checkOutput("pkg1/DeprMemClass.html", true, + "<a name=\"Z:Z_field_In_Class\">", + "<a href=\"../pkg1/DeprMemClass.html#Z:Z_field_In_Class\">"); + + // Test constructor + checkOutput("pkg1/RegClass.html", true, + "<a name=\"RegClass-java.lang.String-int-\">", + "<a href=\"../pkg1/RegClass.html#RegClass-java.lang.String-int-\">"); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + // Test some methods + checkOutput("pkg1/RegClass.html", true, + "<a name=\"Z:Z_methodInClass-java.lang.String-\">", + "<a href=\"../pkg1/RegClass.html#Z:Z_methodInClass-java.lang.String-\">", + "<a name=\"method--\">", + "<a href=\"../pkg1/RegClass.html#method--\">", + "<a name=\"foo-java.util.Map-\">", + "<a href=\"../pkg1/RegClass.html#foo-java.util.Map-\">", + "<a name=\"methodInCla:Ds-java.lang.String:A-\">", + "<a href=\"../pkg1/RegClass.html#methodInCla:Ds-java.lang.String:A-\">", + "<a name=\"Z:Z_methodInClas:D-java.lang.String-int-\">", + "<a href=\"../pkg1/RegClass.html#Z:Z_methodInClas:D-java.lang.String-int-\">", + "<a name=\"methodD-pkg1.RegClass.:DA-\">", + "<a href=\"../pkg1/RegClass.html#methodD-pkg1.RegClass.:DA-\">", + "<a name=\"methodD-pkg1.RegClass.D:A-\">", + "<a href=\"../pkg1/RegClass.html#methodD-pkg1.RegClass.D:A-\">"); + + checkOutput("pkg1/DeprMemClass.html", true, + "<a name=\"Z:Z:Dmethod_In_Class--\">", + "<a href=\"../pkg1/DeprMemClass.html#Z:Z:Dmethod_In_Class--\">"); + + // Test enum + checkOutput("pkg1/RegClass.Te$t_Enum.html", true, + "<a name=\"Z:Z:DFLD2\">", + "<a href=\"../pkg1/RegClass.Te$t_Enum.html#Z:Z:DFLD2\">"); + + // Test nested class + checkOutput("pkg1/RegClass._NestedClas$.html", true, + "<a name=\"Z:Z_NestedClas:D--\">", + "<a href=\"../pkg1/RegClass._NestedClas$.html#Z:Z_NestedClas:D--\">"); + + // Test class use page + checkOutput("pkg1/class-use/DeprMemClass.html", true, + "<a href=\"../../pkg1/RegClass.html#d____mc\">"); + + // Test deprecated list page + checkOutput("deprecated-list.html", true, + "<a href=\"pkg1/DeprMemClass.html#Z:Z_field_In_Class\">", + "<a href=\"pkg1/DeprMemClass.html#Z:Z:Dmethod_In_Class--\">"); + + // Test constant values page + checkOutput("constant-values.html", true, + "<a href=\"pkg1/RegClass.html#S_:D:D:D:D:DINT\">"); + + // Test serialized form page + checkOutput("serialized-form.html", true, + //This is the marker for the link that appears in the pkg1.RegClass.html page + "<a name=\"pkg1.RegClass\">"); + + // Test member name index page + checkOutput("index-all.html", true, + "<a name=\"I:Z:Z:D\">", + "<a href=\"#I:Z:Z:D\">$", + "<a href=\"#I:Z:Z_\">_"); + + // The marker name conversion should only affect HTML anchors. It should not + // affect the lables. + checkOutput("pkg1/RegClass.html", false, + " Z:Z_", + " Z:Z:Dfield", + " Z:Z_field_In_Class", + " S_:D:D:D:D:DINT"); } }
--- a/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,52 +27,26 @@ * @summary Make sure that annotations types with optional elements have * element headers * @author Mahmood Ali - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestAnnotationOptional * @run main TestAnnotationOptional */ public class TestAnnotationOptional extends JavadocTester { - //Test information. - private static final String BUG_ID = "NO_BUG_ID_YET"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-source", "1.5", "pkg" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "AnnotationOptional.html", - "<a name=\"annotation.type.element.detail\">" - } - }; - - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestAnnotationOptional tester = new TestAnnotationOptional(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/AnnotationOptional.html", true, + "<a name=\"annotation.type.element.detail\">"); } }
--- a/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,74 +27,52 @@ * @summary Make sure that annotation types with 0 members does not have * extra HR tags. * @author jamieh - * @library ../lib/ - * @build JavadocTester TestAnnotationTypes + * @library ../lib + * @build JavadocTester * @run main TestAnnotationTypes */ public class TestAnnotationTypes extends JavadocTester { - //Test information. - private static final String BUG_ID = "4973609-8015249"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-source", "1.5", "pkg" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html", - "<li>Summary: </li>" + NL + "<li><a href=\"#annotation.type." + - "field.summary\">Field</a> | </li>"}, - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html", - "<li>Detail: </li>" + NL + "<li><a href=\"#annotation.type." + - "field.detail\">Field</a> | </li>"}, - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html", - "<!-- =========== ANNOTATION TYPE FIELD SUMMARY =========== -->"}, - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html", - "<h3>Field Summary</h3>"}, - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html", - "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../" + - "pkg/AnnotationTypeField.html#DEFAULT_NAME\">DEFAULT_NAME</a></span>" + - "</code> </td>"}, - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html", - "<!-- ============ ANNOTATION TYPE FIELD DETAIL =========== -->"}, - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html", - "<h4>DEFAULT_NAME</h4>" + NL + "<pre>public static final java." + - "lang.String DEFAULT_NAME</pre>"}, - {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "<li>Summary: </li>" + NL + "<li>Field | </li>"}, - {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "<li>Detail: </li>" + NL + "<li>Field | </li>"}, - }; - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "<HR>" + NL + NL + "<P>" + NL + NL + "<P>" + - "<!-- ========= END OF CLASS DATA ========= -->" + "<HR>"} - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestAnnotationTypes tester = new TestAnnotationTypes(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/AnnotationTypeField.html", true, + "<li>Summary: </li>\n" + + "<li><a href=\"#annotation.type." + + "field.summary\">Field</a> | </li>", + "<li>Detail: </li>\n" + + "<li><a href=\"#annotation.type." + + "field.detail\">Field</a> | </li>", + "<!-- =========== ANNOTATION TYPE FIELD SUMMARY =========== -->", + "<h3>Field Summary</h3>", + "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../" + + "pkg/AnnotationTypeField.html#DEFAULT_NAME\">DEFAULT_NAME</a></span>" + + "</code> </td>", + "<!-- ============ ANNOTATION TYPE FIELD DETAIL =========== -->", + "<h4>DEFAULT_NAME</h4>\n" + + "<pre>public static final java." + + "lang.String DEFAULT_NAME</pre>"); + + checkOutput("pkg/AnnotationType.html", true, + "<li>Summary: </li>\n" + + "<li>Field | </li>", + "<li>Detail: </li>\n" + + "<li>Field | </li>"); + + checkOutput("pkg/AnnotationType.html", false, + "<HR>\n\n" + + "<P>\n\n" + + "<P>" + + "<!-- ========= END OF CLASS DATA ========= -->" + "<HR>"); } }
--- a/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,44 +27,27 @@ * @summary Test to make sure that the link to source documentation * has a forward slash. It would be wrong to use a back slash. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestBackSlashInLink * @run main TestBackSlashInLink */ public class TestBackSlashInLink extends JavadocTester { - private static final String BUG_ID = "4511110"; - private static final String[][] TEST = { - {BUG_ID + FS + "C.html", "src-html/C.html#line.7"}}; - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - "-linksource", SRC_DIR + FS + "C.java"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestBackSlashInLink tester = new TestBackSlashInLink(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-linksource", + testSrc("C.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("C.html", true, + "src-html/C.html#line.7"); } }
--- a/test/com/sun/javadoc/testBadPackageFileInJar/TestBadPackageFileInJar.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testBadPackageFileInJar/TestBadPackageFileInJar.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,49 +27,27 @@ * @summary Test to make sure that Javadoc emits a useful warning * when a bad package.html file is in the JAR. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestBadPackageFileInJar * @run main TestBadPackageFileInJar */ public class TestBadPackageFileInJar extends JavadocTester { - private static final String BUG_ID = "4691095"; - - private static final String[][] TEST = - new String[][] { - {ERROR_OUTPUT, - "badPackageFileInJar.jar" +FS+"pkg/package.html: error - Body tag missing from HTML"} - }; - - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-classpath", - SRC_DIR + FS + "badPackageFileInJar.jar", "pkg"}; - - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestBadPackageFileInJar tester = new TestBadPackageFileInJar(); - run(tester, ARGS, TEST, NO_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-classpath", testSrc("badPackageFileInJar.jar"), + "pkg"); + checkExit(Exit.FAILED); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput(Output.ERROR, true, + "badPackageFileInJar.jar" + FS + "pkg/package.html: error - Body tag missing from HTML"); } }
--- a/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,48 +27,28 @@ * @summary Make sure exception is not thrown if there is a bad source * file in the same directory as the file being documented. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestBadSourceFile * @run main TestBadSourceFile */ public class TestBadSourceFile extends JavadocTester { - //Test information. - private static final String BUG_ID = "4835749"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-Xdoclint:none", "-d", BUG_ID, SRC_DIR + FS + "C2.java" - }; - - //Input for string search tests. - private static final String[][] TEST = NO_TEST; - private static final String[][] NEGATED_TEST = NO_TEST; - /** * The entry point of the test. - * @param args the array of command line arguments. + * @param args the array of command line arguments + * @throws Exception if the test fails */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestBadSourceFile tester = new TestBadSourceFile(); - int exitCode = run(tester, ARGS, TEST, NEGATED_TEST); - tester.checkExitCode(0, exitCode); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void test() { + javadoc("-Xdoclint:none", + "-d", "out", + testSrc("C2.java")); + checkExit(Exit.OK); } }
--- a/test/com/sun/javadoc/testBaseClass/TestBaseClass.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testBaseClass/TestBaseClass.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,46 +26,25 @@ * @bug 4197513 * @summary Javadoc does not process base class. * @author jamieh - * @library ../lib/ + * @library ../lib * @build BaseClass * @build JavadocTester - * @build TestBaseClass * @run main TestBaseClass */ public class TestBaseClass extends JavadocTester { - private static final String BUG_ID = "4197513"; - private static final String[][] TEST = NO_TEST; - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = - new String[] { - "-sourcepath", SRC_DIR, - "-docletpath", SRC_DIR, "-doclet", "BaseClass", - SRC_DIR + FS + "Bar.java", "baz"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestBaseClass tester = new TestBaseClass(); - if (run(tester, ARGS, TEST, NEGATED_TEST) != 0) { - throw new Error("Javadoc failed to execute."); - } + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void test() { + javadoc("-sourcepath", testSrc, + "-docletpath", testSrc, + "-doclet", "BaseClass", + testSrc("Bar.java"), "baz"); + checkExit(Exit.OK); } }
--- a/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,45 +29,27 @@ * Correct Answer: "The class is empty (i.e. it has no members)." * Wrong Answer: "The class is empty (i.e." * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestBreakIterator * @run main TestBreakIterator */ public class TestBreakIterator extends JavadocTester { - private static final String BUG_ID = "4165985"; - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "BreakIteratorTest.html", - "The class is empty (i.e. it has no members)."}}; - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - "-breakiterator", "pkg"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestBreakIterator tester = new TestBreakIterator(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-breakiterator", + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/BreakIteratorTest.html", true, + "The class is empty (i.e. it has no members)."); } }
--- a/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,9 +26,8 @@ * @bug 4979486 * @summary Make sure tool parses CR line separators properly. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestCRLineSeparator * @run main TestCRLineSeparator */ @@ -37,49 +36,27 @@ public class TestCRLineSeparator extends JavadocTester { - //Test information. - private static final String BUG_ID = "4979486-8014636"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", ".", "pkg" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "MyClass.html", "Line 1" + NL + " Line 2"} - }; - - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) throws Exception { - initFiles(new File(SRC_DIR), new File("."), "pkg"); + public static void main(String... args) throws Exception { TestCRLineSeparator tester = new TestCRLineSeparator(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() throws IOException { + initFiles(new File(testSrc), new File("src"), "pkg"); + javadoc("-d", "out", + "-sourcepath", "src", + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/MyClass.html", true, + "Line 1\n" + + " Line 2"); } // recursively copy files from fromDir to toDir, replacing newlines // with \r - static void initFiles(File fromDir, File toDir, String f) throws IOException { + void initFiles(File fromDir, File toDir, String f) throws IOException { File from_f = new File(fromDir, f); File to_f = new File(toDir, f); if (from_f.isDirectory()) { @@ -88,23 +65,17 @@ initFiles(from_f, to_f, child); } } else { - List<String> lines = new ArrayList<String>(); - BufferedReader in = new BufferedReader(new FileReader(from_f)); - try { + List<String> lines = new ArrayList<>(); + try (BufferedReader in = new BufferedReader(new FileReader(from_f))) { String line; while ((line = in.readLine()) != null) lines.add(line); - } finally { - in.close(); } - BufferedWriter out = new BufferedWriter(new FileWriter(to_f)); - try { + try (BufferedWriter out = new BufferedWriter(new FileWriter(to_f))) { for (String line: lines) { out.write(line); out.write("\r"); } - } finally { - out.close(); } } }
--- a/test/com/sun/javadoc/testCharset/TestCharset.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testCharset/TestCharset.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,56 +27,34 @@ * @summary Run a test on -charset to make sure the charset gets generated as a * part of the meta tag. * @author Bhavesh Patel - * @library ../lib/ - * @build JavadocTester TestCharset + * @library ../lib + * @build JavadocTester * @run main TestCharset */ public class TestCharset extends JavadocTester { - //Test information. - private static final String BUG_ID = "7052170"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-charset", "UTF-8", "-sourcepath", SRC_DIR, "pkg" - }; - - private static final String[][] TEST = { - {BUG_ID + FS + "index.html", - "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"}, - {BUG_ID + FS + "pkg" + FS + "Foo.html", - "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"} - }; - - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "index.html", - "<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"UTF-8\">"}, - {BUG_ID + FS + "pkg" + FS + "Foo.html", - "<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"UTF-8\">"} - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestCharset tester = new TestCharset(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-charset", "UTF-8", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("index.html", true, + "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"); + checkOutput("pkg/Foo.html", true, + "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"); + + checkOutput("index.html", false, + "<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"UTF-8\">"); + checkOutput("pkg/Foo.html", false, + "<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"UTF-8\">"); } }
--- a/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 4652655 4857717 8025633 8026567 * @summary This test verifies that class cross references work properly. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester * @build TestClassCrossReferences * @run main TestClassCrossReferences @@ -34,52 +34,34 @@ public class TestClassCrossReferences extends JavadocTester { - private static final String BUG_ID = "4652655-4857717"; - private static final String[][] TEST = { - {BUG_ID + FS + "C.html", - "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/package-summary.html?is-external=true\"><code>Link to math package</code></a>"}, - {BUG_ID + FS + "C.html", - "<a href=\"http://java.sun.com/j2se/1.4/docs/api/javax/swing/text/AbstractDocument.AttributeContext.html?is-external=true\" " + - "title=\"class or interface in javax.swing.text\"><code>Link to AttributeContext innerclass</code></a>"}, - {BUG_ID + FS + "C.html", - "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/BigDecimal.html?is-external=true\" " + - "title=\"class or interface in java.math\"><code>Link to external class BigDecimal</code></a>"}, - {BUG_ID + FS + "C.html", - "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/BigInteger.html?is-external=true#gcd-java.math.BigInteger-\" " + - "title=\"class or interface in java.math\"><code>Link to external member gcd</code></a>"}, - {BUG_ID + FS + "C.html", - "<dl>" + NL + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code>toString</code> in class <code>java.lang.Object</code></dd>" + NL + - "</dl>"} - }; - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - "-linkoffline", "http://java.sun.com/j2se/1.4/docs/api/", - SRC_DIR, SRC_DIR + FS + "C.java"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestClassCrossReferences tester = new TestClassCrossReferences(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void test() { + final String uri = "http://java.sun.com/j2se/1.4/docs/api/"; + + javadoc("-d", "out", + "-sourcepath", testSrc, + "-linkoffline", uri, testSrc, + testSrc("C.java")); + checkExit(Exit.OK); + + checkOutput("C.html", true, + "<a href=\"" + uri + "java/math/package-summary.html?is-external=true\">" + + "<code>Link to math package</code></a>", + "<a href=\"" + uri + "javax/swing/text/AbstractDocument.AttributeContext.html?is-external=true\" " + + "title=\"class or interface in javax.swing.text\"><code>Link to AttributeContext innerclass</code></a>", + "<a href=\"" + uri + "java/math/BigDecimal.html?is-external=true\" " + + "title=\"class or interface in java.math\"><code>Link to external class BigDecimal</code></a>", + "<a href=\"" + uri + "java/math/BigInteger.html?is-external=true#gcd-java.math.BigInteger-\" " + + "title=\"class or interface in java.math\"><code>Link to external member gcd</code></a>", + "<dl>\n" + + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code>toString</code> in class <code>java.lang.Object</code></dd>\n" + + "</dl>"); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } }
--- a/test/com/sun/javadoc/testClassTree/TestClassTree.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testClassTree/TestClassTree.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,71 +29,52 @@ * Make sure class tree includes heirarchy for enums and annotation * types. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestClassTree * @run main TestClassTree */ public class TestClassTree extends JavadocTester { - //Test information. - private static final String BUG_ID = "4632553-4973607"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-source", "1.5","-sourcepath", SRC_DIR, "pkg" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "package-tree.html", - "<ul>" + NL + "<li type=\"circle\">pkg.<a href=\"../pkg/ParentClass.html\" " + - "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a>"}, - - {BUG_ID + FS + "pkg" + FS + "package-tree.html", - "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>" + NL + - "<ul>" + NL + "<li type=\"circle\">pkg.<a href=\"../pkg/AnnotationType.html\" " + - "title=\"annotation in pkg\"><span class=\"typeNameLink\">AnnotationType</span></a> " + - "(implements java.lang.annotation.Annotation)</li>" + NL + "</ul>"}, - - {BUG_ID + FS + "pkg" + FS + "package-tree.html", - "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>" + NL + "<ul>" + NL + - "<li type=\"circle\">java.lang.Object" + NL + "<ul>" + NL + - "<li type=\"circle\">java.lang.Enum<E> (implements java.lang." + - "Comparable<T>, java.io.Serializable)" + NL + "<ul>" + NL + - "<li type=\"circle\">pkg.<a href=\"../pkg/Coin.html\" " + - "title=\"enum in pkg\"><span class=\"typeNameLink\">Coin</span></a></li>" + NL + - "</ul>" + NL + "</li>" + NL + "</ul>" + NL + "</li>" + NL + "</ul>" - }, - }; - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg" + FS + "package-tree.html", - "<li type=\"circle\">class pkg.<a href=\"../pkg/ParentClass.html\" " + - "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a></li>"} - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestClassTree tester = new TestClassTree(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/package-tree.html", true, + "<ul>\n" + + "<li type=\"circle\">pkg.<a href=\"../pkg/ParentClass.html\" " + + "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a>", + "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>\n" + + "<ul>\n" + + "<li type=\"circle\">pkg.<a href=\"../pkg/AnnotationType.html\" " + + "title=\"annotation in pkg\"><span class=\"typeNameLink\">AnnotationType</span></a> " + + "(implements java.lang.annotation.Annotation)</li>\n" + + "</ul>", + "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>\n" + + "<ul>\n" + + "<li type=\"circle\">java.lang.Object\n" + + "<ul>\n" + + "<li type=\"circle\">java.lang.Enum<E> (implements java.lang." + + "Comparable<T>, java.io.Serializable)\n" + + "<ul>\n" + + "<li type=\"circle\">pkg.<a href=\"../pkg/Coin.html\" " + + "title=\"enum in pkg\"><span class=\"typeNameLink\">Coin</span></a></li>\n" + + "</ul>\n" + + "</li>\n" + + "</ul>\n" + + "</li>\n" + + "</ul>"); + + checkOutput("pkg/package-tree.html", false, + "<li type=\"circle\">class pkg.<a href=\"../pkg/ParentClass.html\" " + + "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a></li>"); } }
--- a/test/com/sun/javadoc/testCmndLineClass/TestCmndLineClass.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testCmndLineClass/TestCmndLineClass.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,64 +28,44 @@ * when specifying packages on the command line and specifying individual * classes. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestCmndLineClass * @run main TestCmndLineClass */ public class TestCmndLineClass extends JavadocTester { - private static final String OUTPUT_DIR1 = "4506980-tmp1"; - private static final String OUTPUT_DIR2 = "4506980-tmp2"; - private static final String[][] TEST = NO_TEST; - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS1 = - new String[] { - "-d", OUTPUT_DIR1, "-sourcepath", SRC_DIR, - "-notimestamp", SRC_DIR + FS + "C5.java", "pkg1", "pkg2" - }; - private static final String[] ARGS2 = - new String[] { - "-d", OUTPUT_DIR2, "-sourcepath", SRC_DIR, - "-notimestamp", SRC_DIR + FS + "C5.java", - SRC_DIR + FS + "pkg1" + FS + "C1.java", - SRC_DIR + FS + "pkg1" + FS + "C2.java", - SRC_DIR + FS + "pkg2" + FS + "C3.java", - SRC_DIR + FS + "pkg2" + FS + "C4.java" - }; - private static final String[][] FILES_TO_DIFF = { - {OUTPUT_DIR1 + FS + "C5.html", OUTPUT_DIR2 + FS + "C5.html"}, - {OUTPUT_DIR2 + FS + "pkg1" + FS + "C1.html", OUTPUT_DIR2 + FS + "pkg1" + FS + "C1.html"}, - {OUTPUT_DIR1 + FS + "pkg1" + FS + "C2.html", OUTPUT_DIR2 + FS + "pkg1" + FS + "C2.html"}, - {OUTPUT_DIR1 + FS + "pkg2" + FS + "C3.html", OUTPUT_DIR2 + FS + "pkg2" + FS + "C3.html"}, - {OUTPUT_DIR1 + FS + "pkg2" + FS + "C4.html", OUTPUT_DIR2 + FS + "pkg2" + FS + "C4.html"} - }; - - private static final String BUG_ID = "4506980"; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestCmndLineClass tester = new TestCmndLineClass(); - run(tester, ARGS1, TEST, NEGATED_TEST); - run(tester, ARGS2, TEST, NEGATED_TEST); - tester.runDiffs(FILES_TO_DIFF); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + String outdir1 = "out-1"; + String outdir2 = "out-2"; + + javadoc("-d", outdir1, + "-sourcepath", testSrc, + "-notimestamp", + testSrc("C5.java"), "pkg1", "pkg2"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + javadoc("-d", outdir2, + "-sourcepath", testSrc, + "-notimestamp", + testSrc("C5.java"), + testSrc("pkg1/C1.java"), + testSrc("pkg1/C2.java"), + testSrc("pkg2/C3.java"), + testSrc("pkg2/C4.java")); + checkExit(Exit.OK); + + diff(outdir1, outdir2, + "C5.html", + "pkg1/C1.html", + "pkg1/C2.html", + "pkg2/C3.html", + "pkg2/C4.html"); } }
--- a/test/com/sun/javadoc/testCompletionFailure/TestCompletionFailure.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testCompletionFailure/TestCompletionFailure.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,48 +26,28 @@ * @bug 8027977 * @summary Test to verify javadoc executes without CompletionFailure exception. * @author Bhavesh Patel - * @library ../lib/ - * @build JavadocTester TestCompletionFailure + * @library ../lib + * @build JavadocTester * @run main TestCompletionFailure */ public class TestCompletionFailure extends JavadocTester { - private static final String BUG_ID = "8027977"; - - //Input for string search tests. - private static final String[][] NEGATED_TEST = { - {ERROR_OUTPUT, "TestCompletionFailure: error - " + - "com.sun.tools.javac.code.Symbol$CompletionFailure: class file for " + - "sun.util.locale.provider.LocaleProviderAdapter not found" - } - }; - - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) throws Exception { + public static void main(String... args) throws Exception { TestCompletionFailure tester = new TestCompletionFailure(); - run(tester, ARGS, NO_TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput(Output.STDERR, false, + "TestCompletionFailure: error - " + + "com.sun.tools.javac.code.Symbol$CompletionFailure: class file for " + + "sun.util.locale.provider.LocaleProviderAdapter not found"); } }
--- a/test/com/sun/javadoc/testConstantValuesPage/TestConstantValuesPage.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testConstantValuesPage/TestConstantValuesPage.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,44 +27,26 @@ * @summary Test to make sure that constant values page does not get * generated when doclet has nothing to document. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestConstantValuesPage * @run main TestConstantValuesPage */ public class TestConstantValuesPage extends JavadocTester { - private static final String BUG_ID = "4681599"; - private static final String[][] TEST = NO_TEST; - private static final String[][] NEGATED_TEST = { - {NOTICE_OUTPUT, "constant-values.html..."} - }; - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "foo"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestConstantValuesPage tester = new TestConstantValuesPage(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "foo"); + checkExit(Exit.FAILED); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput(Output.NOTICE, false, + "constant-values.html..."); } }
--- a/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,53 +27,31 @@ * @summary The constructor comments should be surrounded by * <dl></dl>. Check for this in the output. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestConstructorIndent * @run main TestConstructorIndent */ public class TestConstructorIndent extends JavadocTester { - //Test information. - private static final String BUG_ID = "4904037"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, SRC_DIR + FS + "C.java" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "C.html", "<div class=\"block\">" + - "This is just a simple constructor.</div>" + NL + - "<dl>" + NL + "<dt><span class=\"paramLabel\">Parameters:</span></dt>" + NL + - "<dd><code>i</code> - a param.</dd>" + NL +"</dl>" - } - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestConstructorIndent tester = new TestConstructorIndent(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + testSrc("C.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("C.html", true, + "<div class=\"block\">" + + "This is just a simple constructor.</div>\n" + + "<dl>\n" + + "<dt><span class=\"paramLabel\">Parameters:</span></dt>\n" + + "<dd><code>i</code> - a param.</dd>\n" + + "</dl>"); } }
--- a/test/com/sun/javadoc/testConstructors/TestConstructors.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testConstructors/TestConstructors.java Tue Nov 10 02:47:05 2020 +0000 @@ -26,122 +26,66 @@ * @bug 8025524 8031625 * @summary Test for constructor name which should be a non-qualified name. * @author Bhavesh Patel - * @library ../lib/ - * @build JavadocTester TestConstructors + * @library ../lib + * @build JavadocTester * @run main TestConstructors */ public class TestConstructors extends JavadocTester { - private static final String BUG_ID = "8025524"; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg1" + FS + "Outer.html", - "<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + - "<dd><a href=\"../pkg1/Outer.Inner.html#Inner--\"><code>Inner()</code></a>, " + NL + - "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\"><code>Inner(int)</code></a>, " + NL + - "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner--\"><code>NestedInner()</code></a>, " + NL + - "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\"><code>NestedInner(int)</code></a>, " + NL + - "<a href=\"../pkg1/Outer.html#Outer--\"><code>Outer()</code></a>, " + NL + - "<a href=\"../pkg1/Outer.html#Outer-int-\"><code>Outer(int)</code></a>" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.html", - "Link: <a href=\"../pkg1/Outer.Inner.html#Inner--\"><code>Inner()</code></a>, " + - "<a href=\"../pkg1/Outer.html#Outer-int-\"><code>Outer(int)</code></a>, " + - "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\"><code>" + - "NestedInner(int)</code></a>" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.html", - "<a href=\"../pkg1/Outer.html#Outer--\">Outer</a></span>()" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.html", - "<a name=\"Outer--\">" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.html", - "<a href=\"../pkg1/Outer.html#Outer-int-\">Outer</a></span>(int i)" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.html", - "<a name=\"Outer-int-\">" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.html", - "<a href=\"../pkg1/Outer.Inner.html#Inner--\">Inner</a></span>()" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.html", - "<a name=\"Inner--\">" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.html", - "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\">Inner</a></span>(int i)" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.html", - "<a name=\"Inner-int-\">" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.NestedInner.html", - "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner--\">NestedInner</a></span>()" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.NestedInner.html", - "<a name=\"NestedInner--\">" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.NestedInner.html", - "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\">NestedInner</a></span>(int i)" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.NestedInner.html", - "<a name=\"NestedInner-int-\">" - } - }; - - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.html", - "Outer.Inner--" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.html", - "Outer.Inner-int-" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.NestedInner.html", - "Outer.Inner.NestedInner--" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.NestedInner.html", - "Outer.Inner.NestedInner-int-" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.html", - "<a href=\"../pkg1/Outer.Inner.html#Outer.Inner--\"><code>Outer.Inner()</code></a>" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.html", - "<a href=\"../pkg1/Outer.Inner.html#Outer.Inner-int-\"><code>Outer.Inner(int)</code></a>" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.html", - "<a href=\"../pkg1/Outer.Inner.NestedInner.html#Outer.Inner.NestedInner--\"><code>Outer.Inner.NestedInner()</code></a>" - }, - {BUG_ID + FS + "pkg1" + FS + "Outer.html", - "<a href=\"../pkg1/Outer.Inner.NestedInner.html#Outer.Inner.NestedInner-int-\"><code>Outer.Inner.NestedInner(int)</code></a>" - } - }; - - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) throws Exception { + public static void main(String... args) throws Exception { TestConstructors tester = new TestConstructors(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.OK); + + checkOutput("pkg1/Outer.html", true, + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" + + "<dd><a href=\"../pkg1/Outer.Inner.html#Inner--\"><code>Inner()</code></a>, \n" + + "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\"><code>Inner(int)</code></a>, \n" + + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner--\"><code>NestedInner()</code></a>, \n" + + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\"><code>NestedInner(int)</code></a>, \n" + + "<a href=\"../pkg1/Outer.html#Outer--\"><code>Outer()</code></a>, \n" + + "<a href=\"../pkg1/Outer.html#Outer-int-\"><code>Outer(int)</code></a>", + "Link: <a href=\"../pkg1/Outer.Inner.html#Inner--\"><code>Inner()</code></a>, " + + "<a href=\"../pkg1/Outer.html#Outer-int-\"><code>Outer(int)</code></a>, " + + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\"><code>" + + "NestedInner(int)</code></a>", + "<a href=\"../pkg1/Outer.html#Outer--\">Outer</a></span>()", + "<a name=\"Outer--\">", + "<a href=\"../pkg1/Outer.html#Outer-int-\">Outer</a></span>(int i)", + "<a name=\"Outer-int-\">"); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg1/Outer.Inner.html", true, + "<a href=\"../pkg1/Outer.Inner.html#Inner--\">Inner</a></span>()", + "<a name=\"Inner--\">", + "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\">Inner</a></span>(int i)", + "<a name=\"Inner-int-\">"); + + checkOutput("pkg1/Outer.Inner.NestedInner.html", true, + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner--\">NestedInner</a></span>()", + "<a name=\"NestedInner--\">", + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\">NestedInner</a></span>(int i)", + "<a name=\"NestedInner-int-\">"); + + checkOutput("pkg1/Outer.Inner.html", false, + "Outer.Inner--", + "Outer.Inner-int-"); + + checkOutput("pkg1/Outer.Inner.NestedInner.html", false, + "Outer.Inner.NestedInner--", + "Outer.Inner.NestedInner-int-"); + + checkOutput("pkg1/Outer.html", false, + "<a href=\"../pkg1/Outer.Inner.html#Outer.Inner--\"><code>Outer.Inner()</code></a>", + "<a href=\"../pkg1/Outer.Inner.html#Outer.Inner-int-\"><code>Outer.Inner(int)</code></a>", + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#Outer.Inner.NestedInner--\"><code>Outer.Inner.NestedInner()</code></a>", + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#Outer.Inner.NestedInner-int-\"><code>Outer.Inner.NestedInner(int)</code></a>"); } }
--- a/test/com/sun/javadoc/testCustomTag/TestCustomTag.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testCustomTag/TestCustomTag.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,84 +26,67 @@ * @bug 8006248 * @summary Test custom tag. Verify that an unknown tag generates appropriate warnings. * @author Bhavesh Patel - * @library ../lib/ - * @build JavadocTester taglets.CustomTag TestCustomTag + * @library ../lib + * @build JavadocTester taglets.CustomTag * @run main TestCustomTag */ public class TestCustomTag extends JavadocTester { - //Test information. - private static final String BUG_ID = "8006248"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-Xdoclint:none", "-d", BUG_ID, "-tagletpath", SRC_DIR, - "-taglet", "taglets.CustomTag", "-sourcepath", - SRC_DIR, SRC_DIR + FS + "TagTestClass.java" - }; - - private static final String[] ARGS1 = new String[] { - "-d", BUG_ID + "-1", "-tagletpath", SRC_DIR, "-taglet", "taglets.CustomTag", - "-sourcepath", SRC_DIR, SRC_DIR + FS + "TagTestClass.java" - }; - private static final String[] ARGS2 = new String[] { - "-Xdoclint:none", "-d", BUG_ID + "-2", "-sourcepath", - SRC_DIR, SRC_DIR + FS + "TagTestClass.java" - }; - - private static final String[] ARGS3 = new String[] { - "-d", BUG_ID + "-3", "-sourcepath", SRC_DIR, SRC_DIR + FS + "TagTestClass.java" - }; - - //Input for string search tests. - private static final String[][] TEST = new String[][] { - {WARNING_OUTPUT, "warning - @unknownTag is an unknown tag." - } - }; + public static void main(String... args) throws Exception { + TestCustomTag tester = new TestCustomTag(); + tester.runTests(); + } - private static final String[][] TEST1 = new String[][] { - {ERROR_OUTPUT, "error: unknown tag: unknownTag" - } - }; - private static final String[][] TEST2 = new String[][] { - {WARNING_OUTPUT, "warning - @customTag is an unknown tag." - }, - {WARNING_OUTPUT, "warning - @unknownTag is an unknown tag." - } - }; + @Test + void test1() { + javadoc("-Xdoclint:none", + "-d", "out-1", + "-tagletpath", testSrc, // TODO: probably useless + "-taglet", "taglets.CustomTag", + "-sourcepath", testSrc, + testSrc("TagTestClass.java")); + checkExit(Exit.OK); - private static final String[][] TEST3 = new String[][] { - {ERROR_OUTPUT, "error: unknown tag: customTag" - }, - {ERROR_OUTPUT, "error: unknown tag: unknownTag" - } - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestCustomTag tester = new TestCustomTag(); - run(tester, ARGS, TEST, NO_TEST); - run(tester, ARGS1, TEST1, NO_TEST); - run(tester, ARGS2, TEST2, NO_TEST); - run(tester, ARGS3, TEST3, NO_TEST); - tester.printSummary(); + checkOutput(Output.WARNING, true, + "warning - @unknownTag is an unknown tag."); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void test2() { + javadoc("-d", "out-2", + "-tagletpath", testSrc, // TODO: probably useless + "-taglet", "taglets.CustomTag", + "-sourcepath", testSrc, + testSrc("TagTestClass.java")); + checkExit(Exit.FAILED); + + checkOutput(Output.ERROR, true, + "error: unknown tag: unknownTag"); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void test3() { + javadoc("-Xdoclint:none", + "-d", "out-3", + "-sourcepath", testSrc, + testSrc("TagTestClass.java")); + checkExit(Exit.OK); + + checkOutput(Output.WARNING, true, + "warning - @customTag is an unknown tag.", + "warning - @unknownTag is an unknown tag."); + } + + @Test + void test4() { + javadoc("-d", "out-4", + "-sourcepath", testSrc, + testSrc("TagTestClass.java")); + checkExit(Exit.FAILED); + + checkOutput(Output.ERROR, true, + "error: unknown tag: customTag", + "error: unknown tag: unknownTag"); } }
--- a/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,95 +26,65 @@ * @bug 4927552 8026567 * @summary <DESC> * @author jamieh - * @library ../lib/ - * @build JavadocTester TestDeprecatedDocs + * @library ../lib + * @build JavadocTester * @run main TestDeprecatedDocs */ public class TestDeprecatedDocs extends JavadocTester { - //Test information. - private static final String BUG_ID = "4927552"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR, "pkg" - }; - - private static final String TARGET_FILE = - BUG_ID + FS + "deprecated-list.html"; - - private static final String TARGET_FILE2 = - BUG_ID + FS + "pkg" + FS + "DeprecatedClassByAnnotation.html"; - - //Input for string search tests. - private static final String[][] TEST = { - {TARGET_FILE, "annotation_test1 passes"}, - {TARGET_FILE, "annotation_test2 passes"}, - {TARGET_FILE, "annotation_test3 passes"}, - {TARGET_FILE, "class_test1 passes"}, - {TARGET_FILE, "class_test2 passes"}, - {TARGET_FILE, "class_test3 passes"}, - {TARGET_FILE, "class_test4 passes"}, - {TARGET_FILE, "enum_test1 passes"}, - {TARGET_FILE, "enum_test2 passes"}, - {TARGET_FILE, "error_test1 passes"}, - {TARGET_FILE, "error_test2 passes"}, - {TARGET_FILE, "error_test3 passes"}, - {TARGET_FILE, "error_test4 passes"}, - {TARGET_FILE, "exception_test1 passes"}, - {TARGET_FILE, "exception_test2 passes"}, - {TARGET_FILE, "exception_test3 passes"}, - {TARGET_FILE, "exception_test4 passes"}, - {TARGET_FILE, "interface_test1 passes"}, - {TARGET_FILE, "interface_test2 passes"}, - {TARGET_FILE, "interface_test3 passes"}, - {TARGET_FILE, "interface_test4 passes"}, - {TARGET_FILE, "pkg.DeprecatedClassByAnnotation"}, - {TARGET_FILE, "pkg.DeprecatedClassByAnnotation()"}, - {TARGET_FILE, "pkg.DeprecatedClassByAnnotation.method()"}, - {TARGET_FILE, "pkg.DeprecatedClassByAnnotation.field"}, - - {TARGET_FILE2, "<pre>@Deprecated" + NL + - "public class <span class=\"typeNameLabel\">DeprecatedClassByAnnotation</span>" + NL + - "extends java.lang.Object</pre>"}, - - {TARGET_FILE2, "<pre>@Deprecated" + NL + - "public int field</pre>" + NL + - "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"}, - - {TARGET_FILE2, "<pre>@Deprecated" + NL + - "public DeprecatedClassByAnnotation()</pre>" + NL + - "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"}, - - {TARGET_FILE2, "<pre>@Deprecated" + NL + - "public void method()</pre>" + NL + - "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"}, - }; - - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestDeprecatedDocs tester = new TestDeprecatedDocs(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("deprecated-list.html", true, + "annotation_test1 passes", + "annotation_test2 passes", + "annotation_test3 passes", + "class_test1 passes", + "class_test2 passes", + "class_test3 passes", + "class_test4 passes", + "enum_test1 passes", + "enum_test2 passes", + "error_test1 passes", + "error_test2 passes", + "error_test3 passes", + "error_test4 passes", + "exception_test1 passes", + "exception_test2 passes", + "exception_test3 passes", + "exception_test4 passes", + "interface_test1 passes", + "interface_test2 passes", + "interface_test3 passes", + "interface_test4 passes", + "pkg.DeprecatedClassByAnnotation", + "pkg.DeprecatedClassByAnnotation()", + "pkg.DeprecatedClassByAnnotation.method()", + "pkg.DeprecatedClassByAnnotation.field" + ); + + checkOutput("pkg/DeprecatedClassByAnnotation.html", true, + "<pre>@Deprecated\n" + + "public class <span class=\"typeNameLabel\">DeprecatedClassByAnnotation</span>\n" + + "extends java.lang.Object</pre>", + "<pre>@Deprecated\n" + + "public int field</pre>\n" + + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>", + "<pre>@Deprecated\n" + + "public DeprecatedClassByAnnotation()</pre>\n" + + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>", + "<pre>@Deprecated\n" + + "public void method()</pre>\n" + + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"); } }
--- a/test/com/sun/javadoc/testDocEncoding/TestDocEncoding.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testDocEncoding/TestDocEncoding.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,51 +31,30 @@ * @summary Run tests on -docencoding to see if the value is used for stylesheet as well. * @author jayashree viswanathan - * @library ../lib/ - * @build JavadocTester TestDocEncoding + * @library ../lib + * @build JavadocTester * @run main TestDocEncoding */ public class TestDocEncoding extends JavadocTester { - //Test information. - private static final String BUG_ID = "8000743"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-docencoding", "Cp930", - "-sourcepath", SRC_DIR, "pkg" - }; - - private static final String[][] TEST = NO_TEST; - - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "stylesheet.css", - "body {" + NL + " background-color:#ffffff;"} - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestDocEncoding tester = new TestDocEncoding(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-docencoding", "Cp930", + "-sourcepath", testSrc, + "-notimestamp", + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("stylesheet.css", false, + "body {\n" + + " background-color:#ffffff;"); } }
--- a/test/com/sun/javadoc/testDocErrorReporter/TestDocErrorReporter.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testDocErrorReporter/TestDocErrorReporter.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,52 +27,30 @@ * @summary Make sure that option validation errors and sent to the * DocErrorReporter. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestDocErrorReporter * @run main TestDocErrorReporter */ public class TestDocErrorReporter extends JavadocTester { - //Test information. - private static final String BUG_ID = "4927928"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-encoding", "xyz", - SRC_DIR + FS + "TestDocErrorReporter.java" - }; - - //Input for string search tests. - private static final String[][] TEST = NO_TEST; - private static final String[][] NEGATED_TEST = NO_TEST; - - //Input for Javadoc return code test. - private static final int EXPECTED_EXIT_CODE = 1; - /** * The entry point of the test. - * @param args the array of command line arguments. + * @param args the array of command line arguments + * @throws Exception if the test fails */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestDocErrorReporter tester = new TestDocErrorReporter(); - int actualExitCode = run(tester, ARGS, TEST, NEGATED_TEST); - tester.checkExitCode(EXPECTED_EXIT_CODE, actualExitCode); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-encoding", "xyz", + testSrc("TestDocErrorReporter.java")); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkExit(Exit.FAILED); } }
--- a/test/com/sun/javadoc/testDocFileDir/TestDocFileDir.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testDocFileDir/TestDocFileDir.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,8 +21,6 @@ * questions. */ -import java.io.File; - /* * @test * @bug 4258405 4973606 8024096 @@ -31,88 +29,59 @@ * directory. * Also test that -docfilessubdirs and -excludedocfilessubdir both work. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestDocFileDir * @run main TestDocFileDir */ public class TestDocFileDir extends JavadocTester { - private static final String BUG_ID = "4258405-4973606"; - - private static final String[][] TEST1 = { - {BUG_ID + "-1" + FS + "pkg" + FS + "doc-files" + FS + "testfile.txt", - "This doc file did not get trashed."} - }; - private static final String[][] NEGATED_TEST1 = NO_TEST; - - private static final String[] FILE_TEST2 = { - BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-used1" + - FS + "testfile.txt", - BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-used2" + - FS + "testfile.txt" - }; - private static final String[] FILE_NEGATED_TEST2 = { - BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-excluded1" + - FS + "testfile.txt", - BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-excluded2" + - FS + "testfile.txt" - }; - - private static final String[][] TEST0 = { - {"pkg" + FS + "doc-files" + FS + "testfile.txt", - "This doc file did not get trashed."} - }; - private static final String[][] NEGATED_TEST0 = {}; + public static void main(String... args) throws Exception { + TestDocFileDir tester = new TestDocFileDir(); + tester.runTests(); + } - //Output dir = Input Dir - private static final String[] ARGS1 = - new String[] { - "-d", BUG_ID + "-1", - "-sourcepath", - "blah" + File.pathSeparator + BUG_ID + "-1" + File.pathSeparator + "blah", - "pkg"}; - - //Exercising -docfilessubdirs and -excludedocfilessubdir - private static final String[] ARGS2 = - new String[] { - "-d", BUG_ID + "-2", - "-sourcepath", SRC_DIR, - "-docfilessubdirs", - "-excludedocfilessubdir", "subdir-excluded1:subdir-excluded2", - "pkg"}; - - //Output dir = "", Input dir = "" - private static final String[] ARGS0 = - new String[] {"pkg" + FS + "C.java"}; - - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestDocFileDir tester = new TestDocFileDir(); - copyDir(SRC_DIR + FS + "pkg", "."); - run(tester, ARGS0, TEST0, NEGATED_TEST0); - copyDir(SRC_DIR + FS + "pkg", BUG_ID + "-1"); - run(tester, ARGS1, TEST1, NEGATED_TEST1); - run(tester, ARGS2, NO_TEST, NO_TEST, FILE_TEST2, FILE_NEGATED_TEST2); - tester.printSummary(); + // Output dir = "", Input dir = "" + @Test + void test1() { + copyDir(testSrc("pkg"), "."); + setOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES); + javadoc("pkg/C.java"); + checkExit(Exit.OK); + checkOutput("pkg/doc-files/testfile.txt", true, + "This doc file did not get trashed."); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + // Output dir = Input Dir + @Test + void test2() { + String outdir = "out2"; + copyDir(testSrc("pkg"), outdir); + setOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES); + javadoc("-d", outdir, + "-sourcepath", "blah" + PS + outdir + PS + "blah", + "pkg"); + checkExit(Exit.OK); + checkOutput("pkg/doc-files/testfile.txt", true, + "This doc file did not get trashed."); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + // Exercising -docfilessubdirs and -excludedocfilessubdir + @Test + void test3() { + String outdir = "out3"; + setOutputDirectoryCheck(DirectoryCheck.NONE); + javadoc("-d", outdir, + "-sourcepath", testSrc, + "-docfilessubdirs", + "-excludedocfilessubdir", "subdir-excluded1:subdir-excluded2", + "pkg"); + checkExit(Exit.OK); + checkFiles(true, + "pkg/doc-files/subdir-used1/testfile.txt", + "pkg/doc-files/subdir-used2/testfile.txt"); + checkFiles(false, + "pkg/doc-files/subdir-excluded1/testfile.txt", + "pkg/doc-files/subdir-excluded2/testfile.txt"); } }
--- a/test/com/sun/javadoc/testDocFiles/TestDocFiles.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testDocFiles/TestDocFiles.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,43 +25,26 @@ * @test * @bug 8008949 * @summary verify that doc-files get copied - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestDocFiles * @run main TestDocFiles */ public class TestDocFiles extends JavadocTester { - private static final String BUG_ID = "8008949"; - private static final String[][] TEST = { - {"tmp" + FS + "pkg" + FS + "doc-files" + FS + "test.txt", "test file"}}; - - private static final String[] ARGS = - new String[] { - "-d", "tmp", "-sourcepath", SRC_DIR, "pkg"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestDocFiles tester = new TestDocFiles(); - run(tester, ARGS, TEST, NO_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/doc-files/test.txt", true, + "test file"); } }
--- a/test/com/sun/javadoc/testDocRootInlineTag/TestDocRootInlineTag.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testDocRootInlineTag/TestDocRootInlineTag.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,58 +28,38 @@ * If docRoot performs as documented, the test passes. * Make sure that the docRoot tag works with the -bottom option. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestDocRootInlineTag * @run main TestDocRootInlineTag */ public class TestDocRootInlineTag extends JavadocTester { - private static final String BUG_ID = "4369014-4851991"; - private static final String[][] TEST = { - {BUG_ID + FS + "TestDocRootTag.html", - "<a href=\"http://www.java.sun.com/j2se/1.4/docs/api/java/io/File.html?is-external=true\" " + - "title=\"class or interface in java.io\"><code>File</code></a>"}, - {BUG_ID + FS + "TestDocRootTag.html", - "<a href=\"./glossary.html\">glossary</a>"}, - {BUG_ID + FS + "TestDocRootTag.html", - "<a href=\"http://www.java.sun.com/j2se/1.4/docs/api/java/io/File.html?is-external=true\" " + - "title=\"class or interface in java.io\"><code>Second File Link</code></a>"}, - {BUG_ID + FS + "TestDocRootTag.html", "The value of @docRoot is \"./\""}, - {BUG_ID + FS + "index-all.html", "My package page is " + - "<a href=\"./pkg/package-summary.html\">here</a>"} - }; - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = - new String[] { - "-bottom", "The value of @docRoot is \"{@docRoot}\"", - "-d", BUG_ID, "-sourcepath", SRC_DIR, - "-linkoffline", "http://www.java.sun.com/j2se/1.4/docs/api", - SRC_DIR, SRC_DIR + FS + "TestDocRootTag.java", "pkg" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestDocRootInlineTag tester = new TestDocRootInlineTag(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + String uri = "http://www.java.sun.com/j2se/1.4/docs/api"; + + javadoc("-bottom", "The value of @docRoot is \"{@docRoot}\"", + "-d", "out", + "-sourcepath", testSrc, + "-linkoffline", uri, testSrc, + testSrc("TestDocRootTag.java"), "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("TestDocRootTag.html", true, + "<a href=\"" + uri + "/java/io/File.html?is-external=true\" " + + "title=\"class or interface in java.io\"><code>File</code></a>", + "<a href=\"./glossary.html\">glossary</a>", + "<a href=\"" + uri + "/java/io/File.html?is-external=true\" " + + "title=\"class or interface in java.io\"><code>Second File Link</code></a>", + "The value of @docRoot is \"./\""); + + checkOutput("index-all.html", true, + "My package page is <a href=\"./pkg/package-summary.html\">here</a>"); } }
--- a/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,120 +26,78 @@ * @bug 6553182 8025416 8029504 * @summary This test verifies the -Xdocrootparent option. * @author Bhavesh Patel - * @library ../lib/ - * @build JavadocTester TestDocRootLink + * @library ../lib + * @build JavadocTester * @run main TestDocRootLink */ public class TestDocRootLink extends JavadocTester { - private static final String BUG_ID = "6553182"; - private static final String[][] TEST1 = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", - "Refer <a href=\"../../technotes/guides/index.html\">Here</a>" - }, - {BUG_ID + FS + "pkg1" + FS + "C1.html", - "This <a href=\"../pkg2/C2.html\">Here</a> should not be replaced" + NL + - " with an absolute link." - }, - {BUG_ID + FS + "pkg1" + FS + "C1.html", - "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and" + NL + - " <a href=\"../pkg2/C2.html\">Link 2</a>." - }, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "<a href=\"../../technotes/guides/index.html\">" + NL + - " Test document 1</a>" - }, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "<a href=\"../pkg2/C2.html\">" + NL + - " Another Test document 1</a>" - }, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "<a href=\"../technotes/guides/index.html\">" + NL + - " Another Test document 2.</a>" - } - }; - private static final String[][] NEGATED_TEST1 = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", - "<a href=\"https://docs.oracle.com/javase/7/docs/technotes/guides/index.html\">" - }, - {BUG_ID + FS + "pkg1" + FS + "C1.html", - "<a href=\"https://docs.oracle.com/javase/7/docs/pkg2/C2.html\">" - }, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "<a href=\"https://docs.oracle.com/javase/7/docs/technotes/guides/index.html\">" - }, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "<a href=\"https://docs.oracle.com/javase/7/docs/pkg2/C2.html\">" - } - }; - private static final String[][] TEST2 = { - {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html", - "Refer <a href=\"https://docs.oracle.com/javase/7/docs/technotes/guides/index.html\">Here</a>" - }, - {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html", - "This <a href=\"../pkg1/C1.html\">Here</a> should not be replaced" + NL + - " with an absolute link." - }, - {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html", - "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and" + NL + - " <a href=\"../pkg1/C1.html\">Link 2</a>." - }, - {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html", - "<a href=\"https://docs.oracle.com/javase/7/docs/technotes/guides/index.html\">" + NL + - " Test document 1</a>" - }, - {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html", - "<a href=\"../pkg1/C1.html\">" + NL + " Another Test document 1</a>" - }, - {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html", - "<a href=\"../technotes/guides/index.html\">" + NL + " Another Test document 2.</a>" - } - }; - private static final String[][] NEGATED_TEST2 = { - {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html", - "<a href=\"../../technotes/guides/index.html\">" - }, - {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html", - "<a href=\"https://docs.oracle.com/javase/7/docs/pkg1/C1.html\">" - }, - {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html", - "<a href=\"../../technotes/guides/index.html\">" - }, - {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html", - "<a href=\"https://docs.oracle.com/javase/7/docs/pkg1/C1.html\">" - } - }; - private static final String[] ARGS1 = - new String[]{ - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2" - }; - private static final String[] ARGS2 = - new String[]{ - "-d", BUG_ID + "-1", "-Xdocrootparent", "https://docs.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg1", "pkg2" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestDocRootLink tester = new TestDocRootLink(); - run(tester, ARGS1, TEST1, NEGATED_TEST1); - run(tester, ARGS2, TEST2, NEGATED_TEST2); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void test1() { + javadoc("-d", "out-1", + "-sourcepath", testSrc, + "pkg1", "pkg2"); + checkExit(Exit.OK); + + checkOutput("pkg1/C1.html", true, + "Refer <a href=\"../../technotes/guides/index.html\">Here</a>", + "This <a href=\"../pkg2/C2.html\">Here</a> should not be replaced\n" + + " with an absolute link.", + "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and\n" + + " <a href=\"../pkg2/C2.html\">Link 2</a>."); + + checkOutput("pkg1/package-summary.html", true, + "<a href=\"../../technotes/guides/index.html\">\n" + + " Test document 1</a>", + "<a href=\"../pkg2/C2.html\">\n" + + " Another Test document 1</a>", + "<a href=\"../technotes/guides/index.html\">\n" + + " Another Test document 2.</a>"); + + // TODO: should this check *any* reference to http://download.oracle.com/ + checkOutput("pkg1/C1.html", false, + "<a href=\"https://docs.oracle.com/javase/7/docs/technotes/guides/index.html\">" + "<a href=\"https://docs.oracle.com/javase/7/docs/pkg2/C2.html\">" + + checkOutput("pkg1/package-summary.html", false, + "<a href=\"https://docs.oracle.com/javase/7/docs/technotes/guides/index.html\">" + "<a href=\"https://docs.oracle.com/javase/7/docs/pkg2/C2.html\">" } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void test2() { + javadoc("-d", "out-2", + "-Xdocrootparent", "https://docs.oracle.com/javase/7/docs", + "-sourcepath", testSrc, + "pkg1", "pkg2"); + checkExit(Exit.OK); + + checkOutput("pkg2/C2.html", true, + "Refer <a href=\"https://docs.oracle.com/javase/7/docs/technotes/guides/index.html\">Here</a>" + "This <a href=\"../pkg1/C1.html\">Here</a> should not be replaced\n" + + " with an absolute link.", + "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and\n" + + " <a href=\"../pkg1/C1.html\">Link 2</a>."); + + checkOutput("pkg2/package-summary.html", true, + "<a href=\"https://docs.oracle.com/javase/7/docs/technotes/guides/index.html\">\n" + + " Test document 1</a>", + "<a href=\"../pkg1/C1.html\">\n" + + " Another Test document 1</a>", + "<a href=\"../technotes/guides/index.html\">\n" + + " Another Test document 2.</a>"); + + checkOutput("pkg2/C2.html", false, + "<a href=\"../../technotes/guides/index.html\">", + "<a href=\"https://docs.oracle.com/javase/7/docs/pkg1/C1.html\">" + + checkOutput("pkg2/package-summary.html", false, + "<a href=\"../../technotes/guides/index.html\">", + "<a href=\"https://docs.oracle.com/javase/7/docs/pkg1/C1.html\">" } }
--- a/test/com/sun/javadoc/testDupParamWarn/TestDupParamWarn.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testDupParamWarn/TestDupParamWarn.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,41 +27,26 @@ * @summary Test to ensure that the doclet does not print out bad * warning messages about duplicate param tags. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestDupParamWarn * @run main TestDupParamWarn */ public class TestDupParamWarn extends JavadocTester { - private static final String BUG_ID = "4745855"; - private static final String[] ARGS = - new String[] {"-d", BUG_ID, "-sourcepath", - SRC_DIR + FS, "pkg"}; - private static final String[][] NEGATED_TEST = - new String[][] {{WARNING_OUTPUT, - "Parameter \"a\" is documented more than once."}}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - run(new TestDupParamWarn(), ARGS, NO_TEST, NEGATED_TEST); + public static void main(String... args) throws Exception { + JavadocTester tester = new TestDupParamWarn(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput(Output.WARNING, false, + "Parameter \"a\" is documented more than once."); } }
--- a/test/com/sun/javadoc/testEmptyClass/TestEmptyClass.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testEmptyClass/TestEmptyClass.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,56 +27,32 @@ * @summary Test to make sure that Javadoc behaves properly when * run on a completely empty class (no comments or members). * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestEmptyClass * @run main TestEmptyClass */ public class TestEmptyClass extends JavadocTester { - private static final String OUTPUT_DIR = "tmp"; - private static final String[][] TEST = NO_TEST; - private static final String[][] NEGATED_TEST = { + public static void main(String... args) throws Exception { + TestEmptyClass tester = new TestEmptyClass(); + tester.runTests(); + } + + @Test + void test() { + javadoc("-classpath", testSrc("src"), + "-d", "out", + "-sourcepath", testSrc("src"), + testSrc("src/Empty.java")); + checkExit(Exit.OK); //The overview tree should not link to classes that were not documented - {OUTPUT_DIR + FS + "overview-tree.html", "<A HREF=\"TestEmptyClass.html\">"}, + checkOutput("overview-tree.html", false, + "<A HREF=\"TestEmptyClass.html\">"); //The index page should not link to classes that were not documented - {OUTPUT_DIR + FS + "index-all.html", "<A HREF=\"TestEmptyClass.html\">"}, - }; - private static final String[] ARGS = - new String[] { - "-classpath", SRC_DIR + FS + "src", - "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR + FS + "src", - SRC_DIR + FS + "src" + FS + "Empty.java" - }; - private static final String BUG_ID = "4483401 4483407 4483409 4483413 4494343"; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestEmptyClass tester = new TestEmptyClass(); - int exitCode = run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); - if (exitCode != 0) { - throw new Error("Error found while executing Javadoc"); - } - } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("index-all.html", false, + "<A HREF=\"TestEmptyClass.html\">"); } }
--- a/test/com/sun/javadoc/testEnclosingClass/TestEnclosingClass.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testEnclosingClass/TestEnclosingClass.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,49 +26,26 @@ * @bug 5008230 * @summary Check the outer class when documenting enclosing class/interface. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestEnclosingClass * @run main TestEnclosingClass */ public class TestEnclosingClass extends JavadocTester { - //Test information. - private static final String BUG_ID = "5008230"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "MyClass.MyInterface.html", "Enclosing class:"} - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestEnclosingClass tester = new TestEnclosingClass(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/MyClass.MyInterface.html", true, + "Enclosing class:"); } }
--- a/test/com/sun/javadoc/testEncoding/TestEncoding.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testEncoding/TestEncoding.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,48 +27,28 @@ * @summary This test determines if the value of the -encoding option is * properly passed from Javadoc to the source file parser. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestEncoding * @run main TestEncoding */ public class TestEncoding extends JavadocTester { - private static final String BUG_ID = "4661481"; - private static final String[][] TEST = NO_TEST; - - //If ??? is found in the output, the source file was not read with the correct encoding setting. - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "EncodeTest.html", "??"} - }; - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - "-encoding", "iso-8859-1", SRC_DIR + FS + "EncodeTest.java" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestEncoding tester = new TestEncoding(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-encoding", "iso-8859-1", + testSrc("EncodeTest.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + // If ??? is found in the output, the source file was not read with the correct encoding setting. + checkOutput("EncodeTest.html", false, + "??"); } }
--- a/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,60 +28,38 @@ * are documented properly. The method should still include "implements" or * "overrides" documentation even though the method is external. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester TestExternalOverridenMethod * @run main TestExternalOverridenMethod */ public class TestExternalOverridenMethod extends JavadocTester { - private static final String BUG_ID = "4857717"; - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "XReader.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true#read--\" " + - "title=\"class or interface in java.io\">read</a></code> in class <code>" + - "<a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true\" " + - "title=\"class or interface in java.io\">FilterReader</a></code></dd>"}, - {BUG_ID + FS + "pkg" + FS + "XReader.html", - "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL + - "<dd><code><a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true#readInt--\" " + - "title=\"class or interface in java.io\">readInt</a></code> in interface <code>" + - "<a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true\" " + - "title=\"class or interface in java.io\">DataInput</a></code></dd>"}}; - - - - private static final String[][] NEGATED_TEST = NO_TEST; - - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - "-linkoffline", "http://java.sun.com/j2se/1.4.1/docs/api", SRC_DIR, - "pkg" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestExternalOverridenMethod tester = new TestExternalOverridenMethod(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + String uri = "http://java.sun.com/j2se/1.4.1/docs/api"; + javadoc("-d", "out", + "-sourcepath", testSrc, + "-linkoffline", uri, testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/XReader.html", true, + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"" + uri + "/java/io/FilterReader.html?is-external=true#read--\" " + + "title=\"class or interface in java.io\">read</a></code> in class <code>" + + "<a href=\"" + uri + "/java/io/FilterReader.html?is-external=true\" " + + "title=\"class or interface in java.io\">FilterReader</a></code></dd>", + "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n" + + "<dd><code><a href=\"" + uri + "/java/io/DataInput.html?is-external=true#readInt--\" " + + "title=\"class or interface in java.io\">readInt</a></code> in interface <code>" + + "<a href=\"" + uri + "/java/io/DataInput.html?is-external=true\" " + + "title=\"class or interface in java.io\">DataInput</a></code></dd>" + ); } }
--- a/test/com/sun/javadoc/testGeneratedBy/TestGeneratedBy.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testGeneratedBy/TestGeneratedBy.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,16 +25,41 @@ * @test * @bug 8000418 8024288 * @summary Verify that files use a common Generated By string - * @library ../lib/ - * @build JavadocTester TestGeneratedBy + * @library ../lib + * @build JavadocTester * @run main TestGeneratedBy */ public class TestGeneratedBy extends JavadocTester { - private static final String OUTPUT_DIR = "tmp"; + public static void main(String... args) throws Exception { + TestGeneratedBy tester = new TestGeneratedBy(); + tester.runTests(); + } + + @Test + void testTimestamp() { + javadoc("-d", "out-timestamp", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - private static final String[] FILES = { + checkTimestamps(true); + } + + @Test + void testNoTimestamp() { + javadoc("-d", "out-notimestamp", + "-notimestamp", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); + + checkTimestamps(false); + } + + void checkTimestamps(boolean timestamp) { + checkTimestamps(timestamp, "pkg/MyClass.html", "pkg/package-summary.html", "pkg/package-frame.html", @@ -47,79 +72,26 @@ "serialized-form.html", "help-doc.html", "index-all.html", - "index.html" - }; - - private static final String[] STD_ARGS = - new String[] { - "-d", OUTPUT_DIR, - "-sourcepath", SRC_DIR, - "pkg" - }; + "index.html"); - private static final String[] NO_TIMESTAMP_ARGS = - new String[] { - "-notimestamp", - "-d", OUTPUT_DIR, - "-sourcepath", SRC_DIR, - "pkg" - }; - - private static final String BUG_ID = "8000418-8024288"; - - private static String[][] getTests(boolean timestamp) { - String version = System.getProperty("java.version"); - String[][] tests = new String[FILES.length][]; - for (int i = 0; i < FILES.length; i++) { - String genBy = "Generated by javadoc"; - if (timestamp) genBy += " (" + version + ") on "; - tests[i] = new String[] { - OUTPUT_DIR + FS + FILES[i], genBy - }; - } - return tests; } - private static String[][] getNegatedTests(boolean timestamp) { - String[][] tests = new String[FILES.length][]; - for (int i = 0; i < FILES.length; i++) { - tests[i] = new String[] { - OUTPUT_DIR + FS + FILES[i], + void checkTimestamps(boolean timestamp, String... files) { + String version = System.getProperty("java.version"); + String genBy = "Generated by javadoc"; + if (timestamp) genBy += " (" + version + ") on "; + + for (String file: files) { + // genBy is the current standard "Generated by" text + checkOutput(file, true, genBy); + + // These are older versions of the "Generated by" text + checkOutput(file, false, (timestamp ? "Generated by javadoc (version" : "Generated by javadoc ("), - "Generated by javadoc on" - }; + "Generated by javadoc on"); } - return tests; - } - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestGeneratedBy tester = new TestGeneratedBy(); - int ec1 = run(tester, STD_ARGS, getTests(true), getNegatedTests(true)); - int ec2 = run(tester, NO_TIMESTAMP_ARGS, getTests(false), getNegatedTests(false)); - tester.printSummary(); - if (ec1 != 0 || ec2 != 0) { - throw new Error("Error found while executing Javadoc"); - } - } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); } }
--- a/test/com/sun/javadoc/testGroupOption/TestGroupOption.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testGroupOption/TestGroupOption.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,68 +27,46 @@ * @summary Test to make sure the -group option does not cause a bad warning * to be printed. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestGroupOption * @run main TestGroupOption */ public class TestGroupOption extends JavadocTester { - //Test information. - private static final String BUG_ID = "4924383"; - - //Javadoc arguments. - private static final String[] ARGS1 = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - "-group", "Package One", "pkg1", - "-group", "Package Two", "pkg2", - "-group", "Package Three", "pkg3", - "pkg1", "pkg2", "pkg3" - }; - - private static final String[] ARGS2 = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - "-group", "Package One", "pkg1", - "-group", "Package One", "pkg2", - "-group", "Package One", "pkg3", - "pkg1", "pkg2", "pkg3" - }; - - //Input for string search tests. - private static final String[][] TEST1 = NO_TEST; - private static final String[][] NEGATED_TEST1 = {{WARNING_OUTPUT, "-group"}}; - - private static final String[][] TEST2 = {{WARNING_OUTPUT, "-group"}}; - private static final String[][] NEGATED_TEST2 = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - //Make sure the warning is not printed when -group is used correctly. + public static void main(String... args) throws Exception { TestGroupOption tester = new TestGroupOption(); - run(tester, ARGS1, TEST1, NEGATED_TEST1); - tester.printSummary(); - - //Make sure the warning is printed when -group is not used correctly. - tester = new TestGroupOption(); - run(tester, ARGS2, TEST2, NEGATED_TEST2); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void test1() { + //Make sure the warning is not printed when -group is used correctly. + javadoc("-d", "out-1", + "-sourcepath", testSrc, + "-group", "Package One", "pkg1", + "-group", "Package Two", "pkg2", + "-group", "Package Three", "pkg3", + "pkg1", "pkg2", "pkg3"); + checkExit(Exit.OK); + + checkOutput(Output.WARNING, false, + "-group"); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void test2() { + //Make sure the warning is printed when -group is not used correctly. + javadoc("-d", "out-2", + "-sourcepath", testSrc, + "-group", "Package One", "pkg1", + "-group", "Package One", "pkg2", + "-group", "Package One", "pkg3", + "pkg1", "pkg2", "pkg3"); + checkExit(Exit.OK); + + checkOutput(Output.WARNING, true, + "-group"); + } }
--- a/test/com/sun/javadoc/testHeadings/TestHeadings.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testHeadings/TestHeadings.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 4905786 6259611 * @summary Make sure that headings use the TH tag instead of the TD tag. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester * @build TestHeadings * @run main TestHeadings @@ -34,104 +34,82 @@ public class TestHeadings extends JavadocTester { - //Test information. - private static final String BUG_ID = "4905786-6259611"; + private static final String[][] TEST = { - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "-header", "Test Files", - "pkg1", "pkg2" + { + }, + { "serialized-form.html" + }, + { "serialized-form.html" + }, + + { + }, + { "overview-frame.html" + }, + { + } }; - //Input for string search tests. - private static final String[][] TEST = { + public static void main(String... args) throws Exception { + TestHeadings tester = new TestHeadings(); + tester.runTests(); + } + + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-use", + "-header", "Test Files", + "pkg1", "pkg2"); + checkExit(Exit.OK); + //Package summary - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "<th class=\"colFirst\" scope=\"col\">" + - "Class</th>" + NL + "<th class=\"colLast\" scope=\"col\"" + - ">Description</th>" - }, + checkOutput("pkg1/package-summary.html", true, + "<th class=\"colFirst\" scope=\"col\">" + + "Class</th>\n" + + "<th class=\"colLast\" scope=\"col\"" + + ">Description</th>"); // Class documentation - {BUG_ID + FS + "pkg1" + FS + "C1.html", - "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Field and Description</th>" - }, - {BUG_ID + FS + "pkg1" + FS + "C1.html", - "<h3>Methods inherited from class java.lang.Object</h3>" - }, + checkOutput("pkg1/C1.html", true, + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" + + "<th class=\"colLast\" scope=\"col\">Field and Description</th>", + "<h3>Methods inherited from class java.lang.Object</h3>"); // Class use documentation - {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", - "<th class=\"colFirst\" scope=\"col\">Package</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Description</th>" - }, - {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", - "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Field and Description</th>" - }, + checkOutput("pkg1/class-use/C1.html", true, + "<th class=\"colFirst\" scope=\"col\">Package</th>\n" + + "<th class=\"colLast\" scope=\"col\">Description</th>", + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" + + "<th class=\"colLast\" scope=\"col\">Field and Description</th>"); // Deprecated - {BUG_ID + FS + "deprecated-list.html", - "<th class=\"colOne\" scope=\"col\">Method and Description</th>" - }, + checkOutput("deprecated-list.html", true, + "<th class=\"colOne\" scope=\"col\">Method and Description</th>"); // Constant values - {BUG_ID + FS + "constant-values.html", - "<th class=\"colFirst\" scope=\"col\">" + - "Modifier and Type</th>" + NL + "<th scope=\"col\">Constant Field</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Value</th>" - }, + checkOutput("constant-values.html", true, + "<th class=\"colFirst\" scope=\"col\">" + + "Modifier and Type</th>\n" + + "<th scope=\"col\">Constant Field</th>\n" + + "<th class=\"colLast\" scope=\"col\">Value</th>"); // Serialized Form - {BUG_ID + FS + "serialized-form.html", - "<h2 title=\"Package\">Package pkg1</h2>" - }, - {BUG_ID + FS + "serialized-form.html", - "<h3>Class <a href=\"pkg1/C1.html\" title=\"class in pkg1\">" + - "pkg1.C1</a> extends java.lang.Object implements Serializable</h3>" - }, - {BUG_ID + FS + "serialized-form.html", - "<h3>Serialized Fields</h3>" - }, + checkOutput("serialized-form.html", true, + "<h2 title=\"Package\">Package pkg1</h2>", + "<h3>Class <a href=\"pkg1/C1.html\" title=\"class in pkg1\">" + + "pkg1.C1</a> extends java.lang.Object implements Serializable</h3>", + "<h3>Serialized Fields</h3>"); // Overview Frame - {BUG_ID + FS + "overview-frame.html", - "<h1 title=\"Test Files\" class=\"bar\">Test Files</h1>" - }, - {BUG_ID + FS + "overview-frame.html", - "<title>Overview List</title>" - }, + checkOutput("overview-frame.html", true, + "<h1 title=\"Test Files\" class=\"bar\">Test Files</h1>", + "<title>Overview List</title>"); // Overview Summary - {BUG_ID + FS + "overview-summary.html", - "<title>Overview</title>" - }, - - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestHeadings tester = new TestHeadings(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); - } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("overview-summary.html", true, + "<title>Overview</title>"); } }
--- a/test/com/sun/javadoc/testHelpFile/TestHelpFile.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testHelpFile/TestHelpFile.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,51 +26,26 @@ * @bug 7132631 * @summary Make sure that the help file is generated correctly. * @author Bhavesh Patel - * @library ../lib/ - * @build JavadocTester TestHelpFile + * @library ../lib + * @build JavadocTester * @run main TestHelpFile */ public class TestHelpFile extends JavadocTester { - //Test information. - private static final String BUG_ID = "7132631"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - SRC_DIR + FS + "TestHelpFile.java" - }; - - private static final String[][] NEGATED_TEST = NO_TEST; - - private static final String[][] TEST = { - {BUG_ID + FS + "help-doc.html", - "<a href=\"constant-values.html\">Constant Field Values</a>" - }, - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestHelpFile tester = new TestHelpFile(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + testSrc("TestHelpFile.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("help-doc.html", true, + "<a href=\"constant-values.html\">Constant Field Values</a>"); } }
--- a/test/com/sun/javadoc/testHelpOption/TestHelpOption.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testHelpOption/TestHelpOption.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,100 +27,79 @@ * @summary Make sure that the -help option works properly. Make sure * the help link appears in the documentation. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester TestHelpOption * @run main TestHelpOption */ public class TestHelpOption extends JavadocTester { - //Test information. - private static final String BUG_ID = "4934778-4777599-6553182"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-help", - SRC_DIR + FS + "TestHelpOption.java" - }; - - private static final String[] ARGS2 = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - SRC_DIR + FS + "TestHelpOption.java" - }; + public static void main(String... args) throws Exception { + TestHelpOption tester = new TestHelpOption(); + tester.runTests(); + } - private static final String[][] TEST = { - {STANDARD_OUTPUT, "-d "}, - {STANDARD_OUTPUT, "-use "}, - {STANDARD_OUTPUT, "-version "}, - {STANDARD_OUTPUT, "-author "}, - {STANDARD_OUTPUT, "-docfilessubdirs "}, - {STANDARD_OUTPUT, "-splitindex "}, - {STANDARD_OUTPUT, "-windowtitle "}, - {STANDARD_OUTPUT, "-doctitle "}, - {STANDARD_OUTPUT, "-header "}, - {STANDARD_OUTPUT, "-footer "}, - {STANDARD_OUTPUT, "-bottom "}, - {STANDARD_OUTPUT, "-link "}, - {STANDARD_OUTPUT, "-linkoffline "}, - {STANDARD_OUTPUT, "-excludedocfilessubdir "}, - {STANDARD_OUTPUT, "-group "}, - {STANDARD_OUTPUT, "-nocomment "}, - {STANDARD_OUTPUT, "-nodeprecated "}, - {STANDARD_OUTPUT, "-noqualifier "}, - {STANDARD_OUTPUT, "-nosince "}, - {STANDARD_OUTPUT, "-notimestamp "}, - {STANDARD_OUTPUT, "-nodeprecatedlist "}, - {STANDARD_OUTPUT, "-notree "}, - {STANDARD_OUTPUT, "-noindex "}, - {STANDARD_OUTPUT, "-nohelp "}, - {STANDARD_OUTPUT, "-nonavbar "}, - {STANDARD_OUTPUT, "-serialwarn "}, - {STANDARD_OUTPUT, "-tag "}, - {STANDARD_OUTPUT, "-taglet "}, - {STANDARD_OUTPUT, "-tagletpath "}, - {STANDARD_OUTPUT, "-charset "}, - {STANDARD_OUTPUT, "-helpfile "}, - {STANDARD_OUTPUT, "-linksource "}, - {STANDARD_OUTPUT, "-sourcetab "}, - {STANDARD_OUTPUT, "-keywords "}, - {STANDARD_OUTPUT, "-stylesheetfile "}, - {STANDARD_OUTPUT, "-docencoding "}, - }; - private static final String[][] NEGATED_TEST = NO_TEST; + @Test + void testWithOption() { + javadoc("-d", "out1", + "-sourcepath", testSrc, + "-help", + testSrc("TestHelpOption.java")); + checkExit(Exit.OK); - private static final String[][] TEST2 = { - {BUG_ID + FS + "TestHelpOption.html", - "<li><a href=\"help-doc.html\">Help</a></li>" - }, - }; - private static final String[][] NEGATED_TEST2 = NO_TEST; - - //The help option should not crash the doclet. - private static final int EXPECTED_EXIT_CODE = 0; + checkOutput(true); + } - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestHelpOption tester = new TestHelpOption(); - int actualExitCode = run(tester, ARGS, TEST, NEGATED_TEST); - tester.checkExitCode(EXPECTED_EXIT_CODE, actualExitCode); - run(tester, ARGS2, TEST2, NEGATED_TEST2); - tester.printSummary(); + @Test + void testWithoutOption() { + javadoc("-d", "out2", + "-sourcepath", testSrc, + testSrc("TestHelpOption.java")); + checkExit(Exit.OK); + + checkOutput(false); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + private void checkOutput(boolean withOption) { + checkOutput(Output.STDOUT, withOption, + "-d ", + "-use ", + "-version ", + "-author ", + "-docfilessubdirs ", + "-splitindex ", + "-windowtitle ", + "-doctitle ", + "-header ", + "-footer ", + "-bottom ", + "-link ", + "-linkoffline ", + "-excludedocfilessubdir ", + "-group ", + "-nocomment ", + "-nodeprecated ", + "-noqualifier ", + "-nosince ", + "-notimestamp ", + "-nodeprecatedlist ", + "-notree ", + "-noindex ", + "-nohelp ", + "-nonavbar ", + "-serialwarn ", + "-tag ", + "-taglet ", + "-tagletpath ", + "-charset ", + "-helpfile ", + "-linksource ", + "-sourcetab ", + "-keywords ", + "-stylesheetfile ", + "-docencoding "); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("TestHelpOption.html", !withOption, + "<li><a href=\"help-doc.html\">Help</a></li>"); } }
--- a/test/com/sun/javadoc/testHiddenMembers/TestHiddenMembers.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testHiddenMembers/TestHiddenMembers.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,50 +27,37 @@ * @summary Test to make sure that hidden overriden members are not * documented as inherited. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestHiddenMembers * @run main TestHiddenMembers */ public class TestHiddenMembers extends JavadocTester { - private static final String BUG_ID = "4492178"; - private static final String[][] TEST = NO_TEST; - - //We should not inherit any members from BaseClass because they are all overriden and hidden - //(declared as private). private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg" + FS + "SubClass.html", - "inherited from class pkg.<A HREF=\"../pkg/BaseClass.html\">BaseClass</A>"} + { } }; private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - "pkg" + }; - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestHiddenMembers tester = new TestHiddenMembers(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + // We should not inherit any members from BaseClass because they are all overriden and hidden + // (declared as private). + // TODO: check normal case of generated tags: upper case of lower case + checkOutput("pkg/SubClass.html", false, + "inherited from class pkg.<A HREF=\"../pkg/BaseClass.html\">BaseClass</A>"); } }
--- a/test/com/sun/javadoc/testHref/TestHref.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testHref/TestHref.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,89 +26,57 @@ * @bug 4663254 8016328 8025633 8026567 * @summary Verify that spaces do not appear in hrefs and anchors. * @author jamieh - * @library ../lib/ - * @build JavadocTester TestHref + * @library ../lib + * @build JavadocTester * @run main TestHref */ public class TestHref extends JavadocTester { - //Test information. - private static final String BUG_ID = "4663254"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR, "-linkoffline", - "http://java.sun.com/j2se/1.4/docs/api/", SRC_DIR, "pkg" - }; - - //Input for string search tests. - private static final String[][] TEST = { - //External link. - {BUG_ID + FS + "pkg" + FS + "C1.html", - "href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true#wait-long-int-\"" - }, - //Member summary table link. - {BUG_ID + FS + "pkg" + FS + "C1.html", - "href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\"" - }, - //Anchor test. - {BUG_ID + FS + "pkg" + FS + "C1.html", - "<a name=\"method-int-int-java.util.ArrayList-\">" + NL + - "<!-- -->" + NL + - "</a>" - }, - //Backward compatibility anchor test. - {BUG_ID + FS + "pkg" + FS + "C1.html", - "<a name=\"method-int-int-java.util.ArrayList-\">" + NL + - "<!-- -->" + NL + - "</a>" - }, - //{@link} test. - {BUG_ID + FS + "pkg" + FS + "C2.html", - "Link: <a href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\">" - }, - //@see test. - {BUG_ID + FS + "pkg" + FS + "C2.html", - "See Also:</span></dt>" + NL + "<dd><a href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\">" - }, - - //Header does not link to the page itself. - {BUG_ID + FS + "pkg" + FS + "C4.html", - "Class C4<E extends C4<E>></h2>" - }, - - //Signature does not link to the page itself. - {BUG_ID + FS + "pkg" + FS + "C4.html", - "public abstract class <span class=\"typeNameLabel\">C4<E extends C4<E>></span>" - }, - }; - private static final String[][] NEGATED_TEST = - { - {WARNING_OUTPUT, "<a> tag is malformed"} - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestHref tester = new TestHref(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-Xdoclint:none", + "-d", "out", + "-sourcepath", testSrc, + "-linkoffline", "http://java.sun.com/j2se/1.4/docs/api/", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/C1.html", true, + //External link. + "href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true#wait-long-int-\"", + //Member summary table link. + "href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\"", + //Anchor test. + "<a name=\"method-int-int-java.util.ArrayList-\">\n" + + "<!-- -->\n" + + "</a>", + //Backward compatibility anchor test."pkg/C1.html", + "<a name=\"method-int-int-java.util.ArrayList-\">\n" + + "<!-- -->\n" + + "</a>"); + + checkOutput("pkg/C2.html", true, + //{@link} test. + "Link: <a href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\">", + //@see test. + "See Also:</span></dt>\n" + + "<dd><a href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\">" + ); + + checkOutput("pkg/C4.html", true, + //Header does not link to the page itself. + "Class C4<E extends C4<E>></h2>", + //Signature does not link to the page itself. + "public abstract class <span class=\"typeNameLabel\">C4<E extends C4<E>></span>" + ); + + checkOutput(Output.WARNING, false, + "<a> tag is malformed"); } }
--- a/test/com/sun/javadoc/testHrefInDocComment/TestHrefInDocComment.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testHrefInDocComment/TestHrefInDocComment.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,44 +27,22 @@ * @summary Determine if Hrefs are processed properly when they * appear in doc comments. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestHrefInDocComment * @run main TestHrefInDocComment */ public class TestHrefInDocComment extends JavadocTester { - private static final String BUG_ID = "4638015"; - private static final String[][] TEST = NO_TEST; - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestHrefInDocComment tester = new TestHrefInDocComment(); - if (run(tester, ARGS, TEST, NEGATED_TEST) != 0) { - throw new Error("Javadoc failed to execute properly with given source."); - } - + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, "pkg"); + checkExit(Exit.OK); } }
--- a/test/com/sun/javadoc/testHtmlComments/TestHtmlComments.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testHtmlComments/TestHtmlComments.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,50 +27,26 @@ * @summary The field detail comment should not show up in the output if there * are no fields to document. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestHtmlComments * @run main TestHtmlComments */ public class TestHtmlComments extends JavadocTester { - //Test information. - private static final String BUG_ID = "4904038"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, SRC_DIR + FS + "C.java" - }; - - //Input for string search tests. - private static final String[][] TEST = NO_TEST; - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "C.html", - "<!-- ============ FIELD DETAIL =========== -->"} - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestHtmlComments tester = new TestHtmlComments(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void run() { + javadoc("-d", "out", + "-sourcepath", testSrc, + testSrc("C.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("C.html", false, + "<!-- ============ FIELD DETAIL =========== -->"); } }
--- a/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,243 +28,378 @@ * @bug 6786690 6820360 8025633 8026567 * @summary This test verifies the nesting of definition list tags. * @author Bhavesh Patel - * @library ../lib/ - * @build JavadocTester TestHtmlDefinitionListTag + * @library ../lib + * @build JavadocTester * @run main TestHtmlDefinitionListTag */ +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + public class TestHtmlDefinitionListTag extends JavadocTester { - private static final String BUG_ID = "6786690-6820360"; + public static void main(String... args) throws Exception { + TestHtmlDefinitionListTag tester = new TestHtmlDefinitionListTag(); + tester.runTests(); + } - // Test common to all runs of javadoc. The class signature should print - // properly enclosed definition list tags and the Annotation Type - // Optional Element should print properly nested definition list tags - // for default value. - private static final String[][] TEST_ALL = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<pre>public class " + - "<span class=\"typeNameLabel\">C1</span>" + NL + - "extends java.lang.Object" + NL + "implements java.io.Serializable</pre>"}, - {BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl>" + NL + - "<dt>Default:</dt>" + NL + "<dd>true</dd>" + NL + - "</dl>"}}; + @Test + void test_Comment_Deprecated() { +// tester.run(ARGS1, TEST_ALL, NEGATED_TEST_NO_C5); +// tester.runTestsOnHTML(NO_TEST, NEGATED_TEST_C5); +// tester.runTestsOnHTML(TEST_CMNT_DEPR, NO_TEST); + javadoc("-Xdoclint:none", + "-d", "out-1", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.OK); + checkCommon(true); + checkCommentDeprecated(true); + } - // Test for normal run of javadoc in which various ClassDocs and - // serialized form should have properly nested definition list tags - // enclosing comments, tags and deprecated information. - private static final String[][] TEST_CMNT_DEPR = { - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>" + NL + - "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL + - "<dd>JDK1.0</dd>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL + - "<dd>JDK1.0</dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + - "<dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\"><code>" + - "C2</code></a>, " + NL + "<a href=\"../serialized-form.html#pkg1.C1\">" + - "Serialized Form</a></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL + - "<dd>1.4</dd>" + NL + - "<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd>" + - "<a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>"+ NL + "<dt><span class=\"paramLabel\">Parameters:</span></dt>" + NL + "<dd><code>title" + - "</code> - the title</dd>" + NL + "<dd><code>test</code> - boolean value" + - "</dd>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span></dt>" + NL + - "<dd><code>java.lang.IllegalArgumentException</code> - if the " + - "<code>owner</code>'s" + NL + - " <code>GraphicsConfiguration</code> is not from a screen " + - "device</dd>" + NL + "<dd><code>HeadlessException</code></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"paramLabel\">Parameters:</span></dt>" + NL + "<dd><code>undecorated" + - "</code> - <code>true</code> if no decorations are" + NL + - " to be enabled;" + NL + " <code>false</code> " + - "if decorations are to be enabled.</dd>" + NL + "<dt><span class=\"simpleTagLabel\">Since:" + - "</span></dt>" + NL + "<dd>1.4</dd>" + NL + - "<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd>" + - "<a href=\"../pkg1/C1.html#readObject--\"><code>readObject()" + - "</code></a></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span></dt>" + NL + - "<dd><code>java.io.IOException</code></dd>" + NL + "<dt><span class=\"seeLabel\">See Also:" + - "</span></dt>" + NL + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl>" + NL + "<dt><span class=\"paramLabel\">Parameters:" + - "</span></dt>" + NL + "<dd><code>set</code> - boolean</dd>" + NL + "<dt><span class=\"simpleTagLabel\">" + - "Since:</span></dt>" + NL + "<dd>1.4</dd>" + NL + "</dl>"}, - {BUG_ID + FS + "serialized-form.html", "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span>" + - "</dt>" + NL + "<dd><code>" + - "java.io.IOException</code></dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span>" + - "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" + - " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL + - " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + - "<div class=\"block\">This field indicates whether the C1 is " + - "undecorated.</div>" + NL + " " + NL + "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL + - "<dd>1.4</dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span>" + - "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" + - " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL + - " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + - "<div class=\"block\">Reads the object stream.</div>" + NL + - "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:" + - "</span></dt>" + NL + "<dd><code><code>" + - "IOException</code></code></dd>" + NL + - "<dd><code>java.io.IOException</code></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" + - " </div>" + NL + - "<div class=\"block\">The name for this class.</div>"}}; + @Test + void test_NoComment_Deprecated() { +// tester.run(ARGS2, TEST_ALL, NEGATED_TEST_NO_C5); +// tester.runTestsOnHTML(NO_TEST, NEGATED_TEST_C5); +// tester.runTestsOnHTML(NO_TEST, TEST_CMNT_DEPR); + javadoc("-Xdoclint:none", + "-d", "out-2", + "-nocomment", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.OK); + checkCommon(true); + checkCommentDeprecated(false); // ?? + } + + @Test + void test_Comment_NoDeprecated() { +// tester.run(ARGS3, TEST_ALL, NEGATED_TEST_NO_C5); +// tester.runTestsOnHTML(TEST_NODEPR, TEST_NOCMNT_NODEPR); + javadoc("-Xdoclint:none", + "-d", "out-3", + "-nodeprecated", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.OK); + checkCommon(false); + checkNoDeprecated(); + checkNoCommentNoDeprecated(false); + } - // Test with -nodeprecated option. The ClassDocs should have properly nested - // definition list tags enclosing comments and tags. The ClassDocs should not - // display definition list for deprecated information. The serialized form - // should display properly nested definition list tags for comments, tags - // and deprecated information. - private static final String[][] TEST_NODEPR = { - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>" + NL + - "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL + - "<dd>JDK1.0</dd>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span>" + - "</dt>" + NL + "<dd>JDK1.0</dd>" + NL + "<dt><span class=\"seeLabel\">See Also:" + - "</span></dt>" + NL + "<dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\">" + - "<code>C2</code></a>, " + NL + "<a href=\"../serialized-form.html#pkg1.C1\">" + - "Serialized Form</a></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"paramLabel\">Parameters:" + - "</span></dt>" + NL + "<dd><code>title</code> - the title</dd>" + NL + "<dd><code>" + - "test</code> - boolean value</dd>" + NL + "<dt><span class=\"throwsLabel\">Throws:" + - "</span></dt>" + NL + "<dd><code>java.lang.IllegalArgumentException" + - "</code> - if the <code>owner</code>'s" + NL + " <code>GraphicsConfiguration" + - "</code> is not from a screen device</dd>" + NL + "<dd><code>" + - "HeadlessException</code></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"paramLabel\">Parameters:" + - "</span></dt>" + NL + "<dd><code>undecorated</code> - <code>true</code>" + - " if no decorations are" + NL + " to be enabled;" + NL + - " <code>false</code> if decorations are to be enabled." + - "</dd>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL + "<dd>1.4</dd>" + NL + - "<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd><a href=\"../pkg1/C1.html#readObject--\">" + - "<code>readObject()</code></a></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span>" + - "</dt>" + NL + "<dd><code>java.io.IOException</code></dd>" + NL + "<dt>" + - "<span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "serialized-form.html", "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span>" + - "</dt>" + NL + "<dd><code>" + - "java.io.IOException</code></dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span>" + - "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" + - " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL + - " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + - "<div class=\"block\">This field indicates whether the C1 is " + - "undecorated.</div>" + NL + " " + NL + "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL + - "<dd>1.4</dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span>" + - "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" + - " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL + - " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + - "<div class=\"block\">Reads the object stream.</div>" + NL + - "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:" + - "</span></dt>" + NL + "<dd><code><code>" + - "IOException</code></code></dd>" + NL + - "<dd><code>java.io.IOException</code></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" + - " </div>" + NL + "<div class=\"block\">" + - "The name for this class.</div>"}}; + @Test + void testNoCommentNoDeprecated() { +// tester.run(ARGS4, TEST_ALL, NEGATED_TEST_NO_C5); +// tester.runTestsOnHTML(TEST_NOCMNT_NODEPR, TEST_CMNT_DEPR); + javadoc("-Xdoclint:none", + "-d", "out-4", + "-nocomment", + "-nodeprecated", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.OK); + checkCommon(false); + checkNoCommentNoDeprecated(true); + checkCommentDeprecated(false); + } - // Test with -nocomment and -nodeprecated options. The ClassDocs whould - // not display definition lists for any member details. - private static final String[][] TEST_NOCMNT_NODEPR = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<pre>public void readObject()" + NL + - " throws java.io.IOException</pre>" + NL + "</li>"}, - {BUG_ID + FS + "pkg1" + FS + "C2.html", "<pre>public C2()</pre>" + NL + - "</li>"}, - {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<pre>public " + - "static final <a href=\"../pkg1/C1.ModalExclusionType.html\" " + - "title=\"enum in pkg1\">C1.ModalExclusionType</a> " + - "APPLICATION_EXCLUDE</pre>" + NL + "</li>"}, - {BUG_ID + FS + "serialized-form.html", "<pre>boolean " + - "undecorated</pre>" + NL + "<div class=\"block\"><span class=\"deprecatedLabel\">" + - "Deprecated.</span> <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL + - " <a href=\"pkg1/C1.html#setUndecorated-boolean-\"><code>" + - "setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"}, - {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">" + - "Deprecated.</span> <span class=\"deprecationComment\">As of JDK version" + - " 1.5, replaced by" + NL + - " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"}}; + void checkCommon(boolean checkC5) { + // Test common to all runs of javadoc. The class signature should print + // properly enclosed definition list tags and the Annotation Type + // Optional Element should print properly nested definition list tags + // for default value. + checkOutput("pkg1/C1.html", true, + "<pre>public class <span class=\"typeNameLabel\">C1</span>\n" + + "extends java.lang.Object\n" + + "implements java.io.Serializable</pre>"); + checkOutput("pkg1/C4.html", true, + "<dl>\n" + + "<dt>Default:</dt>\n" + + "<dd>true</dd>\n" + + "</dl>"); - // Test for valid HTML generation which should not comprise of empty - // definition list tags. - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl></dl>"}, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl></dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<dl></dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<dl>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl></dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "<dl></dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "<dl>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C3.html", "<dl></dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C3.html", "<dl>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl></dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C5.html", "<dl></dl>"}, - {BUG_ID + FS + "pkg1" + FS + "C5.html", "<dl>" + NL + "</dl>"}, - {BUG_ID + FS + "overview-tree.html", "<dl></dl>"}, - {BUG_ID + FS + "overview-tree.html", "<dl>" + NL + "</dl>"}, - {BUG_ID + FS + "serialized-form.html", "<dl></dl>"}, - {BUG_ID + FS + "serialized-form.html", "<dl>" + NL + "</dl>"}}; - - private static final String[] ARGS1 = - new String[] { - "-Xdoclint:none", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"}; + // Test for valid HTML generation which should not comprise of empty + // definition list tags. + List<String> files= new ArrayList<>(Arrays.asList( + "pkg1/package-summary.html", + "pkg1/C1.html", + "pkg1/C1.ModalExclusionType.html", + "pkg1/C2.html", + "pkg1/C2.ModalType.html", + "pkg1/C3.html", + "pkg1/C4.html", + "overview-tree.html", + "serialized-form.html" + )); - private static final String[] ARGS2 = - new String[] { - "-Xdoclint:none", "-d", BUG_ID, "-nocomment", "-sourcepath", SRC_DIR, "pkg1"}; - - private static final String[] ARGS3 = - new String[] { - "-Xdoclint:none", "-d", BUG_ID, "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"}; - - private static final String[] ARGS4 = - new String[] { - "-Xdoclint:none", "-d", BUG_ID, "-nocomment", "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"}; + if (checkC5) + files.add("pkg1/C5.html"); - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestHtmlDefinitionListTag tester = new TestHtmlDefinitionListTag(); - tester.exactNewlineMatch = false; - run(tester, ARGS1, TEST_ALL, NEGATED_TEST); - run(tester, ARGS1, TEST_CMNT_DEPR, NEGATED_TEST); - run(tester, ARGS2, TEST_ALL, NEGATED_TEST); - run(tester, ARGS2, NO_TEST, TEST_CMNT_DEPR); - run(tester, ARGS3, TEST_ALL, NEGATED_TEST); - run(tester, ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR); - run(tester, ARGS4, TEST_ALL, NEGATED_TEST); - run(tester, ARGS4, TEST_NOCMNT_NODEPR, TEST_CMNT_DEPR); - tester.printSummary(); + for (String f: files) { + checkOutput(f, false, + "<dl></dl>", + "<dl>\n</dl>"); + } } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + void checkCommentDeprecated(boolean expectFound) { + // Test for normal run of javadoc in which various ClassDocs and + // serialized form should have properly nested definition list tags + // enclosing comments, tags and deprecated information. + checkOutput("pkg1/package-summary.html", expectFound, + "<dl>\n" + + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" + + "<dd>JDK1.0</dd>\n" + + "</dl>"); + + checkOutput("pkg1/C1.html", expectFound, + "<dl>\n" + + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" + + "<dd>JDK1.0</dd>\n" + + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" + + "<dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\"><code>" + + "C2</code></a>, \n" + + "<a href=\"../serialized-form.html#pkg1.C1\">" + + "Serialized Form</a></dd>\n" + + "</dl>", + "<dl>\n" + + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" + + "<dd>1.4</dd>\n" + + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" + + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>setUndecorated(boolean)</code></a></dd>\n" + + "</dl>", + "<dl>\n" + + "<dt><span class=\"paramLabel\">Parameters:</span></dt>\n" + + "<dd><code>title</code> - the title</dd>\n" + + "<dd><code>test</code> - boolean value" + + "</dd>\n" + + "<dt><span class=\"throwsLabel\">Throws:</span></dt>\n" + + "<dd><code>java.lang.IllegalArgumentException</code> - if the " + + "<code>owner</code>'s\n" + + " <code>GraphicsConfiguration</code> is not from a screen " + + "device</dd>\n" + + "<dd><code>HeadlessException</code></dd>\n" + + "</dl>", + "<dl>\n" + + "<dt><span class=\"paramLabel\">Parameters:</span></dt>\n" + + "<dd><code>undecorated" + + "</code> - <code>true</code> if no decorations are\n" + + " to be enabled;\n" + + " <code>false</code> " + + "if decorations are to be enabled.</dd>\n" + + "<dt><span class=\"simpleTagLabel\">Since:" + + "</span></dt>\n" + + "<dd>1.4</dd>\n" + + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" + + "<dd>" + + "<a href=\"../pkg1/C1.html#readObject--\"><code>readObject()" + + "</code></a></dd>\n" + + "</dl>", + "<dl>\n" + + "<dt><span class=\"throwsLabel\">Throws:</span></dt>\n" + + "<dd><code>java.io.IOException</code></dd>\n" + + "<dt><span class=\"seeLabel\">See Also:" + + "</span></dt>\n" + + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>setUndecorated(boolean)</code></a></dd>\n" + + "</dl>"); + + checkOutput("pkg1/C2.html", expectFound, + "<dl>\n" + + "<dt><span class=\"paramLabel\">Parameters:" + + "</span></dt>\n" + + "<dd><code>set</code> - boolean</dd>\n" + + "<dt><span class=\"simpleTagLabel\">" + + "Since:</span></dt>\n" + + "<dd>1.4</dd>\n" + + "</dl>"); + + checkOutput("serialized-form.html", expectFound, + "<dl>\n" + + "<dt><span class=\"throwsLabel\">Throws:</span>" + + "</dt>\n" + + "<dd><code>" + + "java.io.IOException</code></dd>\n" + + "<dt><span class=\"seeLabel\">See Also:</span>" + + "</dt>\n" + + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>C1.setUndecorated(boolean)</code></a></dd>\n" + + "</dl>", + "<span class=\"deprecatedLabel\">Deprecated.</span>" + + " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" + + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>setUndecorated(boolean)</code></a>.</span></div>\n" + + "<div class=\"block\">This field indicates whether the C1 is " + + "undecorated.</div>\n" + + " \n" + + "<dl>\n" + + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" + + "<dd>1.4</dd>\n" + + "<dt><span class=\"seeLabel\">See Also:</span>" + + "</dt>\n" + + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>C1.setUndecorated(boolean)</code></a></dd>\n" + + "</dl>", + "<span class=\"deprecatedLabel\">Deprecated.</span>" + + " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" + + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>setUndecorated(boolean)</code></a>.</span></div>\n" + + "<div class=\"block\">Reads the object stream.</div>\n" + + "<dl>\n" + + "<dt><span class=\"throwsLabel\">Throws:" + + "</span></dt>\n" + + "<dd><code><code>" + + "IOException</code></code></dd>\n" + + "<dd><code>java.io.IOException</code></dd>\n" + + "</dl>", + "<span class=\"deprecatedLabel\">Deprecated.</span>" + + " </div>\n" + + "<div class=\"block\">The name for this class.</div>"); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + void checkNoDeprecated() { + // Test with -nodeprecated option. The ClassDocs should have properly nested + // definition list tags enclosing comments and tags. The ClassDocs should not + // display definition list for deprecated information. The serialized form + // should display properly nested definition list tags for comments, tags + // and deprecated information. + checkOutput("pkg1/package-summary.html", true, + "<dl>\n" + + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" + + "<dd>JDK1.0</dd>\n" + + "</dl>"); + + checkOutput("pkg1/C1.html", true, + "<dl>\n" + + "<dt><span class=\"simpleTagLabel\">Since:</span>" + + "</dt>\n" + + "<dd>JDK1.0</dd>\n" + + "<dt><span class=\"seeLabel\">See Also:" + + "</span></dt>\n" + + "<dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\">" + + "<code>C2</code></a>, \n" + + "<a href=\"../serialized-form.html#pkg1.C1\">" + + "Serialized Form</a></dd>\n" + + "</dl>"); + + checkOutput("pkg1/C1.html", true, + "<dl>\n" + + "<dt><span class=\"paramLabel\">Parameters:" + + "</span></dt>\n" + + "<dd><code>title</code> - the title</dd>\n" + + "<dd><code>" + + "test</code> - boolean value</dd>\n" + + "<dt><span class=\"throwsLabel\">Throws:" + + "</span></dt>\n" + + "<dd><code>java.lang.IllegalArgumentException" + + "</code> - if the <code>owner</code>'s\n" + + " <code>GraphicsConfiguration" + + "</code> is not from a screen device</dd>\n" + + "<dd><code>" + + "HeadlessException</code></dd>\n" + + "</dl>", + "<dl>\n" + + "<dt><span class=\"paramLabel\">Parameters:" + + "</span></dt>\n" + + "<dd><code>undecorated</code> - <code>true</code>" + + " if no decorations are\n" + + " to be enabled;\n" + + " <code>false</code> if decorations are to be enabled." + + "</dd>\n" + + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" + + "<dd>1.4</dd>\n" + + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" + + "<dd><a href=\"../pkg1/C1.html#readObject--\">" + + "<code>readObject()</code></a></dd>\n" + + "</dl>", + "<dl>\n" + + "<dt><span class=\"throwsLabel\">Throws:</span>" + + "</dt>\n" + + "<dd><code>java.io.IOException</code></dd>\n" + + "<dt>" + + "<span class=\"seeLabel\">See Also:</span></dt>\n" + + "<dd><a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>setUndecorated(boolean)</code></a></dd>\n" + + "</dl>"); + + checkOutput("serialized-form.html", true, + "<dl>\n" + + "<dt><span class=\"throwsLabel\">Throws:</span>" + + "</dt>\n" + + "<dd><code>" + + "java.io.IOException</code></dd>\n" + + "<dt><span class=\"seeLabel\">See Also:</span>" + + "</dt>\n" + + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>C1.setUndecorated(boolean)</code></a></dd>\n" + + "</dl>", + "<span class=\"deprecatedLabel\">Deprecated.</span>" + + " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" + + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>setUndecorated(boolean)</code></a>.</span></div>\n" + + "<div class=\"block\">This field indicates whether the C1 is " + + "undecorated.</div>\n" + + " \n" + + "<dl>\n" + + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" + + "<dd>1.4</dd>\n" + + "<dt><span class=\"seeLabel\">See Also:</span>" + + "</dt>\n" + + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>C1.setUndecorated(boolean)</code></a></dd>\n" + + "</dl>", + "<span class=\"deprecatedLabel\">Deprecated.</span>" + + " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" + + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>setUndecorated(boolean)</code></a>.</span></div>\n" + + "<div class=\"block\">Reads the object stream.</div>\n" + + "<dl>\n" + + "<dt><span class=\"throwsLabel\">Throws:" + + "</span></dt>\n" + + "<dd><code><code>" + + "IOException</code></code></dd>\n" + + "<dd><code>java.io.IOException</code></dd>\n" + + "</dl>", + "<span class=\"deprecatedLabel\">Deprecated.</span>" + + " </div>\n" + + "<div class=\"block\">" + + "The name for this class.</div>"); + } + + void checkNoCommentNoDeprecated(boolean expectFound) { + // Test with -nocomment and -nodeprecated options. The ClassDocs whould + // not display definition lists for any member details. + checkOutput("pkg1/C1.html", expectFound, + "<pre>public void readObject()\n" + + " throws java.io.IOException</pre>\n" + + "</li>"); + + checkOutput("pkg1/C2.html", expectFound, + "<pre>public C2()</pre>\n" + + "</li>"); + + checkOutput("pkg1/C1.ModalExclusionType.html", expectFound, + "<pre>public " + + "static final <a href=\"../pkg1/C1.ModalExclusionType.html\" " + + "title=\"enum in pkg1\">C1.ModalExclusionType</a> " + + "APPLICATION_EXCLUDE</pre>\n" + + "</li>"); + + checkOutput("serialized-form.html", expectFound, + "<pre>boolean " + + "undecorated</pre>\n" + + "<div class=\"block\"><span class=\"deprecatedLabel\">" + + "Deprecated.</span> <span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" + + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\"><code>" + + "setUndecorated(boolean)</code></a>.</span></div>\n" + + "</li>", + "<span class=\"deprecatedLabel\">" + + "Deprecated.</span> <span class=\"deprecationComment\">As of JDK version" + + " 1.5, replaced by\n" + + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>setUndecorated(boolean)</code></a>.</span></div>\n" + + "</li>"); } }
--- a/test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,33 +27,38 @@ * @test * @bug 6851834 * @summary This test verifies the HTML document generation for javadoc output. + * @library ../lib + * @build JavadocTester * @author Bhavesh Patel - * @build TestHtmlDocument * @run main TestHtmlDocument */ -import java.io.*; import com.sun.tools.doclets.formats.html.markup.*; /** * The class reads each file, complete with newlines, into a string to easily * compare the existing markup with the generated markup. */ -public class TestHtmlDocument { - - private static final String BUGID = "6851834"; - private static final String BUGNAME = "TestHtmlDocument"; - private static final String FS = System.getProperty("file.separator"); - private static final String LS = System.getProperty("line.separator"); - private static String srcdir = System.getProperty("test.src", "."); +public class TestHtmlDocument extends JavadocTester { // Entry point - public static void main(String[] args) throws IOException { + public static void main(String... args) throws Exception { + TestHtmlDocument tester = new TestHtmlDocument(); + tester.runTests(); + } + + @Test + void test() { + checking("markup"); // Check whether the generated markup is same as the existing markup. - if (generateHtmlTree().equals(readFileToString(srcdir + FS + "testMarkup.html"))) { - System.out.println("\nTest passed for bug " + BUGID + " (" + BUGNAME + ")\n"); + String expected = readFile(testSrc, "testMarkup.html"); + String actual = generateHtmlTree(); + if (actual.equals(expected)) { + passed(""); } else { - throw new Error("\nTest failed for bug " + BUGID + " (" + BUGNAME + ")\n"); + failed("expected content in " + testSrc("testMarkup.html") + "\n" + + "Actual output:\n" + + actual); } } @@ -136,25 +141,4 @@ HtmlDocument htmlDoc = new HtmlDocument(htmlDocType, html); return htmlDoc.toString(); } - - // Read the file into a String - public static String readFileToString(String filename) throws IOException { - File file = new File(filename); - if ( !file.exists() ) { - System.out.println("\nFILE DOES NOT EXIST: " + filename); - } - BufferedReader in = new BufferedReader(new FileReader(file)); - StringBuilder fileString = new StringBuilder(); - // Create an array of characters the size of the file - try { - String line; - while ((line = in.readLine()) != null) { - fileString.append(line); - fileString.append(LS); - } - } finally { - in.close(); - } - return fileString.toString(); - } }
--- a/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,58 +26,49 @@ /* * @test * @bug 6786028 8026567 - * @summary This test verifys the use of <strong> HTML tag instead of <B> by Javadoc std doclet. + * @summary This test verifies the use of <strong> HTML tag instead of <B> by Javadoc std doclet. * @author Bhavesh Patel - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestHtmlStrongTag * @run main TestHtmlStrongTag */ public class TestHtmlStrongTag extends JavadocTester { - private static final String BUG_ID = "6786028"; - private static final String[][] TEST1 = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<span class=\"seeLabel\">See Also:</span>"}}; - private static final String[][] NEGATED_TEST1 = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<STRONG>Method Summary</STRONG>"}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<B>"}, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<STRONG>Class Summary</STRONG>"}}; - private static final String[][] TEST2 = { - {BUG_ID + FS + "pkg2" + FS + "C2.html", "<B>Comments:</B>"}}; - private static final String[][] NEGATED_TEST2 = { - {BUG_ID + FS + "pkg2" + FS + "C2.html", "<STRONG>Method Summary</STRONG>"}, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<STRONG>Class Summary</STRONG>"}}; - - private static final String[] ARGS1 = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"}; - private static final String[] ARGS2 = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg2"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestHtmlStrongTag tester = new TestHtmlStrongTag(); - run(tester, ARGS1, TEST1, NEGATED_TEST1); - run(tester, ARGS2, TEST2, NEGATED_TEST2); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void test1() { + javadoc("-d", "out-1", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.OK); + + checkOutput("pkg1/C1.html", true, + "<span class=\"seeLabel\">See Also:</span>"); + + checkOutput("pkg1/C1.html", false, + "<STRONG>Method Summary</STRONG>", + "<B>"); + + checkOutput("pkg1/package-summary.html", false, + "<STRONG>Class Summary</STRONG>"); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void test2() { + javadoc("-d", "out-2", + "-sourcepath", testSrc, + "pkg2"); + checkExit(Exit.OK); + + checkOutput("pkg2/C2.html", true, + "<B>Comments:</B>"); + + checkOutput("pkg2/C2.html", false, + "<STRONG>Method Summary</STRONG>"); } }
--- a/test/com/sun/javadoc/testHtmlTableStyles/TestHtmlTableStyles.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testHtmlTableStyles/TestHtmlTableStyles.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,85 +26,59 @@ * @bug 8008164 * @summary Test styles on HTML tables generated by javadoc. * @author Bhavesh Patel - * @library ../lib/ - * @build JavadocTester TestHtmlTableStyles + * @library ../lib + * @build JavadocTester * @run main TestHtmlTableStyles */ public class TestHtmlTableStyles extends JavadocTester { - private static final String BUG_ID = "8008164"; + public static void main(String... args) throws Exception { + TestHtmlTableStyles tester = new TestHtmlTableStyles(); + tester.runTests(); + } + + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-use", + "pkg1", "pkg2"); + checkExit(Exit.OK); - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg1" + FS + "TestTable.html", - "<table border cellpadding=3 cellspacing=1>" - }, - {BUG_ID + FS + "pkg1" + FS + "TestTable.html", - "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + - "cellspacing=\"0\" summary=\"Field Summary table, listing fields, " + - "and an explanation\">" - }, - {BUG_ID + FS + "pkg1" + FS + "TestTable.html", - "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + - "cellspacing=\"0\" summary=\"Constructor Summary table, listing " + - "constructors, and an explanation\">" - }, - {BUG_ID + FS + "pkg1" + FS + "TestTable.html", - "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + - "cellspacing=\"0\" summary=\"Method Summary table, listing methods, " + - "and an explanation\">" - }, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" " + - "cellspacing=\"0\" summary=\"Class Summary table, listing classes, " + - "and an explanation\">" - }, - {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "TestTable.html", - "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" " + - "cellspacing=\"0\" summary=\"Use table, listing fields, and an explanation\">" - }, - {BUG_ID + FS + "overview-summary.html", - "<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" " + - "cellspacing=\"0\" summary=\"Packages table, listing packages, and an explanation\">" - }, - {BUG_ID + FS + "deprecated-list.html", + checkOutput("pkg1/TestTable.html", true, + "<table border cellpadding=3 cellspacing=1>", + "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + + "cellspacing=\"0\" summary=\"Field Summary table, listing fields, " + + "and an explanation\">", + "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + + "cellspacing=\"0\" summary=\"Constructor Summary table, listing " + + "constructors, and an explanation\">", + "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + + "cellspacing=\"0\" summary=\"Method Summary table, listing methods, " + + "and an explanation\">"); + + checkOutput("pkg1/package-summary.html", true, + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" " + + "cellspacing=\"0\" summary=\"Class Summary table, listing classes, " + + "and an explanation\">"); + + checkOutput("pkg1/class-use/TestTable.html", true, + "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" " + + "cellspacing=\"0\" summary=\"Use table, listing fields, and an explanation\">"); + + checkOutput("overview-summary.html", true, + "<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" " + + "cellspacing=\"0\" summary=\"Packages table, listing packages, and an explanation\">"); + + checkOutput("deprecated-list.html", true, "<table class=\"deprecatedSummary\" border=\"0\" cellpadding=\"3\" " + "cellspacing=\"0\" summary=\"Deprecated Methods table, listing " + - "deprecated methods, and an explanation\">" - }, - {BUG_ID + FS + "constant-values.html", + "deprecated methods, and an explanation\">"); + + checkOutput("constant-values.html", true, "<table class=\"constantsSummary\" border=\"0\" cellpadding=\"3\" " + "cellspacing=\"0\" summary=\"Constant Field Values table, listing " + - "constant fields, and values\">" - }, - }; - - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) throws Exception { - TestHtmlTableStyles tester = new TestHtmlTableStyles(); - run(tester, ARGS, TEST, NO_TEST); - tester.printSummary(); - } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + "constant fields, and values\">"); } }
--- a/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,422 +26,359 @@ * @bug 6786688 8008164 * @summary HTML tables should have table summary, caption and table headers. * @author Bhavesh Patel - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestHtmlTableTags * @run main TestHtmlTableTags */ public class TestHtmlTableTags extends JavadocTester { - //Test information. - private static final String BUG_ID = "6786688"; - //Javadoc arguments. private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2" + }; - //Input for string tests for HTML table tags. - private static final String[][] TABLE_TAGS_TEST = { - /* - * Test for validating summary for HTML tables - */ + + public static void main(String... args) throws Exception { + TestHtmlTableTags tester = new TestHtmlTableTags(); + tester.runTests(); + } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-use", + "pkg1", "pkg2"); + checkExit(Exit.OK); + + checkHtmlTableSummaries(); + checkHtmlTableCaptions(); + checkHtmlTableHeaders(); + } + + /* + * Tests for validating summary for HTML tables + */ + void checkHtmlTableSummaries() { //Package summary - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\"" + - " cellspacing=\"0\" summary=\"Class Summary table, " + - "listing classes, and an explanation\">" - }, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\"" + - " cellspacing=\"0\" summary=\"Interface Summary table, " + - "listing interfaces, and an explanation\">" - }, - {BUG_ID + FS + "pkg2" + FS + "package-summary.html", - "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\"" + - " cellspacing=\"0\" summary=\"Enum Summary table, " + - "listing enums, and an explanation\">" - }, - {BUG_ID + FS + "pkg2" + FS + "package-summary.html", - "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\"" + - " cellspacing=\"0\" summary=\"Annotation Types Summary table, " + - "listing annotation types, and an explanation\">" - }, + checkOutput("pkg1/package-summary.html", true, + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\"" + + " cellspacing=\"0\" summary=\"Class Summary table, " + + "listing classes, and an explanation\">", + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\"" + + " cellspacing=\"0\" summary=\"Interface Summary table, " + + "listing interfaces, and an explanation\">"); + + checkOutput("pkg2/package-summary.html", true, + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\"" + + " cellspacing=\"0\" summary=\"Enum Summary table, " + + "listing enums, and an explanation\">", + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\"" + + " cellspacing=\"0\" summary=\"Annotation Types Summary table, " + + "listing annotation types, and an explanation\">"); + // Class documentation - {BUG_ID + FS + "pkg1" + FS + "C1.html", - "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + - "cellspacing=\"0\" summary=\"Field Summary table, listing fields, " + - "and an explanation\">" - }, - {BUG_ID + FS + "pkg1" + FS + "C1.html", - "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + - "cellspacing=\"0\" summary=\"Method Summary table, listing methods, " + - "and an explanation\">" - }, - {BUG_ID + FS + "pkg2" + FS + "C2.html", - "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + - "cellspacing=\"0\" summary=\"Nested Class Summary table, listing " + - "nested classes, and an explanation\">" - }, - {BUG_ID + FS + "pkg2" + FS + "C2.html", - "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + - "cellspacing=\"0\" summary=\"Constructor Summary table, listing " + - "constructors, and an explanation\">" - }, - {BUG_ID + FS + "pkg2" + FS + "C2.ModalExclusionType.html", - "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + - "cellspacing=\"0\" summary=\"Enum Constant Summary table, listing " + - "enum constants, and an explanation\">" - }, - {BUG_ID + FS + "pkg2" + FS + "C3.html", - "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + - "cellspacing=\"0\" summary=\"Required Element Summary table, " + - "listing required elements, and an explanation\">" - }, - {BUG_ID + FS + "pkg2" + FS + "C4.html", - "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + - "cellspacing=\"0\" summary=\"Optional Element Summary table, " + - "listing optional elements, and an explanation\">" - }, - // Class use documentation - {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "I1.html", - "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + - "table, listing packages, and an explanation\">" - }, - {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", - "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + - "table, listing fields, and an explanation\">" - }, - {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", - "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + - "table, listing methods, and an explanation\">" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html", - "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + - "table, listing fields, and an explanation\">" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html", - "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + - "table, listing methods, and an explanation\">" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html", - "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + - "table, listing packages, and an explanation\">" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html", - "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + - "table, listing methods, and an explanation\">" - }, - // Package use documentation - {BUG_ID + FS + "pkg1" + FS + "package-use.html", - "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + - "table, listing packages, and an explanation\">" - }, - {BUG_ID + FS + "pkg1" + FS + "package-use.html", - "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + - "table, listing classes, and an explanation\">" - }, - {BUG_ID + FS + "pkg2" + FS + "package-use.html", - "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + - "table, listing packages, and an explanation\">" - }, - {BUG_ID + FS + "pkg2" + FS + "package-use.html", - "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + - "table, listing classes, and an explanation\">" - }, - // Deprecated - {BUG_ID + FS + "deprecated-list.html", - "<table class=\"deprecatedSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " + - "summary=\"Deprecated Fields table, listing deprecated fields, " + - "and an explanation\">" - }, - {BUG_ID + FS + "deprecated-list.html", - "<table class=\"deprecatedSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " + - "summary=\"Deprecated Methods table, listing deprecated methods, " + - "and an explanation\">" - }, - // Constant values - {BUG_ID + FS + "constant-values.html", - "<table class=\"constantsSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " + - "summary=\"Constant Field Values table, listing " + - "constant fields, and values\">" - }, - // Overview Summary - {BUG_ID + FS + "overview-summary.html", - "<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" " + - "cellspacing=\"0\" summary=\"Packages table, " + - "listing packages, and an explanation\">" - }, + checkOutput("pkg1/C1.html", true, + "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + + "cellspacing=\"0\" summary=\"Field Summary table, listing fields, " + + "and an explanation\">", + "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + + "cellspacing=\"0\" summary=\"Method Summary table, listing methods, " + + "and an explanation\">"); + + checkOutput("pkg2/C2.html", true, + "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + + "cellspacing=\"0\" summary=\"Nested Class Summary table, listing " + + "nested classes, and an explanation\">", + "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + + "cellspacing=\"0\" summary=\"Constructor Summary table, listing " + + "constructors, and an explanation\">"); - /* - * Test for validating caption for HTML tables - */ + checkOutput("pkg2/C2.ModalExclusionType.html", true, + "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + + "cellspacing=\"0\" summary=\"Enum Constant Summary table, listing " + + "enum constants, and an explanation\">"); - //Package summary - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "<caption><span>Class Summary</span><span class=\"tabEnd\">" + - " </span></caption>" - }, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "<caption><span>Interface Summary</span><span class=\"tabEnd\">" + - " </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "package-summary.html", - "<caption><span>Enum Summary</span><span class=\"tabEnd\">" + - " </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "package-summary.html", - "<caption><span>Annotation Types Summary</span><span class=\"tabEnd\">" + - " </span></caption>" - }, - // Class documentation - {BUG_ID + FS + "pkg1" + FS + "C1.html", - "<caption><span>Fields</span><span class=\"tabEnd\"> </span></caption>" - }, - {BUG_ID + FS + "pkg1" + FS + "C1.html", - "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " + - "Methods</span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" + - "Instance Methods</a></span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">" + - "Concrete Methods</a></span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t6\" class=\"tableTab\"><span><a href=\"javascript:show(32);\">" + - "Deprecated Methods</a></span><span class=\"tabEnd\"> </span></span>" + - "</caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "C2.html", - "<caption><span>Nested Classes</span><span class=\"tabEnd\"> </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "C2.html", - "<caption><span>Constructors</span><span class=\"tabEnd\"> </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "C2.ModalExclusionType.html", - "<caption><span>Enum Constants</span><span class=\"tabEnd\"> </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "C3.html", - "<caption><span>Required Elements</span><span class=\"tabEnd\"> " + - "</span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "C4.html", - "<caption><span>Optional Elements</span><span class=\"tabEnd\"> " + - "</span></caption>" - }, + checkOutput("pkg2/C3.html", true, + "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + + "cellspacing=\"0\" summary=\"Required Element Summary table, " + + "listing required elements, and an explanation\">"); + + checkOutput("pkg2/C4.html", true, + "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" " + + "cellspacing=\"0\" summary=\"Optional Element Summary table, " + + "listing optional elements, and an explanation\">"); + // Class use documentation - {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "I1.html", - "<caption><span>Packages that use <a href=\"../../pkg1/I1.html\" " + - "title=\"interface in pkg1\">I1</a></span><span class=\"tabEnd\">" + - " </span></caption>" - }, - {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", - "<caption><span>Fields in <a href=\"../../pkg2/package-summary.html\">" + - "pkg2</a> declared as <a href=\"../../pkg1/C1.html\" " + - "title=\"class in pkg1\">C1</a></span><span class=\"tabEnd\"> " + - "</span></caption>" - }, - {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", - "<caption><span>Methods in <a href=\"../../pkg2/package-summary.html\">" + - "pkg2</a> that return <a href=\"../../pkg1/C1.html\" " + - "title=\"class in pkg1\">C1</a></span><span class=\"tabEnd\">" + - " </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html", - "<caption><span>Fields in <a href=\"../../pkg1/package-summary.html\">" + - "pkg1</a> declared as <a href=\"../../pkg2/C2.html\" " + - "title=\"class in pkg2\">C2</a></span><span class=\"tabEnd\">" + - " </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html", - "<caption><span>Methods in <a href=\"../../pkg1/package-summary.html\">" + - "pkg1</a> that return <a href=\"../../pkg2/C2.html\" " + - "title=\"class in pkg2\">C2</a></span><span class=\"tabEnd\">" + - " </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html", - "<caption><span>Methods in <a href=\"../../pkg2/package-summary.html\">" + - "pkg2</a> that return <a href=\"../../pkg2/C2.ModalExclusionType.html\" " + - "title=\"enum in pkg2\">C2.ModalExclusionType</a></span>" + - "<span class=\"tabEnd\"> </span></caption>" - }, - // Package use documentation - {BUG_ID + FS + "pkg1" + FS + "package-use.html", - "<caption><span>Packages that use <a href=\"../pkg1/package-summary.html\">" + - "pkg1</a></span><span class=\"tabEnd\"> </span></caption>" - }, - {BUG_ID + FS + "pkg1" + FS + "package-use.html", - "<caption><span>Classes in <a href=\"../pkg1/package-summary.html\">" + - "pkg1</a> used by <a href=\"../pkg1/package-summary.html\">pkg1</a>" + - "</span><span class=\"tabEnd\"> </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "package-use.html", - "<caption><span>Packages that use <a href=\"../pkg2/package-summary.html\">" + - "pkg2</a></span><span class=\"tabEnd\"> </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "package-use.html", - "<caption><span>Classes in <a href=\"../pkg2/package-summary.html\">" + - "pkg2</a> used by <a href=\"../pkg1/package-summary.html\">pkg1</a>" + - "</span><span class=\"tabEnd\"> </span></caption>" - }, - // Deprecated - {BUG_ID + FS + "deprecated-list.html", - "<caption><span>Deprecated Fields</span><span class=\"tabEnd\">" + - " </span></caption>" - }, - {BUG_ID + FS + "deprecated-list.html", - "<caption><span>Deprecated Methods</span><span class=\"tabEnd\">" + - " </span></caption>" - }, - // Constant values - {BUG_ID + FS + "constant-values.html", - "<caption><span>pkg1.<a href=\"pkg1/C1.html\" title=\"class in pkg1\">" + - "C1</a></span><span class=\"tabEnd\"> </span></caption>" - }, - // Overview Summary - {BUG_ID + FS + "overview-summary.html", - "<caption><span>Packages</span><span class=\"tabEnd\"> </span></caption>" - }, + checkOutput("pkg1/class-use/I1.html", true, + "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + + "table, listing packages, and an explanation\">"); + + checkOutput("pkg1/class-use/C1.html", true, + "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + + "table, listing fields, and an explanation\">", + "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + + "table, listing methods, and an explanation\">"); - /* - * Test for validating headers for HTML tables - */ + checkOutput("pkg2/class-use/C2.html", true, + "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + + "table, listing fields, and an explanation\">", + "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + + "table, listing methods, and an explanation\">"); + + checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true, + "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + + "table, listing packages, and an explanation\">"); + + checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true, + "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + + "table, listing methods, and an explanation\">"); - //Package summary - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "<th class=\"colFirst\" scope=\"col\">" + - "Class</th>" + NL + "<th class=\"colLast\" scope=\"col\"" + - ">Description</th>" - }, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", - "<th class=\"colFirst\" scope=\"col\">" + - "Interface</th>" + NL + "<th class=\"colLast\" scope=\"col\"" + - ">Description</th>" - }, - {BUG_ID + FS + "pkg2" + FS + "package-summary.html", - "<th class=\"colFirst\" scope=\"col\">" + - "Enum</th>" + NL + "<th class=\"colLast\" scope=\"col\"" + - ">Description</th>" - }, - {BUG_ID + FS + "pkg2" + FS + "package-summary.html", - "<th class=\"colFirst\" scope=\"col\">" + - "Annotation Type</th>" + NL + "<th class=\"colLast\"" + - " scope=\"col\">Description</th>" - }, - // Class documentation - {BUG_ID + FS + "pkg1" + FS + "C1.html", - "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Field and Description</th>" - }, - {BUG_ID + FS + "pkg1" + FS + "C1.html", - "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Method and Description</th>" - }, - {BUG_ID + FS + "pkg2" + FS + "C2.html", - "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Class and Description</th>" - }, - {BUG_ID + FS + "pkg2" + FS + "C2.html", - "<th class=\"colOne\" scope=\"col\">Constructor and Description</th>" - }, - {BUG_ID + FS + "pkg2" + FS + "C2.ModalExclusionType.html", - "<th class=\"colOne\" scope=\"col\">Enum Constant and Description</th>" - }, - {BUG_ID + FS + "pkg2" + FS + "C3.html", - "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Required Element and Description</th>" - }, - {BUG_ID + FS + "pkg2" + FS + "C4.html", - "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Optional Element and Description</th>" - }, - // Class use documentation - {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "I1.html", - "<th class=\"colFirst\" scope=\"col\">Package</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Description</th>" - }, - {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", - "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Field and Description</th>" - }, - {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", - "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Method and Description</th>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html", - "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Field and Description</th>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html", - "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Method and Description</th>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html", - "<th class=\"colFirst\" scope=\"col\">Package</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Description</th>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html", - "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Method and Description</th>" - }, // Package use documentation - {BUG_ID + FS + "pkg1" + FS + "package-use.html", - "<th class=\"colFirst\" scope=\"col\">Package</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Description</th>" - }, - {BUG_ID + FS + "pkg1" + FS + "package-use.html", - "<th class=\"colOne\" scope=\"col\">Class and Description</th>" - }, - {BUG_ID + FS + "pkg2" + FS + "package-use.html", - "<th class=\"colFirst\" scope=\"col\">Package</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Description</th>" - }, - {BUG_ID + FS + "pkg2" + FS + "package-use.html", - "<th class=\"colOne\" scope=\"col\">Class and Description</th>" - }, + checkOutput("pkg1/package-use.html", true, + "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + + "table, listing packages, and an explanation\">", + "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + + "table, listing classes, and an explanation\">"); + + checkOutput("pkg2/package-use.html", true, + "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + + "table, listing packages, and an explanation\">", + "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use " + + "table, listing classes, and an explanation\">"); + // Deprecated - {BUG_ID + FS + "deprecated-list.html", - "<th class=\"colOne\" scope=\"col\">Field and Description</th>" - }, - {BUG_ID + FS + "deprecated-list.html", - "<th class=\"colOne\" scope=\"col\">Method and Description</th>" - }, + checkOutput("deprecated-list.html", true, + "<table class=\"deprecatedSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " + + "summary=\"Deprecated Fields table, listing deprecated fields, " + + "and an explanation\">", + "<table class=\"deprecatedSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " + + "summary=\"Deprecated Methods table, listing deprecated methods, " + + "and an explanation\">"); + // Constant values - {BUG_ID + FS + "constant-values.html", - "<th class=\"colFirst\" scope=\"col\">" + - "Modifier and Type</th>" + NL + "<th" + - " scope=\"col\">Constant Field</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Value</th>" - }, + checkOutput("constant-values.html", true, + "<table class=\"constantsSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " + + "summary=\"Constant Field Values table, listing " + + "constant fields, and values\">"); + // Overview Summary - {BUG_ID + FS + "overview-summary.html", - "<th class=\"colFirst\" scope=\"col\">" + - "Package</th>" + NL + "<th class=\"colLast\" scope=\"col\"" + - ">Description</th>" - } - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestHtmlTableTags tester = new TestHtmlTableTags(); - run(tester, ARGS, TABLE_TAGS_TEST, NEGATED_TEST); - tester.printSummary(); + checkOutput("overview-summary.html", true, + "<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" " + + "cellspacing=\"0\" summary=\"Packages table, " + + "listing packages, and an explanation\">"); } - /** - * {@inheritDoc} + /* + * Tests for validating caption for HTML tables */ - public String getBugId() { - return BUG_ID; + void checkHtmlTableCaptions() { + //Package summary + checkOutput("pkg1/package-summary.html", true, + "<caption><span>Class Summary</span><span class=\"tabEnd\">" + + " </span></caption>", + "<caption><span>Interface Summary</span><span class=\"tabEnd\">" + + " </span></caption>"); + + checkOutput("pkg2/package-summary.html", true, + "<caption><span>Enum Summary</span><span class=\"tabEnd\">" + + " </span></caption>", + "<caption><span>Annotation Types Summary</span><span class=\"tabEnd\">" + + " </span></caption>"); + + // Class documentation + checkOutput("pkg1/C1.html", true, + "<caption><span>Fields</span><span class=\"tabEnd\"> </span></caption>", + "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " + + "Methods</span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" + + "Instance Methods</a></span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">" + + "Concrete Methods</a></span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t6\" class=\"tableTab\"><span><a href=\"javascript:show(32);\">" + + "Deprecated Methods</a></span><span class=\"tabEnd\"> </span></span>" + + "</caption>"); + + checkOutput("pkg2/C2.html", true, + "<caption><span>Nested Classes</span><span class=\"tabEnd\"> </span></caption>", + "<caption><span>Constructors</span><span class=\"tabEnd\"> </span></caption>"); + + checkOutput("pkg2/C2.ModalExclusionType.html", true, + "<caption><span>Enum Constants</span><span class=\"tabEnd\"> </span></caption>"); + + checkOutput("pkg2/C3.html", true, + "<caption><span>Required Elements</span><span class=\"tabEnd\"> " + + "</span></caption>"); + + checkOutput("pkg2/C4.html", true, + "<caption><span>Optional Elements</span><span class=\"tabEnd\"> " + + "</span></caption>"); + + // Class use documentation + checkOutput("pkg1/class-use/I1.html", true, + "<caption><span>Packages that use <a href=\"../../pkg1/I1.html\" " + + "title=\"interface in pkg1\">I1</a></span><span class=\"tabEnd\">" + + " </span></caption>"); + + checkOutput("pkg1/class-use/C1.html", true, + "<caption><span>Fields in <a href=\"../../pkg2/package-summary.html\">" + + "pkg2</a> declared as <a href=\"../../pkg1/C1.html\" " + + "title=\"class in pkg1\">C1</a></span><span class=\"tabEnd\"> " + + "</span></caption>", + "<caption><span>Methods in <a href=\"../../pkg2/package-summary.html\">" + + "pkg2</a> that return <a href=\"../../pkg1/C1.html\" " + + "title=\"class in pkg1\">C1</a></span><span class=\"tabEnd\">" + + " </span></caption>"); + + checkOutput("pkg2/class-use/C2.html", true, + "<caption><span>Fields in <a href=\"../../pkg1/package-summary.html\">" + + "pkg1</a> declared as <a href=\"../../pkg2/C2.html\" " + + "title=\"class in pkg2\">C2</a></span><span class=\"tabEnd\">" + + " </span></caption>", + "<caption><span>Methods in <a href=\"../../pkg1/package-summary.html\">" + + "pkg1</a> that return <a href=\"../../pkg2/C2.html\" " + + "title=\"class in pkg2\">C2</a></span><span class=\"tabEnd\">" + + " </span></caption>"); + + checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true, + "<caption><span>Methods in <a href=\"../../pkg2/package-summary.html\">" + + "pkg2</a> that return <a href=\"../../pkg2/C2.ModalExclusionType.html\" " + + "title=\"enum in pkg2\">C2.ModalExclusionType</a></span>" + + "<span class=\"tabEnd\"> </span></caption>"); + + // Package use documentation + checkOutput("pkg1/package-use.html", true, + "<caption><span>Packages that use <a href=\"../pkg1/package-summary.html\">" + + "pkg1</a></span><span class=\"tabEnd\"> </span></caption>", + "<caption><span>Classes in <a href=\"../pkg1/package-summary.html\">" + + "pkg1</a> used by <a href=\"../pkg1/package-summary.html\">pkg1</a>" + + "</span><span class=\"tabEnd\"> </span></caption>"); + + checkOutput("pkg2/package-use.html", true, + "<caption><span>Packages that use <a href=\"../pkg2/package-summary.html\">" + + "pkg2</a></span><span class=\"tabEnd\"> </span></caption>", + "<caption><span>Classes in <a href=\"../pkg2/package-summary.html\">" + + "pkg2</a> used by <a href=\"../pkg1/package-summary.html\">pkg1</a>" + + "</span><span class=\"tabEnd\"> </span></caption>"); + + // Deprecated + checkOutput("deprecated-list.html", true, + "<caption><span>Deprecated Fields</span><span class=\"tabEnd\">" + + " </span></caption>", + "<caption><span>Deprecated Methods</span><span class=\"tabEnd\">" + + " </span></caption>"); + + // Constant values + checkOutput("constant-values.html", true, + "<caption><span>pkg1.<a href=\"pkg1/C1.html\" title=\"class in pkg1\">" + + "C1</a></span><span class=\"tabEnd\"> </span></caption>"); + + // Overview Summary + checkOutput("overview-summary.html", true, + "<caption><span>Packages</span><span class=\"tabEnd\"> </span></caption>"); } - /** - * {@inheritDoc} + /* + * Test for validating headers for HTML tables */ - public String getBugName() { - return getClass().getName(); + void checkHtmlTableHeaders() { + //Package summary + checkOutput("pkg1/package-summary.html", true, + "<th class=\"colFirst\" scope=\"col\">" + + "Class</th>\n" + + "<th class=\"colLast\" scope=\"col\"" + + ">Description</th>", + "<th class=\"colFirst\" scope=\"col\">" + + "Interface</th>\n" + + "<th class=\"colLast\" scope=\"col\"" + + ">Description</th>"); + + checkOutput("pkg2/package-summary.html", true, + "<th class=\"colFirst\" scope=\"col\">" + + "Enum</th>\n" + + "<th class=\"colLast\" scope=\"col\"" + + ">Description</th>", + "<th class=\"colFirst\" scope=\"col\">" + + "Annotation Type</th>\n" + + "<th class=\"colLast\"" + + " scope=\"col\">Description</th>"); + + // Class documentation + checkOutput("pkg1/C1.html", true, + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" + + "<th class=\"colLast\" scope=\"col\">Field and Description</th>", + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" + + "<th class=\"colLast\" scope=\"col\">Method and Description</th>"); + + checkOutput("pkg2/C2.html", true, + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" + + "<th class=\"colLast\" scope=\"col\">Class and Description</th>", + "<th class=\"colOne\" scope=\"col\">Constructor and Description</th>"); + + checkOutput("pkg2/C2.ModalExclusionType.html", true, + "<th class=\"colOne\" scope=\"col\">Enum Constant and Description</th>"); + + checkOutput("pkg2/C3.html", true, + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" + + "<th class=\"colLast\" scope=\"col\">Required Element and Description</th>"); + + checkOutput("pkg2/C4.html", true, + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" + + "<th class=\"colLast\" scope=\"col\">Optional Element and Description</th>"); + + // Class use documentation + checkOutput("pkg1/class-use/I1.html", true, + "<th class=\"colFirst\" scope=\"col\">Package</th>\n" + + "<th class=\"colLast\" scope=\"col\">Description</th>"); + + checkOutput("pkg1/class-use/C1.html", true, + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" + + "<th class=\"colLast\" scope=\"col\">Field and Description</th>", + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" + + "<th class=\"colLast\" scope=\"col\">Method and Description</th>"); + + checkOutput("pkg2/class-use/C2.html", true, + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" + + "<th class=\"colLast\" scope=\"col\">Field and Description</th>", + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" + + "<th class=\"colLast\" scope=\"col\">Method and Description</th>"); + + checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true, + "<th class=\"colFirst\" scope=\"col\">Package</th>\n" + + "<th class=\"colLast\" scope=\"col\">Description</th>", + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" + + "<th class=\"colLast\" scope=\"col\">Method and Description</th>"); + + // Package use documentation + checkOutput("pkg1/package-use.html", true, + "<th class=\"colFirst\" scope=\"col\">Package</th>\n" + + "<th class=\"colLast\" scope=\"col\">Description</th>", + "<th class=\"colOne\" scope=\"col\">Class and Description</th>"); + + checkOutput("pkg2/package-use.html", true, + "<th class=\"colFirst\" scope=\"col\">Package</th>\n" + + "<th class=\"colLast\" scope=\"col\">Description</th>", + "<th class=\"colOne\" scope=\"col\">Class and Description</th>"); + + // Deprecated + checkOutput("deprecated-list.html", true, + "<th class=\"colOne\" scope=\"col\">Field and Description</th>", + "<th class=\"colOne\" scope=\"col\">Method and Description</th>"); + + // Constant values + checkOutput("constant-values.html", true, + "<th class=\"colFirst\" scope=\"col\">" + + "Modifier and Type</th>\n" + + "<th" + + " scope=\"col\">Constant Field</th>\n" + + "<th class=\"colLast\" scope=\"col\">Value</th>"); + + // Overview Summary + checkOutput("overview-summary.html", true, + "<th class=\"colFirst\" scope=\"col\">" + + "Package</th>\n" + + "<th class=\"colLast\" scope=\"col\"" + + ">Description</th>"); } }
--- a/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,9 +28,8 @@ * @bug 6786682 * @summary This test verifies the use of lang attribute by <HTML>. * @author Bhavesh Patel - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestHtmlTag * @run main TestHtmlTag */ @@ -38,56 +37,65 @@ public class TestHtmlTag extends JavadocTester { - private static final String BUG_ID = "6786682"; - private static final String[][] TEST1 = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html lang=\"" + Locale.getDefault().getLanguage() + "\">"}, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<html lang=\"" + Locale.getDefault().getLanguage() + "\">"}}; - private static final String[][] NEGATED_TEST1 = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html>"}}; - private static final String[][] TEST2 = { - {BUG_ID + FS + "pkg2" + FS + "C2.html", "<html lang=\"ja\">"}, - {BUG_ID + FS + "pkg2" + FS + "package-summary.html", "<html lang=\"ja\">"}}; - private static final String[][] NEGATED_TEST2 = { - {BUG_ID + FS + "pkg2" + FS + "C2.html", "<html>"}}; - private static final String[][] TEST3 = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html lang=\"en\">"}, - {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<html lang=\"en\">"}}; - private static final String[][] NEGATED_TEST3 = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html>"}}; + public static void main(String... args) throws Exception { + TestHtmlTag tester = new TestHtmlTag(); + tester.runTests(); + } - private static final String[] ARGS1 = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"}; - private static final String[] ARGS2 = - new String[] { - "-locale", "ja", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg2"}; - private static final String[] ARGS3 = - new String[] { - "-locale", "en_US", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"}; + @Test + void test_default() { + javadoc("-d", "out-default", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.OK); + + String defaultLanguage = Locale.getDefault().getLanguage(); - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestHtmlTag tester = new TestHtmlTag(); - run(tester, ARGS1, TEST1, NEGATED_TEST1); - run(tester, ARGS2, TEST2, NEGATED_TEST2); - run(tester, ARGS3, TEST3, NEGATED_TEST3); - tester.printSummary(); + checkOutput("pkg1/C1.html", true, + "<html lang=\"" + defaultLanguage + "\">"); + + checkOutput("pkg1/package-summary.html", true, + "<html lang=\"" + defaultLanguage + "\">"); + + checkOutput("pkg1/C1.html", false, + "<html>"); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void test_ja() { + // TODO: why does this test need/use pkg2; why can't it use pkg1 + // like the other two tests, so that we can share the check methods? + javadoc("-locale", "ja", + "-d", "out-ja", + "-sourcepath", testSrc, + "pkg2"); + checkExit(Exit.OK); + + checkOutput("pkg2/C2.html", true, + "<html lang=\"ja\">"); + + checkOutput("pkg2/package-summary.html", true, + "<html lang=\"ja\">"); + + checkOutput("pkg2/C2.html", false, + "<html>"); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void test_en_US() { + javadoc("-locale", "en_US", + "-d", "out-en_US", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.OK); + + checkOutput("pkg1/C1.html", true, + "<html lang=\"en\">"); + + checkOutput("pkg1/package-summary.html", true, + "<html lang=\"en\">"); + + checkOutput("pkg1/C1.html", false, + "<html>"); } }
--- a/test/com/sun/javadoc/testIndentation/TestIndentation.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testIndentation/TestIndentation.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,53 +25,30 @@ * @test * @bug 8011288 * @summary Erratic/inconsistent indentation of signatures - * @library ../lib/ + * @library ../lib * @build JavadocTester * @run main TestIndentation */ public class TestIndentation extends JavadocTester { - //Test information. - private static final String BUG_ID = "8011288"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "p" - }; - - //Input for string search tests. - private static final String[][] TEST = { - { BUG_ID + FS + "p" + FS + "Indent.html", - "<pre>public <T> void m(T t1," }, - { BUG_ID + FS + "p" + FS + "Indent.html", - NL + " T t2)" }, - { BUG_ID + FS + "p" + FS + "Indent.html", - NL + " throws java.lang.Exception" } - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestIndentation tester = new TestIndentation(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "p"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("p/Indent.html", true, + "<pre>public <T> void m(T t1,", + "\n" + + " T t2)", + "\n" + + " throws java.lang.Exception"); } }
--- a/test/com/sun/javadoc/testIndex/TestIndex.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testIndex/TestIndex.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,78 +28,53 @@ * Also test that index-all.html has the appropriate output. * Test for unnamed package in index. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestIndex * @run main TestIndex */ public class TestIndex extends JavadocTester { - //Test information. - private static final String BUG_ID = "4852280-4517115-4973608-4994589"; + public static void main(String... args) throws Exception { + TestIndex tester = new TestIndex(); + tester.runTests(); + } - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", SRC_DIR + FS + "NoPackage.java" - }; + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg", testSrc("NoPackage.java")); + checkExit(Exit.OK); - //Input for string search tests. - private static final String[][] TEST = { //Make sure the horizontal scroll bar does not appear in class frame. - {BUG_ID + FS + "index.html", - "<frame src=\"overview-summary.html\" name=\"classFrame\" title=\"" + - "Package, class and interface descriptions\" scrolling=\"yes\">"}, + checkOutput("index.html", true, + "<frame src=\"overview-summary.html\" name=\"classFrame\" title=\"" + + "Package, class and interface descriptions\" scrolling=\"yes\">"); //Test index-all.html - {BUG_ID + FS + "index-all.html", - "<a href=\"pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">C</span></a>" + - " - Class in <a href=\"pkg/package-summary.html\">pkg</a>"}, - {BUG_ID + FS + "index-all.html", - "<a href=\"pkg/Interface.html\" title=\"interface in pkg\">" + - "<span class=\"typeNameLink\">Interface</span></a> - Interface in " + - "<a href=\"pkg/package-summary.html\">pkg</a>"}, - {BUG_ID + FS + "index-all.html", - "<a href=\"pkg/AnnotationType.html\" title=\"annotation in pkg\">" + - "<span class=\"typeNameLink\">AnnotationType</span></a> - Annotation Type in " + - "<a href=\"pkg/package-summary.html\">pkg</a>"}, - {BUG_ID + FS + "index-all.html", - "<a href=\"pkg/Coin.html\" title=\"enum in pkg\">" + - "<span class=\"typeNameLink\">Coin</span></a> - Enum in " + - "<a href=\"pkg/package-summary.html\">pkg</a>"}, - {BUG_ID + FS + "index-all.html", - "Class in <a href=\"package-summary.html\"><Unnamed></a>"}, - {BUG_ID + FS + "index-all.html", - "<dl>" + NL + "<dt><span class=\"memberNameLink\"><a href=\"pkg/C.html#Java\">" + - "Java</a></span> - Static variable in class pkg.<a href=\"pkg/C.html\" " + - "title=\"class in pkg\">C</a></dt>" + NL + "<dd> </dd>" + NL + - "<dt><span class=\"memberNameLink\"><a href=\"pkg/C.html#JDK\">JDK</a></span> " + - "- Static variable in class pkg.<a href=\"pkg/C.html\" title=\"class in pkg\">" + - "C</a></dt>" + NL + "<dd> </dd>" + NL + "</dl>"}, - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestIndex tester = new TestIndex(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); - } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("index-all.html", true, + "<a href=\"pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">C</span></a>" + + " - Class in <a href=\"pkg/package-summary.html\">pkg</a>", + "<a href=\"pkg/Interface.html\" title=\"interface in pkg\">" + + "<span class=\"typeNameLink\">Interface</span></a> - Interface in " + + "<a href=\"pkg/package-summary.html\">pkg</a>", + "<a href=\"pkg/AnnotationType.html\" title=\"annotation in pkg\">" + + "<span class=\"typeNameLink\">AnnotationType</span></a> - Annotation Type in " + + "<a href=\"pkg/package-summary.html\">pkg</a>", + "<a href=\"pkg/Coin.html\" title=\"enum in pkg\">" + + "<span class=\"typeNameLink\">Coin</span></a> - Enum in " + + "<a href=\"pkg/package-summary.html\">pkg</a>", + "Class in <a href=\"package-summary.html\"><Unnamed></a>", + "<dl>\n" + + "<dt><span class=\"memberNameLink\"><a href=\"pkg/C.html#Java\">" + + "Java</a></span> - Static variable in class pkg.<a href=\"pkg/C.html\" " + + "title=\"class in pkg\">C</a></dt>\n" + + "<dd> </dd>\n" + + "<dt><span class=\"memberNameLink\"><a href=\"pkg/C.html#JDK\">JDK</a></span> " + + "- Static variable in class pkg.<a href=\"pkg/C.html\" title=\"class in pkg\">" + + "C</a></dt>\n" + + "<dd> </dd>\n" + + "</dl>"); } }
--- a/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,48 +26,29 @@ * @bug 4524136 * @summary Test to make sure label is used for inline links. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestInlineLinkLabel * @run main TestInlineLinkLabel */ public class TestInlineLinkLabel extends JavadocTester { - private static final String BUG_ID = "4524136"; - private static final String[][] TEST = { - //Search for the label to the package link. - {BUG_ID + FS + "pkg" + FS + "C1.html" , "<a href=\"../pkg/package-summary.html\"><code>Here is a link to a package</code></a>"}, - - //Search for the label to the class link - {BUG_ID + FS + "pkg" + FS + "C1.html" , "<a href=\"../pkg/C2.html\" title=\"class in pkg\"><code>Here is a link to a class</code></a>"} - }; - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestInlineLinkLabel tester = new TestInlineLinkLabel(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/C1.html", true, + //Search for the label to the package link. + "<a href=\"../pkg/package-summary.html\"><code>Here is a link to a package</code></a>", + //Search for the label to the class link + "<a href=\"../pkg/C2.html\" title=\"class in pkg\"><code>Here is a link to a class</code></a>"); } }
--- a/test/com/sun/javadoc/testInterface/TestInterface.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testInterface/TestInterface.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,104 +29,82 @@ * If A implements I and B extends A, B should be in the list of * implementing classes in the documentation for I. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestInterface * @run main TestInterface */ public class TestInterface extends JavadocTester { - //Test information. - private static final String BUG_ID = "4682448-4947464-5029946"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "Interface.html", - "<pre>int method()</pre>"}, - {BUG_ID + FS + "pkg" + FS + "Interface.html", - "<pre>static final int field</pre>"}, - - - // Make sure known implementing class list is correct and omits type parameters. - {BUG_ID + FS + "pkg" + FS + "Interface.html", - "<dl>" + NL + "<dt>All Known Implementing Classes:</dt>" + NL + - "<dd><a href=\"../pkg/Child.html\" title=\"class in pkg\">Child" + - "</a>, <a href=\"../pkg/Parent.html\" title=\"class in pkg\">Parent" + - "</a></dd>" + NL + "</dl>"}, - - // Make sure "All Implemented Interfaces": has substituted type parameters - {BUG_ID + FS + "pkg" + FS + "Child.html", - "<dl>" + NL + "<dt>All Implemented Interfaces:</dt>" + NL + - "<dd><a href=\"../pkg/Interface.html\" title=\"interface in pkg\">" + - "Interface</a><T></dd>" + NL + "</dl>" - }, - //Make sure Class Tree has substituted type parameters. - {BUG_ID + FS + "pkg" + FS + "Child.html", - "<ul class=\"inheritance\">" + NL + "<li>java.lang.Object</li>" + NL + - "<li>" + NL + "<ul class=\"inheritance\">" + NL + - "<li><a href=\"../pkg/Parent.html\" title=\"class in pkg\">" + - "pkg.Parent</a><T></li>" + NL + "<li>" + NL + - "<ul class=\"inheritance\">" + NL + "<li>pkg.Child<T></li>" + NL + - "</ul>" + NL + "</li>" + NL + "</ul>" + NL + "</li>" + NL + "</ul>" - }, - //Make sure "Direct Know Subclasses" omits type parameters - {BUG_ID + FS + "pkg" + FS + "Parent.html", - "<dl>" + NL + "<dt>Direct Known Subclasses:</dt>" + NL + - "<dd><a href=\"../pkg/Child.html\" title=\"class in pkg\">Child" + - "</a></dd>" + NL + "</dl>" - }, - //Make sure "Specified By" has substituted type parameters. - {BUG_ID + FS + "pkg" + FS + "Child.html", - "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL + - "<dd><code><a href=\"../pkg/Interface.html#method--\">method</a>" + - "</code> in interface <code>" + - "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">" + - "Interface</a><<a href=\"../pkg/Child.html\" title=\"type parameter in Child\">" + - "T</a>></code></dd>" - }, - //Make sure "Overrides" has substituted type parameters. - {BUG_ID + FS + "pkg" + FS + "Child.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg/Parent.html#method--\">method</a>" + - "</code> in class <code><a href=\"../pkg/Parent.html\" " + - "title=\"class in pkg\">Parent</a><<a href=\"../pkg/Child.html\" " + - "title=\"type parameter in Child\">T</a>></code></dd>" - }, - }; - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg" + FS + "Interface.html", - "public int method()"}, - {BUG_ID + FS + "pkg" + FS + "Interface.html", - "public static final int field"}, - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestInterface tester = new TestInterface(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); + + checkOutput("pkg/Interface.html", true, + "<pre>int method()</pre>", + "<pre>static final int field</pre>", + // Make sure known implementing class list is correct and omits type parameters. + "<dl>\n" + + "<dt>All Known Implementing Classes:</dt>\n" + + "<dd><a href=\"../pkg/Child.html\" title=\"class in pkg\">Child" + + "</a>, <a href=\"../pkg/Parent.html\" title=\"class in pkg\">Parent" + + "</a></dd>\n" + + "</dl>"); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/Child.html", true, + // Make sure "All Implemented Interfaces": has substituted type parameters + "<dl>\n" + + "<dt>All Implemented Interfaces:</dt>\n" + + "<dd><a href=\"../pkg/Interface.html\" title=\"interface in pkg\">" + + "Interface</a><T></dd>\n" + + "</dl>", + //Make sure Class Tree has substituted type parameters. + "<ul class=\"inheritance\">\n" + + "<li>java.lang.Object</li>\n" + + "<li>\n" + + "<ul class=\"inheritance\">\n" + + "<li><a href=\"../pkg/Parent.html\" title=\"class in pkg\">" + + "pkg.Parent</a><T></li>\n" + + "<li>\n" + + "<ul class=\"inheritance\">\n" + + "<li>pkg.Child<T></li>\n" + + "</ul>\n" + + "</li>\n" + + "</ul>\n" + + "</li>\n" + + "</ul>", + //Make sure "Specified By" has substituted type parameters. + "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n" + + "<dd><code><a href=\"../pkg/Interface.html#method--\">method</a>" + + "</code> in interface <code>" + + "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">" + + "Interface</a><<a href=\"../pkg/Child.html\" title=\"type parameter in Child\">" + + "T</a>></code></dd>", + //Make sure "Overrides" has substituted type parameters. + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg/Parent.html#method--\">method</a>" + + "</code> in class <code><a href=\"../pkg/Parent.html\" " + + "title=\"class in pkg\">Parent</a><<a href=\"../pkg/Child.html\" " + + "title=\"type parameter in Child\">T</a>></code></dd>"); + + checkOutput("pkg/Parent.html", true, + //Make sure "Direct Know Subclasses" omits type parameters + "<dl>\n" + + "<dt>Direct Known Subclasses:</dt>\n" + + "<dd><a href=\"../pkg/Child.html\" title=\"class in pkg\">Child" + + "</a></dd>\n" + + "</dl>"); + + checkOutput("pkg/Interface.html", false, + "public int method()", + "public static final int field"); } }
--- a/test/com/sun/javadoc/testJavaFX/C.java Thu Nov 05 05:11:09 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - * @expert Expert tag text - */ - -public class C { - - /** - * @propertySetter Property - * @propertyDescription PropertyDescription - */ - public void CC() {} - - /** - * @propertyGetter Property - * @expert Expert tag text - * - */ - public void B() {} - - /** - * Method A documentation - * @treatAsPrivate - */ - public void A() {} - - /** - * Field i - * @defaultValue 1.0 - */ - public int i; - - - /** - * Defines the direction/speed at which the {@code Timeline} is expected to - * be played. - * @defaultValue 11 - * @since JavaFX 8.0 - */ - private DoubleProperty rate; - - public final void setRate(double value) {} - - public final double getRate() {} - - public final DoubleProperty rateProperty() {} - - private BooleanProperty paused; - - public final void setPaused(boolean value) {} - - public final double isPaused() {} - - /** - * Defines if paused - * @defaultValue false - */ - public final BooleanProperty pausedProperty() {} - - class DoubleProperty {} - - class BooleanProperty {} - - public final BooleanProperty setTestMethodProperty() {} - - private class Inner { - private BooleanProperty testMethodProperty() {} - - /** - * Defines the direction/speed at which the {@code Timeline} is expected to - * be played. - * @defaultValue 11 - */ - private DoubleProperty rate; - - public final void setRate(double value) {} - - public final double getRate() {} - - public final DoubleProperty rateProperty() {} - } -}
--- a/test/com/sun/javadoc/testJavaFX/D.java Thu Nov 05 05:11:09 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - * @expert Expert tag text - */ - -public class D extends C {}
--- a/test/com/sun/javadoc/testJavaFX/TestJavaFX.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testJavaFX/TestJavaFX.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,88 +23,159 @@ /* * @test - * @bug 7112427 8012295 8025633 8026567 + * @bug 7112427 8012295 8025633 8026567 8061305 * @summary Test of the JavaFX doclet features. * @author jvalenta - * @library ../lib/ - * @build JavadocTester TestJavaFX + * @library ../lib + * @build JavadocTester * @run main TestJavaFX */ public class TestJavaFX extends JavadocTester { - private static final String BUG_ID = "7112427"; - - private static final String[][] TEST = - new String[][] { - {"./" + BUG_ID + "/C.html", - "<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd><a href=\"C.html#getRate--\"><code>getRate()</code></a>, " + NL + - "<a href=\"C.html#setRate-double-\"><code>setRate(double)</code></a></dd>"}, - {"./" + BUG_ID + "/C.html", - "<pre>public final void setRate(double value)</pre>" + NL + - "<div class=\"block\">Sets the value of the property rate.</div>" + NL + - "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>" }, - {"./" + BUG_ID + "/C.html", - "<pre>public final double getRate()</pre>" + NL + - "<div class=\"block\">Gets the value of the property rate.</div>" + NL + - "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>" }, - {"./" + BUG_ID + "/C.html", - "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"C.html#rateProperty\">rate</a></span></code>" + NL + - "<div class=\"block\">Defines the direction/speed at which the <code>Timeline</code> is expected to"}, - - {"./" + BUG_ID + "/C.html", - "<span class=\"simpleTagLabel\">Default value:</span>"}, - {"./" + BUG_ID + "/C.html", - "<span class=\"simpleTagLabel\">Since:</span></dt>" + NL + "<dd>JavaFX 8.0</dd>" }, - {"./" + BUG_ID + "/C.html", - "<p>Sets the value of the property <code>Property</code>"}, - {"./" + BUG_ID + "/C.html", - "<p>Gets the value of the property <code>Property</code>"}, - {"./" + BUG_ID + "/C.html", - "<span class=\"simpleTagLabel\">Property description:</span>"}, - {"./" + BUG_ID + "/C.html", - "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"C.html#setTestMethodProperty--\">setTestMethodProperty</a></span>()</code> </td>" }, - {"./" + BUG_ID + "/C.html", - "<h4>isPaused</h4>" + NL + - "<pre>public final double isPaused()</pre>" + NL + - "<div class=\"block\">Gets the value of the property paused.</div>" }, - {"./" + BUG_ID + "/D.html", - "<h3>Properties inherited from class <a href=\"C.html\" title=\"class in <Unnamed>\">C</a></h3>" + NL + - "<code><a href=\"C.html#pausedProperty\">paused</a>, <a href=\"C.html#rateProperty\">rate</a></code></li>" }, - }; - private static final String[][] NO_TEST = - new String[][] { - {"./" + BUG_ID + "/C.html", - "A()"}, - }; - - - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-javafx", - SRC_DIR + FS + "C.java", SRC_DIR + FS + "D.java" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestJavaFX tester = new TestJavaFX(); - run(tester, ARGS, TEST, NO_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void test1() { + javadoc("-d", "out1", + "-sourcepath", testSrc, + "-javafx", + "-package", + "pkg1"); + checkExit(Exit.OK); + + checkOutput("pkg1/C.html", true, + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" + + "<dd><a href=\"../pkg1/C.html#getRate--\"><code>getRate()</code></a>, \n" + + "<a href=\"../pkg1/C.html#setRate-double-\">" + + "<code>setRate(double)</code></a></dd>", + "<pre>public final void setRate(double value)</pre>\n" + + "<div class=\"block\">Sets the value of the property rate.</div>\n" + + "<dl>\n" + + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>", + "<pre>public final double getRate()</pre>\n" + + "<div class=\"block\">Gets the value of the property rate.</div>\n" + + "<dl>\n" + + "<dt><span class=\"simpleTagLabel\">Property description:</span></dt>", + "<td class=\"colLast\"><code><span class=\"memberNameLink\">" + + "<a href=\"../pkg1/C.html#rateProperty\">rate</a></span></code>\n" + + "<div class=\"block\">Defines the direction/speed at which the " + + "<code>Timeline</code> is expected to", + "<span class=\"simpleTagLabel\">Default value:</span>", + "<span class=\"simpleTagLabel\">Since:</span></dt>\n" + + "<dd>JavaFX 8.0</dd>", + "<p>Sets the value of the property <code>Property</code>", + "<p>Gets the value of the property <code>Property</code>", + "<span class=\"simpleTagLabel\">Property description:</span>", + "<td class=\"colLast\"><code><span class=\"memberNameLink\">" + + "<a href=\"../pkg1/C.html#setTestMethodProperty--\">" + + "setTestMethodProperty</a></span>()</code> </td>", + "<h4>isPaused</h4>\n" + + "<pre>public final double isPaused()</pre>\n" + + "<div class=\"block\">Gets the value of the property paused.</div>"); + + checkOutput("pkg1/C.html", false, + "A()"); + + checkOutput("pkg1/D.html", true, + "<h3>Properties inherited from class pkg1." + + "<a href=\"../pkg1/C.html\" title=\"class in pkg1\">C</a></h3>\n" + + "<code><a href=\"../pkg1/C.html#pausedProperty\">" + + "paused</a>, <a href=\"../pkg1/C.html#rateProperty\">rate</a></code></li>"); } - - /** - * {@inheritDoc} + /* + * Test with -javafx option enabled, to ensure property getters and setters + * are treated correctly. */ - public String getBugName() { - return getClass().getName(); + @Test + void test2() { + javadoc("-d", "out2a", + "-sourcepath", testSrc, + "-javafx", + "-package", + "pkg2"); + checkExit(Exit.OK); + checkOutput("pkg2/Test.html", true, + "<li class=\"blockList\"><a name=\"property.detail\">\n" + + "<!-- -->\n" + + "</a>\n" + + "<h3>Property Detail</h3>\n" + + "<a name=\"betaProperty\">\n" + + "<!-- -->\n" + + "</a>\n" + + "<ul class=\"blockList\">\n" + + "<li class=\"blockList\">\n" + + "<h4>beta</h4>\n" + + "<pre>public java.lang.Object betaProperty</pre>\n" + + "</li>\n" + + "</ul>\n" + + "<a name=\"gammaProperty\">\n" + + "<!-- -->\n" + + "</a>\n" + + "<ul class=\"blockList\">\n" + + "<li class=\"blockList\">\n" + + "<h4>gamma</h4>\n" + + "<pre>public final java.util.List<" + + "java.lang.String> gammaProperty</pre>\n" + + "</li>\n" + + "</ul>\n" + + "<a name=\"deltaProperty\">\n" + + "<!-- -->\n" + + "</a>\n" + + "<ul class=\"blockListLast\">\n" + + "<li class=\"blockList\">\n" + + "<h4>delta</h4>\n" + + "<pre>public final java.util.List<" + + "java.util.Set<? super java.lang.Object>> deltaProperty</pre>\n" + + "</li>\n" + + "</ul>\n" + + "</li>"); + } + /* + * Test without -javafx option, to ensure property getters and setters + * are treated just like any other java method. + */ + @Test + void test3() { + javadoc("-d", "out2b", + "-sourcepath", testSrc, + "-package", + "pkg2"); + checkExit(Exit.OK); + checkOutput("pkg2/Test.html", false, "<h3>Property Summary</h3>"); + checkOutput("pkg2/Test.html", true, + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" + + "<th class=\"colLast\" scope=\"col\">Method and Description</th>\n" + + "</tr>\n" + + "<tr id=\"i0\" class=\"altColor\">\n" + + "<td class=\"colFirst\"><code><T> java.lang.Object</code></td>\n" + + "<td class=\"colLast\"><code><span class=\"memberNameLink\">" + + "<a href=\"../pkg2/Test.html#alphaProperty-java.util.List-\">" + + "alphaProperty</a></span>(java.util.List<T> foo)</code> </td>\n" + + "</tr>\n" + + "<tr id=\"i1\" class=\"rowColor\">\n" + + "<td class=\"colFirst\"><code>java.lang.Object</code></td>\n" + + "<td class=\"colLast\"><code><span class=\"memberNameLink\">" + + "<a href=\"../pkg2/Test.html#betaProperty--\">betaProperty</a></span>()</code>" + + " </td>\n" + + "</tr>\n" + + "<tr id=\"i2\" class=\"altColor\">\n" + + "<td class=\"colFirst\"><code>" + + "java.util.List<java.util.Set<? super java.lang.Object>>" + + "</code></td>\n" + + "<td class=\"colLast\"><code><span class=\"memberNameLink\">" + + "<a href=\"../pkg2/Test.html#deltaProperty--\">" + + "deltaProperty</a></span>()</code> </td>\n" + + "</tr>\n" + + "<tr id=\"i3\" class=\"rowColor\">\n" + + "<td class=\"colFirst\"><code>java.util.List<java.lang.String>" + + "</code></td>\n" + + "<td class=\"colLast\"><code><span class=\"memberNameLink\">" + + "<a href=\"../pkg2/Test.html#gammaProperty--\">gammaProperty</a>" + + "</span>()</code> </td>" + ); } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testJavaFX/pkg1/C.java Tue Nov 10 02:47:05 2020 +0000 @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package pkg1; + +public class C { + + /** + * @propertySetter Property + * @propertyDescription PropertyDescription + */ + public void CC() {} + + /** + * @propertyGetter Property + * + */ + public void B() {} + + /** + * Method A documentation + * @treatAsPrivate + */ + public void A() {} + + /** + * Field i + * @defaultValue 1.0 + */ + public int i; + + + /** + * Defines the direction/speed at which the {@code Timeline} is expected to + * be played. + * @defaultValue 11 + * @since JavaFX 8.0 + */ + private DoubleProperty rate; + + public final void setRate(double value) {} + + public final double getRate() {} + + public final DoubleProperty rateProperty() {} + + private BooleanProperty paused; + + public final void setPaused(boolean value) {} + + public final double isPaused() {} + + /** + * Defines if paused + * @defaultValue false + */ + public final BooleanProperty pausedProperty() {} + + class DoubleProperty {} + + class BooleanProperty {} + + public final BooleanProperty setTestMethodProperty() {} + + private class Inner { + private BooleanProperty testMethodProperty() {} + + /** + * Defines the direction/speed at which the {@code Timeline} is expected to + * be played. + * @defaultValue 11 + */ + private DoubleProperty rate; + + public final void setRate(double value) {} + + public final double getRate() {} + + public final DoubleProperty rateProperty() {} + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testJavaFX/pkg1/D.java Tue Nov 10 02:47:05 2020 +0000 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package pkg1; + +public class D extends C {}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testJavaFX/pkg2/Test.java Tue Nov 10 02:47:05 2020 +0000 @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package pkg2; + +import java.util.List; +import java.util.Set; + + +public class Test { + public <T> Object alphaProperty(List<T> foo) { return null; } + public Object betaProperty() { return null; } + public final List<String> gammaProperty() {return null;} + public final List<Set<? super Object>> deltaProperty() {return null;} +}
--- a/test/com/sun/javadoc/testJavascript/TestJavascript.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testJavascript/TestJavascript.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,117 +26,94 @@ * @bug 4665566 4855876 7025314 8012375 8015997 8016328 8024756 8151921 * @summary Verify that the output has the right javascript. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestJavascript * @run main TestJavascript */ public class TestJavascript extends JavadocTester { - //Test information. - private static final String BUG_ID = "4665566-4855876-8012375"; + public static void main(String... args) throws Exception { + TestJavascript tester = new TestJavascript(); + tester.runTests(); + } - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", SRC_DIR + FS + "TestJavascript.java" - }; + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg", testSrc("TestJavascript.java")); + checkExit(Exit.OK); + + checkOutput("pkg/C.html", true, + "<a href=\"../index.html?pkg/C.html\" target=\"_top\">Frames</a>"); + + checkOutput("TestJavascript.html", true, + "<a href=\"index.html?TestJavascript.html\" target=\"_top\">Frames</a>"); - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"../index.html?pkg/C.html\" target=\"_top\">Frames</a>"}, - {BUG_ID + FS + "TestJavascript.html", - "<a href=\"index.html?TestJavascript.html\" target=\"_top\">Frames</a>"}, - {BUG_ID + FS + "index.html", - "<script type=\"text/javascript\">" + NL + - " tmpTargetPage = \"\" + window.location.search;" + NL + - " if (tmpTargetPage != \"\" && tmpTargetPage != \"undefined\")" + NL + - " tmpTargetPage = tmpTargetPage.substring(1);" + NL + - " if (tmpTargetPage.indexOf(\":\") != -1 || (tmpTargetPage != \"\" && !validURL(tmpTargetPage)))" + NL + - " tmpTargetPage = \"undefined\";" + NL + - " targetPage = tmpTargetPage;" + NL + - " function validURL(url) {" + NL + - " try {" + NL + - " url = decodeURIComponent(url);" + NL + - " }" + NL + - " catch (error) {" + NL + - " return false;" + NL + - " }" + NL + - " var pos = url.indexOf(\".html\");" + NL + - " if (pos == -1 || pos != url.length - 5)" + NL + - " return false;" + NL + - " var allowNumber = false;" + NL + - " var allowSep = false;" + NL + - " var seenDot = false;" + NL + - " for (var i = 0; i < url.length - 5; i++) {" + NL + - " var ch = url.charAt(i);" + NL + - " if ('a' <= ch && ch <= 'z' ||" + NL + - " 'A' <= ch && ch <= 'Z' ||" + NL + - " ch == '$' ||" + NL + - " ch == '_' ||" + NL + - " ch.charCodeAt(0) > 127) {" + NL + - " allowNumber = true;" + NL + - " allowSep = true;" + NL + - " } else if ('0' <= ch && ch <= '9'" + NL + - " || ch == '-') {" + NL + - " if (!allowNumber)" + NL + - " return false;" + NL + - " } else if (ch == '/' || ch == '.') {" + NL + - " if (!allowSep)" + NL + - " return false;" + NL + - " allowNumber = false;" + NL + - " allowSep = false;" + NL + - " if (ch == '.')" + NL + - " seenDot = true;" + NL + - " if (ch == '/' && seenDot)" + NL + - " return false;" + NL + - " } else {" + NL + - " return false;" + NL + - " }" + NL + - " }" + NL + - " return true;" + NL + - " }" + NL + - " function loadFrames() {" + NL + - " if (targetPage != \"\" && targetPage != \"undefined\")" + NL + - " top.classFrame.location = top.targetPage;" + NL + - " }" + NL + - "</script>"}, + checkOutput("index.html", true, + "<script type=\"text/javascript\">\n" + + " tmpTargetPage = \"\" + window.location.search;\n" + + " if (tmpTargetPage != \"\" && tmpTargetPage != \"undefined\")\n" + + " tmpTargetPage = tmpTargetPage.substring(1);\n" + + " if (tmpTargetPage.indexOf(\":\") != -1 || (tmpTargetPage != \"\" && !validURL(tmpTargetPage)))\n" + + " tmpTargetPage = \"undefined\";\n" + + " targetPage = tmpTargetPage;\n" + + " function validURL(url) {\n" + + " try {\n" + + " url = decodeURIComponent(url);\n" + + " }\n" + + " catch (error) {\n" + + " return false;\n" + + " }\n" + + " var pos = url.indexOf(\".html\");\n" + + " if (pos == -1 || pos != url.length - 5)\n" + + " return false;\n" + + " var allowNumber = false;\n" + + " var allowSep = false;\n" + + " var seenDot = false;\n" + + " for (var i = 0; i < url.length - 5; i++) {\n" + + " var ch = url.charAt(i);\n" + + " if ('a' <= ch && ch <= 'z' ||\n" + + " 'A' <= ch && ch <= 'Z' ||\n" + + " ch == '$' ||\n" + + " ch == '_' ||\n" + + " ch.charCodeAt(0) > 127) {\n" + + " allowNumber = true;\n" + + " allowSep = true;\n" + + " } else if ('0' <= ch && ch <= '9'\n" + + " || ch == '-') {\n" + + " if (!allowNumber)\n" + + " return false;\n" + + " } else if (ch == '/' || ch == '.') {\n" + + " if (!allowSep)\n" + + " return false;\n" + + " allowNumber = false;\n" + + " allowSep = false;\n" + + " if (ch == '.')\n" + + " seenDot = true;\n" + + " if (ch == '/' && seenDot)\n" + + " return false;\n" + + " } else {\n" + + " return false;\n" + + " }\n" + + " }\n" + + " return true;\n" + + " }\n" + + " function loadFrames() {\n" + + " if (targetPage != \"\" && targetPage != \"undefined\")\n" + + " top.classFrame.location = top.targetPage;\n" + + " }\n" + + "</script>"); //Make sure title javascript only runs if is-external is not true - {BUG_ID + FS + "pkg" + FS + "C.html", - " try {" + NL + - " if (location.href.indexOf('is-external=true') == -1) {" + NL + - " parent.document.title=\"C\";" + NL + - " }" + NL + - " }" + NL + - " catch(err) {" + NL + - " }"}, - }; - - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestJavascript tester = new TestJavascript(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); - } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/C.html", true, + " try {\n" + + " if (location.href.indexOf('is-external=true') == -1) {\n" + + " parent.document.title=\"C\";\n" + + " }\n" + + " }\n" + + " catch(err) {\n" + + " }"); } }
--- a/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java Tue Nov 10 02:47:05 2020 +0000 @@ -32,90 +32,82 @@ * @run main TestLambdaFeature */ +/* + * NOTE : This test should be elided when version 1.7 support is removed from the JDK + * or the negative part of the test showing 1.7's non-support should be + * removed [ 8022738 ] + */ + public class TestLambdaFeature extends JavadocTester { - //Test information. - private static final String BUG_ID = "8004893-8022738"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "pkg1" - }; - - private static final String[] ARGS_1 = new String[] { - "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, "-source", "1.5", "pkg1" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "A.html", - "<td class=\"colFirst\"><code>default void</code></td>"}, - {BUG_ID + FS + "pkg" + FS + "A.html", - "<pre>default void defaultMethod()</pre>"}, - {BUG_ID + FS + "pkg" + FS + "A.html", - "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + - "All Methods</span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t2\" class=\"tableTab\"><span>" + - "<a href=\"javascript:show(2);\">Instance Methods</a></span>" + - "<span class=\"tabEnd\"> </span></span><span id=\"t3\" " + - "class=\"tableTab\"><span><a href=\"javascript:show(4);\">" + - "Abstract Methods</a></span><span class=\"tabEnd\"> </span>" + - "</span><span id=\"t5\" class=\"tableTab\"><span>" + - "<a href=\"javascript:show(16);\">Default Methods</a></span>" + - "<span class=\"tabEnd\"> </span></span></caption>"}, - {BUG_ID + FS + "pkg" + FS + "A.html", - "<dl>" + NL + "<dt>Functional Interface:</dt>" + NL + - "<dd>This is a functional interface and can therefore be used as " + - "the assignment target for a lambda expression or method " + - "reference.</dd>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg1" + FS + "FuncInf.html", - "<dl>" + NL + "<dt>Functional Interface:</dt>" + NL + - "<dd>This is a functional interface and can therefore be used as " + - "the assignment target for a lambda expression or method " + - "reference.</dd>" + NL + "</dl>"} - }; - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg" + FS + "A.html", - "<td class=\"colFirst\"><code>default default void</code></td>"}, - {BUG_ID + FS + "pkg" + FS + "A.html", - "<pre>default default void defaultMethod()</pre>"}, - {BUG_ID + FS + "pkg" + FS + "B.html", - "<td class=\"colFirst\"><code>default void</code></td>"}, - {BUG_ID + FS + "pkg1" + FS + "NotAFuncInf.html", - "<dl>" + NL + "<dt>Functional Interface:</dt>" + NL + - "<dd>This is a functional interface and can therefore be used as " + - "the assignment target for a lambda expression or method " + - "reference.</dd>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg" + FS + "B.html", - "<dl>" + NL + "<dt>Functional Interface:</dt>"} - }; - private static final String[][] NEGATED_TEST_1 = { - {BUG_ID + "-2" + FS + "pkg1" + FS + "FuncInf.html", - "<dl>" + NL + "<dt>Functional Interface:</dt>"} - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestLambdaFeature tester = new TestLambdaFeature(); - run(tester, ARGS, TEST, NEGATED_TEST); - run(tester, ARGS_1, NO_TEST, NEGATED_TEST_1); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void testDefault() { + javadoc("-d", "out-default", + "-sourcepath", testSrc, + "pkg", "pkg1"); + checkExit(Exit.OK); + + checkOutput("pkg/A.html", true, + "<td class=\"colFirst\"><code>default void</code></td>", + "<pre>default void defaultMethod()</pre>", + "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + + "All Methods</span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t2\" class=\"tableTab\"><span>" + + "<a href=\"javascript:show(2);\">Instance Methods</a></span>" + + "<span class=\"tabEnd\"> </span></span><span id=\"t3\" " + + "class=\"tableTab\"><span><a href=\"javascript:show(4);\">" + + "Abstract Methods</a></span><span class=\"tabEnd\"> </span>" + + "</span><span id=\"t5\" class=\"tableTab\"><span>" + + "<a href=\"javascript:show(16);\">Default Methods</a></span>" + + "<span class=\"tabEnd\"> </span></span></caption>", + "<dl>\n" + + "<dt>Functional Interface:</dt>\n" + + "<dd>This is a functional interface and can therefore be used as " + + "the assignment target for a lambda expression or method " + + "reference.</dd>\n" + + "</dl>"); + + checkOutput("pkg1/FuncInf.html", true, + "<dl>\n" + + "<dt>Functional Interface:</dt>\n" + + "<dd>This is a functional interface and can therefore be used as " + + "the assignment target for a lambda expression or method " + + "reference.</dd>\n" + + "</dl>"); + + checkOutput("pkg/A.html", false, + "<td class=\"colFirst\"><code>default default void</code></td>", + "<pre>default default void defaultMethod()</pre>"); + + checkOutput("pkg/B.html", false, + "<td class=\"colFirst\"><code>default void</code></td>", + "<dl>\n" + + "<dt>Functional Interface:</dt>"); + + checkOutput("pkg1/NotAFuncInf.html", false, + "<dl>\n" + + "<dt>Functional Interface:</dt>\n" + + "<dd>This is a functional interface and can therefore be used as " + + "the assignment target for a lambda expression or method " + + "reference.</dd>\n" + + "</dl>"); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void testSource7() { + javadoc("-d", "out-7", + "-sourcepath", testSrc, + "-source", "1.7", + "pkg1"); + checkExit(Exit.OK); + + checkOutput("pkg1/FuncInf.html", false, + "<dl>\n" + + "<dt>Functional Interface:</dt>"); } }
--- a/test/com/sun/javadoc/testLeadingSpaces/LeadingSpaces.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testLeadingSpaces/LeadingSpaces.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,53 +29,35 @@ * begin their comment without a leading star without leading * spaces stripped * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build LeadingSpaces * @run main LeadingSpaces */ public class LeadingSpaces extends JavadocTester { - - private static final String BUG_ID = "4232882-8014636"; - private static final String[][] TEST = { - {BUG_ID + FS + "LeadingSpaces.html", -" 1" + NL + -" 2" + NL + -" 3" + NL + -" 4" + NL + -" 5" + NL + -" 6" + NL + -" 7"} - }; - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - SRC_DIR + FS + "LeadingSpaces.java"}; - /** * The entry point of the test. * @param args the array of command line arguments. + * @throws Exception if the test fails */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { LeadingSpaces tester = new LeadingSpaces(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void testLeadingSpaces() { + javadoc("-d", "out", "-sourcepath", testSrc, + testSrc("LeadingSpaces.java")); + checkExit(Exit.OK); + checkOutput("LeadingSpaces.html", true, + " 1\n" + + " 2\n" + + " 3\n" + + " 4\n" + + " 5\n" + + " 6\n" + + " 7"); } /**
--- a/test/com/sun/javadoc/testLegacyTaglet/TestLegacyTaglet.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testLegacyTaglet/TestLegacyTaglet.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,56 +27,35 @@ * @summary Test to ensure that the refactored version of the standard * doclet still works with Taglets that implement the 1.4.0 interface. * @author jamieh - * @library ../lib/ - * @compile ../lib/JavadocTester.java TestLegacyTaglet.java ToDoTaglet.java UnderlineTaglet.java Check.java + * @library ../lib + * @build JavadocTester ToDoTaglet UnderlineTaglet Check * @run main TestLegacyTaglet */ public class TestLegacyTaglet extends JavadocTester { - private static final String BUG_ID = "4638723-8015882"; - - private static final String[] ARGS = - new String[] {"-d", BUG_ID, "-sourcepath", SRC_DIR, - "-tagletpath", SRC_DIR, "-taglet", "ToDoTaglet", "-taglet", "Check", - "-taglet", "UnderlineTaglet", SRC_DIR + FS + "C.java"}; - - private static final String[][] TEST = new String[][] { - {BUG_ID + FS + "C.html", "This is an <u>underline</u>"}, - {BUG_ID + FS + "C.html", - "<DT><B>To Do:</B><DD><table cellpadding=2 cellspacing=0><tr>" + - "<td bgcolor=\"yellow\">Finish this class.</td></tr></table></DD>"}, - {BUG_ID + FS + "C.html", - "<DT><B>To Do:</B><DD><table cellpadding=2 cellspacing=0><tr>" + - "<td bgcolor=\"yellow\">Tag in Method.</td></tr></table></DD>"} - }; - - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestLegacyTaglet tester = new TestLegacyTaglet(); - run(tester, ARGS, TEST, NEGATED_TEST); - if (tester.getErrorOutput().contains("NullPointerException")) { - throw new AssertionError("javadoc threw NullPointerException"); - } - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-tagletpath", testSrc, + "-taglet", "ToDoTaglet", + "-taglet", "Check", + "-taglet", "UnderlineTaglet", + testSrc("C.java")); + checkExit(Exit.OK); + checkOutput("C.html", true, + "This is an <u>underline</u>", + "<DT><B>To Do:</B><DD><table cellpadding=2 cellspacing=0><tr>" + + "<td bgcolor=\"yellow\">Finish this class.</td></tr></table></DD>", + "<DT><B>To Do:</B><DD><table cellpadding=2 cellspacing=0><tr>" + + "<td bgcolor=\"yellow\">Tag in Method.</td></tr></table></DD>"); + checkOutput(Output.STDERR, false, + "NullPointerException"); } }
--- a/test/com/sun/javadoc/testLinkOption/TestBadLinkOption.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testLinkOption/TestBadLinkOption.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,50 +26,32 @@ * @bug 4625883 * @summary Make sure that bad -link arguments trigger warnings. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestBadLinkOption * @run main TestBadLinkOption */ public class TestBadLinkOption extends JavadocTester { - private static final String BUG_ID = "4720957"; - - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - "-link", BUG_ID, "pkg" - }; - - private static final String[][] TEST = { - {WARNING_OUTPUT, "Error reading file:"} - }; - - private static final String[][] NEG_TEST = { - {ERROR_OUTPUT, "Error reading file:"} - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestBadLinkOption tester = new TestBadLinkOption(); - run(tester, ARGS, TEST, NEG_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + String out = "out"; + javadoc("-d", out, + "-sourcepath", testSrc, + "-link", out, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + // TODO: the file it is trying to read, out/out/package-list, warrants investigation + checkOutput(Output.WARNING, true, + "Error reading file:"); + + checkOutput(Output.ERROR, false, + "Error reading file:"); } }
--- a/test/com/sun/javadoc/testLinkOption/TestLinkOption.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testLinkOption/TestLinkOption.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,120 +27,111 @@ * @summary Test to make sure that -link and -linkoffline link to * right files, and URLs with and without trailing slash are accepted. * @author jamieh - * @library ../lib/ - * @build JavadocTester TestLinkOption + * @library ../lib + * @build JavadocTester * @run main TestLinkOption */ import java.io.File; public class TestLinkOption extends JavadocTester { - - private static final String BUG_ID = "4720957-5020118-8038976"; + /** + * The entry point of the test. + * @param args the array of command line arguments. + */ + public static void main(String... args) throws Exception { + TestLinkOption tester = new TestLinkOption(); + tester.runTests(); + } - //Generate the documentation using -linkoffline and a URL as the first parameter. - private static final String[] ARGS1 = new String[] { - "-d", BUG_ID + "-1", "-sourcepath", SRC_DIR, - "-linkoffline", "http://java.sun.com/j2se/1.4/docs/api/", - SRC_DIR, "-package", "pkg", "java.lang" - }; + // The following test runs javadoc multiple times; it is important that the + // first one is run first, since the subsequent runs refer to the output + // it generates. Therefore we run everything serially in a single @Test + // method and not in independent @Test methods. + @Test + void test() { + // Generate the documentation using -linkoffline and a URL as the first parameter. + String out1 = "out1"; + String url = "http://java.sun.com/j2se/1.4/docs/api/"; + javadoc("-d", out1, + "-sourcepath", testSrc, + "-linkoffline", url, testSrc, + "-package", + "pkg", "java.lang"); + checkExit(Exit.OK); - private static final String[][] TEST1 = { - {BUG_ID + "-1" + FS + "pkg" + FS + "C.html", - "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html?is-external=true\" " + - "title=\"class or interface in java.lang\"><code>Link to String Class</code></a>" - }, - //Make sure the parameters are indented properly when the -link option is used. - {BUG_ID + "-1" + FS + "pkg" + FS + "C.html", - "(int p1," + NL + - " int p2," + NL + - " int p3)" - }, - {BUG_ID + "-1" + FS + "pkg" + FS + "C.html", - "(int p1," + NL + - " int p2," + NL + - " <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" title=\"class or interface in java.lang\">" + - "Object</a> p3)" - }, - {BUG_ID + "-1" + FS + "java" + FS + "lang" + FS + "StringBuilderChild.html", - "<pre>public abstract class <span class=\"typeNameLabel\">StringBuilderChild</span>" + NL + - "extends <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" " + - "title=\"class or interface in java.lang\">Object</a></pre>" - }, + checkOutput("pkg/C.html", true, + "<a href=\"" + url + "java/lang/String.html?is-external=true\" " + + "title=\"class or interface in java.lang\"><code>Link to String Class</code></a>", + //Make sure the parameters are indented properly when the -link option is used. + "(int p1,\n" + + " int p2,\n" + + " int p3)", + "(int p1,\n" + + " int p2,\n" + + " <a href=\"" + url + "java/lang/Object.html?is-external=true\" title=\"class or interface in java.lang\">" + + "Object</a> p3)"); + + checkOutput("java/lang/StringBuilderChild.html", true, + "<pre>public abstract class <span class=\"typeNameLabel\">StringBuilderChild</span>\n" + + "extends <a href=\"" + url + "java/lang/Object.html?is-external=true\" " + + "title=\"class or interface in java.lang\">Object</a></pre>" + ); - }; - private static final String[][] NEGATED_TEST1 = NO_TEST; + // Generate the documentation using -linkoffline and a relative path as the first parameter. + // We will try linking to the docs generated in test 1 with a relative path. + String out2 = "out2"; + javadoc("-d", out2, + "-sourcepath", testSrc, + "-linkoffline", "../" + out1, out1, + "-package", + "pkg2"); + checkExit(Exit.OK); + checkOutput("pkg2/C2.html", true, + "This is a link to <a href=\"../../" + out1 + "/pkg/C.html?is-external=true\" " + + "title=\"class or interface in pkg\"><code>Class C</code></a>." + ); - //Generate the documentation using -linkoffline and a relative path as the first parameter. - //We will try linking to the docs generated in test 1 with a relative path. - private static final String[] ARGS2 = new String[] { - "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, - "-linkoffline", "../" + BUG_ID + "-1", BUG_ID + "-1", "-package", "pkg2" - }; + String out3 = "out3"; + javadoc(createArguments(out3, out1, true)); // with trailing slash + checkExit(Exit.OK); - private static final String[][] TEST2 = { - {BUG_ID + "-2" + FS + "pkg2" + FS + "C2.html", - "This is a link to <a href=\"../../" + BUG_ID + "-1/pkg/C.html?is-external=true\" " + - "title=\"class or interface in pkg\"><code>Class C</code></a>." - } - }; - private static final String[][] NEGATED_TEST2 = NO_TEST; + String out4 = "out4"; + javadoc(createArguments(out4, out1, false)); // without trailing slash + checkExit(Exit.OK); + // Note: the following test is very weak, and will fail if ever the test + // of the message is changed. We should have a separate test to verify + // this is the text that is given when there is a problem with a URL + checkOutput(Output.WARNING, false, + "warning - Error fetching URL"); + } + /* * Create the documentation using the -link option, vary the behavior with * both trailing and no trailing slash. We are only interested in ensuring * that the command executes with no errors or related warnings. */ - static String[] createArguments(boolean withTrailingSlash) { - String packagePath = new File(BUG_ID + "-1").getAbsolutePath(); - String outputDirName = BUG_ID; + static String[] createArguments(String outDir, String packageDir, boolean withTrailingSlash) { + String packagePath = new File(packageDir).getAbsolutePath(); if (withTrailingSlash) { // add the trailing slash, if it is not present! if (!packagePath.endsWith(FS)) { packagePath = packagePath + FS; } - outputDirName = outputDirName + "-3"; } else { // remove the trailing slash, if it is present! if (packagePath.endsWith(FS)) { packagePath = packagePath.substring(0, packagePath.length() - 1); } - outputDirName = outputDirName + "-4"; } String args[] = { - "-d", outputDirName, "-sourcepath", SRC_DIR, - "-link", "file:///" + packagePath, "-package", "pkg2" + "-d", outDir, + "-sourcepath", testSrc, + "-link", "file:///" + packagePath, + "-package", + "pkg2" }; System.out.println("packagePath: " + packagePath); return args; } - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestLinkOption tester = new TestLinkOption(); - run(tester, ARGS1, TEST1, NEGATED_TEST1); - run(tester, ARGS2, TEST2, NEGATED_TEST2); - tester.runJavadoc(createArguments(true)); // with trailing slash - tester.runJavadoc(createArguments(false)); // without trailing slash - tester.printSummary(); - if (tester.getWarningOutput().contains("warning - Error fetching URL")) { - throw new Error("URL rejected ?"); - } - tester.printSummary(); - } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } }
--- a/test/com/sun/javadoc/testLinkOption/TestNewLineInLink.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testLinkOption/TestNewLineInLink.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,47 +27,27 @@ * @summary Make sure that a new line may act as a separator between * link and label. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestNewLineInLink * @run main TestNewLineInLink */ public class TestNewLineInLink extends JavadocTester { - private static final String BUG_ID = "4739870"; - private static final String[][] NEGATED_TEST = - new String[][] { - {ERROR_OUTPUT, - "illegal character"} - }; - - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - "-linkoffline", "http://www.java.sun.com/j2se/1.4/docs/api", - SRC_DIR, "testNewLineInLink"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestNewLineInLink tester = new TestNewLineInLink(); - run(tester, ARGS, new String[][] {}, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-linkoffline", "http://www.java.sun.com/j2se/1.4/docs/api", testSrc, + "testNewLineInLink"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput(Output.ERROR, false, + "illegal character"); } }
--- a/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,68 +27,46 @@ * @summary Make sure that you can link from one member to another using * non-qualified name, furthermore, ensure the right one is linked. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestLinkTaglet * @run main TestLinkTaglet */ public class TestLinkTaglet extends JavadocTester { - //Test information. - private static final String BUG_ID = "4732864-6280605-7064544-8014636"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", SRC_DIR + FS + "checkPkg" + FS + "B.java" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "C.html", - "Qualified Link: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>" + NL + - " Unqualified Link1: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>" + NL + - " Unqualified Link2: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>" + NL + - " Qualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>" + NL + - " Unqualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>" + NL + - " Unqualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(InnerC, InnerC2)</code></a>.<br/>" - }, - {BUG_ID + FS + "pkg" + FS + "C.InnerC.html", - "Link to member in outer class: <a href=\"../pkg/C.html#MEMBER\"><code>C.MEMBER</code></a> <br/>" + NL + - " Link to member in inner class: <a href=\"../pkg/C.InnerC2.html#MEMBER2\"><code>C.InnerC2.MEMBER2</code></a> <br/>" + NL + - " Link to another inner class: <a href=\"../pkg/C.InnerC2.html\" title=\"class in pkg\"><code>C.InnerC2</code></a>" - }, - {BUG_ID + FS + "pkg" + FS + "C.InnerC2.html", - "<dl>" + NL + "<dt>Enclosing class:</dt>" + NL + - "<dd><a href=\"../pkg/C.html\" title=\"class in pkg\">C</a></dd>" + NL + - "</dl>" - }, - }; - private static final String[][] NEGATED_TEST = { - {WARNING_OUTPUT, "Tag @see: reference not found: A"}, - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestLinkTaglet tester = new TestLinkTaglet(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-Xdoclint:none", + "-d", "out", + "-sourcepath", testSrc, + "pkg", testSrc("checkPkg/B.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/C.html", true, + "Qualified Link: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n" + + " Unqualified Link1: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n" + + " Unqualified Link2: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n" + + " Qualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>\n" + + " Unqualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>\n" + + " Unqualified Link: <a href=\"../pkg/C.html#method-pkg.C.InnerC-pkg.C.InnerC2-\"><code>method(InnerC, InnerC2)</code></a>.<br/>"); + + checkOutput("pkg/C.InnerC.html", true, + "Link to member in outer class: <a href=\"../pkg/C.html#MEMBER\"><code>C.MEMBER</code></a> <br/>\n" + + " Link to member in inner class: <a href=\"../pkg/C.InnerC2.html#MEMBER2\"><code>C.InnerC2.MEMBER2</code></a> <br/>\n" + + " Link to another inner class: <a href=\"../pkg/C.InnerC2.html\" title=\"class in pkg\"><code>C.InnerC2</code></a>"); + + checkOutput("pkg/C.InnerC2.html", true, + "<dl>\n" + + "<dt>Enclosing class:</dt>\n" + + "<dd><a href=\"../pkg/C.html\" title=\"class in pkg\">C</a></dd>\n" + + "</dl>"); + + checkOutput(Output.WARNING, false, + "Tag @see: reference not found: A"); } }
--- a/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,45 +27,28 @@ * @summary Test to make sure that there is a link with a proper anchor * from a serializable class to serialized-form.html. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestLinkToSerialForm * @run main TestLinkToSerialForm */ public class TestLinkToSerialForm extends JavadocTester { - private static final String BUG_ID = "4521661"; - private static final String[][] TEST = { - {BUG_ID + FS + "serialized-form.html", "<a name=\"pkg.C\">"}, - {BUG_ID + FS + "pkg" + FS + "C.html", "<a href=\"../serialized-form.html#pkg.C\">"} - }; - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestLinkToSerialForm tester = new TestLinkToSerialForm(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("serialized-form.html", true, + "<a name=\"pkg.C\">"); + checkOutput("pkg/C.html", true, + "<a href=\"../serialized-form.html#pkg.C\">"); } }
--- a/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,93 +25,61 @@ * @test * @bug 8002387 8014636 * @summary Improve rendered HTML formatting for {@code} - * @library ../lib/ - * @build JavadocTester TestLiteralCodeInPre + * @library ../lib + * @build JavadocTester * @run main TestLiteralCodeInPre */ public class TestLiteralCodeInPre extends JavadocTester { - //Test information. - private static final String BUG_ID = "8002387-8014636"; - private static final String OUTPUT_DIR = BUG_ID; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-Xdoclint:none", "pkg" - }; - - //Input for string search tests. - private static final String[][] TEST = { - { BUG_ID + FS + "pkg" + FS + "Test.html", - "no_pre()</pre>" + NL + - "<div class=\"block\">abc<code>def</code>ghi</div>" }, - { BUG_ID + FS + "pkg" + FS + "Test.html", - "no_pre_extra_whitespace()</pre>" + NL + - "<div class=\"block\">abc<code>def </code>ghi</div>" }, - { BUG_ID + FS + "pkg" + FS + "Test.html", - "in_pre()</pre>" + NL + - "<div class=\"block\"><pre> abc<code> def </code>ghi</pre></div>" }, - { BUG_ID + FS + "pkg" + FS + "Test.html", - "pre_after_text()</pre>" + NL + - "<div class=\"block\">xyz <pre> abc<code> def </code>ghi</pre></div>" }, - { BUG_ID + FS + "pkg" + FS + "Test.html", - "after_pre()</pre>" + NL + - "<div class=\"block\">xyz <pre> pqr </pre> abc<code>def </code>ghi</div>" }, - { BUG_ID + FS + "pkg" + FS + "Test.html", - "back_in_pre()</pre>" + NL + - "<div class=\"block\">xyz <pre> pqr </pre> mno <pre> abc<code> def </code>ghi</pre></div>" }, - { BUG_ID + FS + "pkg" + FS + "Test.html", - "typical_usage_code()</pre>" + NL + - "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit." + NL + - " Example: <pre><code>" + NL + - " line 1 <T> void m(T t) {" + NL + - " line 2 // do something with T" + NL + - " line 3 }" + NL + - " </code></pre>" + NL + - " and so it goes.</div>" }, - { BUG_ID + FS + "pkg" + FS + "Test.html", - "typical_usage_literal()</pre>" + NL + - "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit." + NL + - " Example: <pre>" + NL + - " line 1 <T> void m(T t) {" + NL + - " line 2 // do something with T" + NL + - " line 3 }" + NL + - " </pre>" + NL + - " and so it goes.</div>" }, - { BUG_ID + FS + "pkg" + FS + "Test.html", - "recommended_usage_literal()</pre>" + NL + - "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit." + NL + - " Example: <pre>" + NL + - " line 1 <T> void m(T t) {" + NL + - " line 2 // do something with T" + NL + - " line 3 } </pre>" + NL + - " and so it goes.</div>" } - }; - - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestLiteralCodeInPre tester = new TestLiteralCodeInPre(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-Xdoclint:none", + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/Test.html", true, + "no_pre()</pre>\n" + + "<div class=\"block\">abc<code>def</code>ghi</div>", + "no_pre_extra_whitespace()</pre>\n" + + "<div class=\"block\">abc<code>def </code>ghi</div>", + "in_pre()</pre>\n" + + "<div class=\"block\"><pre> abc<code> def </code>ghi</pre></div>", + "pre_after_text()</pre>\n" + + "<div class=\"block\">xyz <pre> abc<code> def </code>ghi</pre></div>", + "after_pre()</pre>\n" + + "<div class=\"block\">xyz <pre> pqr </pre> abc<code>def </code>ghi</div>", + "back_in_pre()</pre>\n" + + "<div class=\"block\">xyz <pre> pqr </pre> mno <pre> abc<code> def </code>ghi</pre></div>", + "typical_usage_code()</pre>\n" + + "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n" + + " Example: <pre><code>\n" + + " line 1 <T> void m(T t) {\n" + + " line 2 // do something with T\n" + + " line 3 }\n" + + " </code></pre>\n" + + " and so it goes.</div>", + "typical_usage_literal()</pre>\n" + + "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n" + + " Example: <pre>\n" + + " line 1 <T> void m(T t) {\n" + + " line 2 // do something with T\n" + + " line 3 }\n" + + " </pre>\n" + + " and so it goes.</div>", + "recommended_usage_literal()</pre>\n" + + "<div class=\"block\">Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n" + + " Example: <pre>\n" + + " line 1 <T> void m(T t) {\n" + + " line 2 // do something with T\n" + + " line 3 } </pre>\n" + + " and so it goes.</div>"); } }
--- a/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,96 +27,63 @@ * @summary Test to make sure that members are inherited properly in the Javadoc. * Verify that inheritence labels are correct. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestMemberInheritence * @run main TestMemberInheritence */ public class TestMemberInheritence extends JavadocTester { - private static final String BUG_ID = "4638588-4635809-6256068-6270645"; - - private static final String[][] TEST = { - //Public field should be inherited - {BUG_ID + FS + "pkg" + FS + "SubClass.html", - "<a href=\"../pkg/BaseClass.html#pubField\">"}, - - //Public method should be inherited - {BUG_ID + FS + "pkg" + FS + "SubClass.html", - "<a href=\"../pkg/BaseClass.html#pubMethod--\">"}, - - //Public inner class should be inherited. - {BUG_ID + FS + "pkg" + FS + "SubClass.html", - "<a href=\"../pkg/BaseClass.pubInnerClass.html\" title=\"class in pkg\">"}, - - //Protected field should be inherited - {BUG_ID + FS + "pkg" + FS + "SubClass.html", - "<a href=\"../pkg/BaseClass.html#proField\">"}, - - //Protected method should be inherited - {BUG_ID + FS + "pkg" + FS + "SubClass.html", - "<a href=\"../pkg/BaseClass.html#proMethod--\">"}, - - //Protected inner class should be inherited. - {BUG_ID + FS + "pkg" + FS + "SubClass.html", - "<a href=\"../pkg/BaseClass.proInnerClass.html\" title=\"class in pkg\">"}, - - // New labels as of 1.5.0 - {BUG_ID + FS + "pkg" + FS + "SubClass.html", - "Nested classes/interfaces inherited from class pkg." + - "<a href=\"../pkg/BaseClass.html\" title=\"class in pkg\">BaseClass</a>"}, - {BUG_ID + FS + "pkg" + FS + "SubClass.html", - "Nested classes/interfaces inherited from interface pkg." + - "<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">BaseInterface</a>"}, - - // Test overriding/implementing methods with generic parameters. - {BUG_ID + FS + "pkg" + FS + "BaseClass.html", - "<dl>" + NL + "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL + - "<dd><code><a href=\"../pkg/BaseInterface.html#getAnnotation-java.lang.Class-\">" + - "getAnnotation</a></code> in interface <code>" + - "<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">" + - "BaseInterface</a></code></dd>" + NL + "</dl>"}, - - // Test diamond inheritence member summary (6256068) - {BUG_ID + FS + "diamond" + FS + "Z.html", - "<code><a href=\"../diamond/A.html#aMethod--\">aMethod</a></code>"}, - - // Test that doc is inherited from closed parent (6270645) - {BUG_ID + FS + "inheritDist" + FS + "C.html", - "<div class=\"block\">m1-B</div>"}, - - }; - - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg" + FS + "SubClass.html", - "<a href=\"../pkg/BaseClass.html#staticMethod--\">staticMethod</a></code>"}, - }; - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "diamond", "inheritDist"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestMemberInheritence tester = new TestMemberInheritence(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg", "diamond", "inheritDist"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/SubClass.html", true, + // Public field should be inherited + "<a href=\"../pkg/BaseClass.html#pubField\">", + // Public method should be inherited + "<a href=\"../pkg/BaseClass.html#pubMethod--\">", + // Public inner class should be inherited. + "<a href=\"../pkg/BaseClass.pubInnerClass.html\" title=\"class in pkg\">", + // Protected field should be inherited + "<a href=\"../pkg/BaseClass.html#proField\">", + // Protected method should be inherited + "<a href=\"../pkg/BaseClass.html#proMethod--\">", + // Protected inner class should be inherited. + "<a href=\"../pkg/BaseClass.proInnerClass.html\" title=\"class in pkg\">", + // New labels as of 1.5.0 + "Nested classes/interfaces inherited from class pkg." + + "<a href=\"../pkg/BaseClass.html\" title=\"class in pkg\">BaseClass</a>", + "Nested classes/interfaces inherited from interface pkg." + + "<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">BaseInterface</a>"); + + checkOutput("pkg/BaseClass.html", true, + // Test overriding/implementing methods with generic parameters. + "<dl>\n" + + "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n" + + "<dd><code><a href=\"../pkg/BaseInterface.html#getAnnotation-java.lang.Class-\">" + + "getAnnotation</a></code> in interface <code>" + + "<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">" + + "BaseInterface</a></code></dd>\n" + + "</dl>"); + + checkOutput("diamond/Z.html", true, + // Test diamond inheritence member summary (6256068) + "<code><a href=\"../diamond/A.html#aMethod--\">aMethod</a></code>"); + + checkOutput("inheritDist/C.html", true, + // Test that doc is inherited from closed parent (6270645) + "<div class=\"block\">m1-B</div>"); + + checkOutput("pkg/SubClass.html", false, + "<a href=\"../pkg/BaseClass.html#staticMethod--\">staticMethod</a></code>"); } }
--- a/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,68 +28,40 @@ * type than the method in the child class. Make sure the * documentation is inherited but the return type isn't. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestMemberSummary * @run main TestMemberSummary */ public class TestMemberSummary extends JavadocTester { - //Test information. - private static final String BUG_ID = "4951228-6290760"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg","pkg2" - }; - - //Input for string search tests. - private static final String[][] TEST = { - // Check return type in member summary. - {BUG_ID + FS + "pkg" + FS + "PublicChild.html", - "<code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>" + NL + - "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../pkg/PublicChild.html#returnTypeTest--\">" + - "returnTypeTest</a></span>()</code>" - }, - // Check return type in member detail. - {BUG_ID + FS + "pkg" + FS + "PublicChild.html", - "<pre>public <a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">" + - "PublicChild</a> returnTypeTest()</pre>" - }, - - // Legacy anchor dimensions (6290760) - {BUG_ID + FS + "pkg2" + FS + "A.html", - "<a name=\"f-java.lang.Object:A-\">" + NL + - "<!-- -->" + NL + - "</a><a name=\"f-T:A-\">" + NL + - "<!-- -->" + NL + - "</a>" - }, - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestMemberSummary tester = new TestMemberSummary(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg","pkg2"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/PublicChild.html", true, + // Check return type in member summary. + "<code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n" + + "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../pkg/PublicChild.html#returnTypeTest--\">" + + "returnTypeTest</a></span>()</code>", + // Check return type in member detail. + "<pre>public <a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">" + + "PublicChild</a> returnTypeTest()</pre>"); + + // Legacy anchor dimensions (6290760) + checkOutput("pkg2/A.html", true, + "<a name=\"f-java.lang.Object:A-\">\n" + + "<!-- -->\n" + + "</a><a name=\"f-T:A-\">\n" + + "<!-- -->\n" + + "</a>"); } }
--- a/test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,114 +26,74 @@ * @bug 8002304 8024096 * @summary Test for various method types in the method summary table * @author Bhavesh Patel - * @library ../lib/ - * @build JavadocTester TestMethodTypes + * @library ../lib + * @build JavadocTester * @run main TestMethodTypes */ public class TestMethodTypes extends JavadocTester { - //Test information. - private static final String BUG_ID = "8002304"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1" - }; - - private static final String[][] TEST = { - {BUG_ID + FS + "pkg1" + FS + "A.html", - "var methods = {" - }, - - {BUG_ID + FS + "pkg1" + FS + "A.html", - "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " + - "Methods</span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:show(1);\">" + - "Static Methods</a></span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" + - "Instance Methods</a></span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">" + - "Concrete Methods</a></span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t6\" class=\"tableTab\"><span><a href=\"javascript:show(32);\">" + - "Deprecated Methods</a></span><span class=\"tabEnd\"> </span></span>" + - "</caption>" - }, - - {BUG_ID + FS + "pkg1" + FS + "A.html", - "<tr id=\"i0\" class=\"altColor\">" - }, - - {BUG_ID + FS + "pkg1" + FS + "B.html", - "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " + - "Methods</span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" + - "Instance Methods</a></span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:show(4);\">" + - "Abstract Methods</a></span><span class=\"tabEnd\"> </span></span>" + - "</caption>" - }, - - {BUG_ID + FS + "pkg1" + FS + "D.html", - "var methods = {" - }, - - {BUG_ID + FS + "pkg1" + FS + "D.html", - "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " + - "Methods</span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" + - "Instance Methods</a></span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:show(4);\">" + - "Abstract Methods</a></span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">" + - "Concrete Methods</a></span><span class=\"tabEnd\"> </span></span>" + - "<span id=\"t6\" class=\"tableTab\"><span><a href=\"javascript:show(32);\">" + - "Deprecated Methods</a></span><span class=\"tabEnd\"> </span></span>" + - "</caption>" - }, - - {BUG_ID + FS + "pkg1" + FS + "D.html", - "<tr id=\"i0\" class=\"altColor\">" - }, - }; - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg1" + FS + "A.html", - "<caption><span>Methods</span><span class=\"tabEnd\"> </span>" + - "</caption>" - }, - - {BUG_ID + FS + "pkg1" + FS + "B.html", - "<caption><span>Methods</span><span class=\"tabEnd\"> </span>" + - "</caption>" - }, - - {BUG_ID + FS + "pkg1" + FS + "D.html", - "<caption><span>Methods</span><span class=\"tabEnd\"> </span>" + - "</caption>" - }, - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestMethodTypes tester = new TestMethodTypes(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.OK); + + checkOutput("pkg1/A.html", true, + "var methods = {", + "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " + + "Methods</span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:show(1);\">" + + "Static Methods</a></span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" + + "Instance Methods</a></span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">" + + "Concrete Methods</a></span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t6\" class=\"tableTab\"><span><a href=\"javascript:show(32);\">" + + "Deprecated Methods</a></span><span class=\"tabEnd\"> </span></span>" + + "</caption>", + "<tr id=\"i0\" class=\"altColor\">"); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg1/B.html", true, + "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " + + "Methods</span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" + + "Instance Methods</a></span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:show(4);\">" + + "Abstract Methods</a></span><span class=\"tabEnd\"> </span></span>" + + "</caption>"); + + checkOutput("pkg1/D.html", true, + "var methods = {", + "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " + + "Methods</span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" + + "Instance Methods</a></span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:show(4);\">" + + "Abstract Methods</a></span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">" + + "Concrete Methods</a></span><span class=\"tabEnd\"> </span></span>" + + "<span id=\"t6\" class=\"tableTab\"><span><a href=\"javascript:show(32);\">" + + "Deprecated Methods</a></span><span class=\"tabEnd\"> </span></span>" + + "</caption>", + "<tr id=\"i0\" class=\"altColor\">"); + + checkOutput("pkg1/A.html", false, + "<caption><span>Methods</span><span class=\"tabEnd\"> </span>" + + "</caption>"); + + checkOutput("pkg1/B.html", false, + "<caption><span>Methods</span><span class=\"tabEnd\"> </span>" + + "</caption>"); + + checkOutput("pkg1/D.html", false, + "<caption><span>Methods</span><span class=\"tabEnd\"> </span>" + + "</caption>"); } }
--- a/test/com/sun/javadoc/testModifier/TestModifier.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testModifier/TestModifier.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,46 +26,25 @@ * @bug 4210388 * @summary Javadoc declares interfaces to be "abstract". * @author jamieh - * @library ../lib/ + * @library ../lib * @build ModifierAbstract * @build JavadocTester - * @build TestModifier * @run main TestModifier */ public class TestModifier extends JavadocTester { - private static final String BUG_ID = "4210388"; - private static final String[][] TEST = NO_TEST; - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = - new String[] { - "-sourcepath", SRC_DIR, - "-docletpath", SRC_DIR, "-doclet", "ModifierAbstract", - SRC_DIR + FS + "Interface.java", SRC_DIR + FS + "Test.java"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestModifier tester = new TestModifier(); - if (run(tester, ARGS, TEST, NEGATED_TEST) != 0) { - throw new Error("Javadoc error occured during execution."); - } + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void test() { + javadoc("-sourcepath", testSrc, + "-docletpath", testSrc, + "-doclet", "ModifierAbstract", + testSrc("Interface.java"), testSrc("Test.java")); + checkExit(Exit.OK); } }
--- a/test/com/sun/javadoc/testNavigation/TestNavigation.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testNavigation/TestNavigation.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,65 +27,44 @@ * @summary Make sure the Next/Prev Class links iterate through all types. * Make sure the navagation is 2 columns, not 3. * @author jamieh - * @library ../lib/ - * @build JavadocTester TestNavigation + * @library ../lib + * @build JavadocTester * @run main TestNavigation */ public class TestNavigation extends JavadocTester { - //Test information. - private static final String BUG_ID = "4131628-4664607"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "A.html", "<li>Prev Class</li>"}, - {BUG_ID + FS + "pkg" + FS + "A.html", - "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Next Class</span></a>"}, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"typeNameLink\">Prev Class</span></a>"}, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Next Class</span></a>"}, - {BUG_ID + FS + "pkg" + FS + "E.html", - "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Prev Class</span></a>"}, - {BUG_ID + FS + "pkg" + FS + "E.html", - "<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"typeNameLink\">Next Class</span></a>"}, - {BUG_ID + FS + "pkg" + FS + "I.html", - "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Prev Class</span></a>"}, - {BUG_ID + FS + "pkg" + FS + "I.html", "<li>Next Class</li>"}, - // Test for 4664607 - {BUG_ID + FS + "pkg" + FS + "I.html", - "<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>" + NL + "<a name=\"navbar.top.firstrow\">" + NL + - "<!-- -->" + NL + "</a>"} - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestNavigation tester = new TestNavigation(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); + + checkOutput("pkg/A.html", true, + "<li>Prev Class</li>", + "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Next Class</span></a>"); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/C.html", true, + "<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"typeNameLink\">Prev Class</span></a>", + "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Next Class</span></a>"); + + checkOutput("pkg/E.html", true, + "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Prev Class</span></a>", + "<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"typeNameLink\">Next Class</span></a>"); + + checkOutput("pkg/I.html", true, + "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Prev Class</span></a>", + "<li>Next Class</li>", + // Test for 4664607 + "<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n" + + "<a name=\"navbar.top.firstrow\">\n" + + "<!-- -->\n" + + "</a>"); } }
--- a/test/com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,53 +26,28 @@ * @bug 6758050 8025633 * @summary Test HTML output for nested generic types. * @author bpatel - * @library ../lib/ - * @build JavadocTester TestNestedGenerics + * @library ../lib + * @build JavadocTester * @run main TestNestedGenerics */ public class TestNestedGenerics extends JavadocTester { - //Test information. - private static final String BUG_ID = "6758050"; + public static void main(String... args) throws Exception { + TestNestedGenerics tester = new TestNestedGenerics(); + tester.runTests(); + } - //Javadoc arguments. - private static final String[] ARGS = new String[]{ - "-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR, - "pkg" - }; + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "NestedGenerics.html", + checkOutput("pkg/NestedGenerics.html", true, "<div class=\"block\">Contains <a " + "href=\"../pkg/NestedGenerics.html#foo-java.util.Map-\"><code>foo" + - "(java.util.Map<A, java.util.Map<A, A>>)</code></a></div>" - } - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestNestedGenerics tester = new TestNestedGenerics(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); - } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + "(java.util.Map<A, java.util.Map<A, A>>)</code></a></div>"); } }
--- a/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,12 +25,11 @@ * @test * @summary Test for nested inline tags. * * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester * @build testtaglets.UnderlineTaglet * @build testtaglets.BoldTaglet * @build testtaglets.GreenTaglet - * @build TestNestedInlineTag * @run main TestNestedInlineTag */ @@ -38,7 +37,6 @@ * This should be green, underlined and bold (Class): {@underline {@bold {@green My test}}} . */ public class TestNestedInlineTag extends JavadocTester { - /** * This should be green, underlined and bold (Field): {@underline {@bold {@green My test}}} . */ @@ -54,60 +52,35 @@ */ public void method(){} - private static final String BUG_ID = "no-bug-id"; - private static final String[][] TEST = { - //Test nested inline tag in class description. - {BUG_ID + FS + "TestNestedInlineTag.html", - "This should be green, underlined and bold (Class): <u><b><font color=\"green\">My test</font></b></u>" - }, - - //Test nested inline tag in field description. - {BUG_ID + FS + "TestNestedInlineTag.html", - "This should be green, underlined and bold (Field): <u><b><font color=\"green\">My test</font></b></u>" - }, - - //Test nested inline tag in constructor description. - {BUG_ID + FS + "TestNestedInlineTag.html", - "This should be green, underlined and bold (Constructor): <u><b><font color=\"green\">My test</font></b></u>" - }, - - //Test nested inline tag in method description. - {BUG_ID + FS + "TestNestedInlineTag.html", - "This should be green, underlined and bold (Method): <u><b><font color=\"green\">My test</font></b></u>" - } - }; - - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - "-taglet", "testtaglets.UnderlineTaglet", - "-taglet", "testtaglets.BoldTaglet", - "-taglet", "testtaglets.GreenTaglet", - SRC_DIR + FS + "TestNestedInlineTag.java" - }; - /** * The entry point of the test. * @param args the array of command line arguments. + * @throws Exception if the test fails */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestNestedInlineTag tester = new TestNestedInlineTag(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-taglet", "testtaglets.UnderlineTaglet", + "-taglet", "testtaglets.BoldTaglet", + "-taglet", "testtaglets.GreenTaglet", + testSrc("TestNestedInlineTag.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("TestNestedInlineTag.html", true, + //Test nested inline tag in class description. + "This should be green, underlined and bold (Class): <u><b><font color=\"green\">My test</font></b></u>", + //Test nested inline tag in field description. + "This should be green, underlined and bold (Field): <u><b><font color=\"green\">My test</font></b></u>", + //Test nested inline tag in constructor description. + "This should be green, underlined and bold (Constructor): <u><b><font color=\"green\">My test</font></b></u>", + //Test nested inline tag in method description. + "This should be green, underlined and bold (Method): <u><b><font color=\"green\">My test</font></b></u>" + ); } }
--- a/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,726 +28,612 @@ * language features. Check the output to ensure that the new * language features are properly documented. * @author jamieh - * @library ../lib/ - * @build JavadocTester TestNewLanguageFeatures + * @library ../lib + * @build JavadocTester * @run main TestNewLanguageFeatures */ public class TestNewLanguageFeatures extends JavadocTester { - //Test information. - private static final String BUG_ID = "4789689-4905985-4927164-4827184-4993906"; + public static void main(String... args) throws Exception { + TestNewLanguageFeatures tester = new TestNewLanguageFeatures(); + tester.runTests(); + } - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-Xdoclint:none", "-d", BUG_ID, "-use", "-source", "1.5", "-sourcepath", SRC_DIR, "pkg", "pkg1", "pkg2" - }; + @Test + void test() { + javadoc("-Xdoclint:none", + "-d", "out", + "-use", "-sourcepath", + testSrc, + "pkg", "pkg1", "pkg2"); + checkExit(Exit.OK); + + checkEnums(); + checkTypeParameters(); + checkVarArgs(); + checkAnnotationTypeUsage(); + } - //Input for string search tests. - private static final String[][] TEST = - { - //================================= - // ENUM TESTING - //================================= - //Make sure enum header is correct. - {BUG_ID + FS + "pkg" + FS + "Coin.html", "Enum Coin</h2>"}, - //Make sure enum signature is correct. - {BUG_ID + FS + "pkg" + FS + "Coin.html", "<pre>public enum " + - "<span class=\"typeNameLabel\">Coin</span>" + NL + - "extends java.lang.Enum<<a href=\"../pkg/Coin.html\" " + - "title=\"enum in pkg\">Coin</a>></pre>" - }, - //Check for enum constant section - {BUG_ID + FS + "pkg" + FS + "Coin.html", "<caption><span>Enum Constants" + - "</span><span class=\"tabEnd\"> </span></caption>"}, - //Detail for enum constant - {BUG_ID + FS + "pkg" + FS + "Coin.html", - "<span class=\"memberNameLink\"><a href=\"../pkg/Coin.html#Dime\">Dime</a></span>"}, - //Automatically insert documentation for values() and valueOf(). - {BUG_ID + FS + "pkg" + FS + "Coin.html", - "Returns an array containing the constants of this enum type,"}, - {BUG_ID + FS + "pkg" + FS + "Coin.html", - "Returns the enum constant of this type with the specified name"}, - {BUG_ID + FS + "pkg" + FS + "Coin.html", "for (Coin c : Coin.values())"}, - {BUG_ID + FS + "pkg" + FS + "Coin.html", "Overloaded valueOf() method has correct documentation."}, - {BUG_ID + FS + "pkg" + FS + "Coin.html", "Overloaded values method has correct documentation."}, + //================================= + // ENUM TESTING + //================================= + void checkEnums() { + checkOutput("pkg/Coin.html", true, + // Make sure enum header is correct. + "Enum Coin</h2>", + // Make sure enum signature is correct. + "<pre>public enum " + + "<span class=\"typeNameLabel\">Coin</span>\n" + + "extends java.lang.Enum<<a href=\"../pkg/Coin.html\" " + + "title=\"enum in pkg\">Coin</a>></pre>", + // Check for enum constant section + "<caption><span>Enum Constants" + + "</span><span class=\"tabEnd\"> </span></caption>", + // Detail for enum constant + "<span class=\"memberNameLink\"><a href=\"../pkg/Coin.html#Dime\">Dime</a></span>", + // Automatically insert documentation for values() and valueOf(). + "Returns an array containing the constants of this enum type,", + "Returns the enum constant of this type with the specified name", + "for (Coin c : Coin.values())", + "Overloaded valueOf() method has correct documentation.", + "Overloaded values method has correct documentation."); + + // NO constructor section + checkOutput("pkg/Coin.html", false, + "<h3>Constructor Summary</h3>"); + } + + //================================= + // TYPE PARAMETER TESTING + //================================= - //================================= - // TYPE PARAMETER TESTING - //================================= - //Make sure the header is correct. - {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "Class TypeParameters<E></h2>"}, - //Check class type parameters section. - {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "<dt><span class=\"paramLabel\">Type Parameters:</span></dt>" + NL + "<dd><code>E</code> - " + - "the type parameter for this class."}, - //Type parameters in @see/@link - {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "<dl>" + NL + "<dt><span class=\"seeLabel\">See Also:</span></dt>" + NL + "<dd>" + - "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" + - "<code>TypeParameters</code></a></dd>" + NL + "</dl>"}, - //Method that uses class type parameter. - {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "(<a href=\"../pkg/TypeParameters.html\" title=\"type " + - "parameter in TypeParameters\">E</a> param)"}, - //Method type parameter section. - {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "<span class=\"paramLabel\">Type Parameters:</span></dt>" + NL + "<dd><code>T</code> - This is the first " + - "type parameter.</dd>" + NL + "<dd><code>V</code> - This is the second type " + - "parameter."}, - //Signature of method with type parameters - {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "public <T extends java.util.List,V> " + - "java.lang.String[] methodThatHasTypeParameters"}, - //Wildcard testing. - {BUG_ID + FS + "pkg" + FS + "Wildcards.html", - "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" + - "TypeParameters</a><? super java.lang.String> a"}, - {BUG_ID + FS + "pkg" + FS + "Wildcards.html", - "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" + - "TypeParameters</a><? extends java.lang.StringBuffer> b"}, - {BUG_ID + FS + "pkg" + FS + "Wildcards.html", - "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" + - "TypeParameters</a> c"}, - //Bad type parameter warnings. - {WARNING_OUTPUT, "warning - @param argument " + - "\"<BadClassTypeParam>\" is not a type parameter name."}, - {WARNING_OUTPUT, "warning - @param argument " + - "\"<BadMethodTypeParam>\" is not a type parameter name."}, - - //Signature of subclass that has type parameters. - {BUG_ID + FS + "pkg" + FS + "TypeParameterSubClass.html", - "<pre>public class <span class=\"typeNameLabel\">TypeParameterSubClass<T extends " + - "java.lang.String></span>" + NL + "extends " + - "<a href=\"../pkg/TypeParameterSuperClass.html\" title=\"class in pkg\">" + - "TypeParameterSuperClass</a><T></pre>"}, + void checkTypeParameters() { + checkOutput("pkg/TypeParameters.html", true, + // Make sure the header is correct. + "Class TypeParameters<E></h2>", + // Check class type parameters section. + "<dt><span class=\"paramLabel\">Type Parameters:</span></dt>\n" + + "<dd><code>E</code> - " + + "the type parameter for this class.", + // Type parameters in @see/@link + "<dl>\n" + + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" + + "<dd>" + + "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" + + "<code>TypeParameters</code></a></dd>\n" + + "</dl>", + // Method that uses class type parameter. + "(<a href=\"../pkg/TypeParameters.html\" title=\"type " + + "parameter in TypeParameters\">E</a> param)", + // Method type parameter section. + "<span class=\"paramLabel\">Type Parameters:</span></dt>\n" + + "<dd><code>T</code> - This is the first " + + "type parameter.</dd>\n" + + "<dd><code>V</code> - This is the second type " + + "parameter.", + // Signature of method with type parameters + "public <T extends java.util.List,V> " + + "java.lang.String[] methodThatHasTypeParameters"); - //Interface generic parameter substitution - //Signature of subclass that has type parameters. - {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "<dl>" + NL + "<dt>All Implemented Interfaces:</dt>" + NL + - "<dd><a href=\"../pkg/SubInterface.html\" title=\"interface in pkg\">" + - "SubInterface</a><E>, <a href=\"../pkg/SuperInterface.html\" " + - "title=\"interface in pkg\">SuperInterface</a><E></dd>" + NL + - "</dl>"}, - {BUG_ID + FS + "pkg" + FS + "SuperInterface.html", - "<dl>" + NL + "<dt>All Known Subinterfaces:</dt>" + NL + - "<dd><a href=\"../pkg/SubInterface.html\" title=\"interface in pkg\">" + - "SubInterface</a><V></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "pkg" + FS + "SubInterface.html", - "<dl>" + NL + "<dt>All Superinterfaces:</dt>" + NL + - "<dd><a href=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">" + - "SuperInterface</a><V></dd>" + NL + "</dl>"}, + checkOutput("pkg/Wildcards.html", true, + // Wildcard testing. + "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" + + "TypeParameters</a><? super java.lang.String> a", + "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" + + "TypeParameters</a><? extends java.lang.StringBuffer> b", + "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" + + "TypeParameters</a> c"); - //================================= - // VAR ARG TESTING - //================================= - {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int... i)"}, - {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int[][]... i)"}, - {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "-int:A...-"}, - {BUG_ID + FS + "pkg" + FS + "VarArgs.html", - "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" + - "TypeParameters</a>... t"}, + checkOutput(Output.WARNING, true, + // Bad type parameter warnings. + "warning - @param argument " + + "\"<BadClassTypeParam>\" is not a type parameter name.", + "warning - @param argument " + + "\"<BadMethodTypeParam>\" is not a type parameter name."); - //================================= - // ANNOTATION TYPE TESTING - //================================= - //Make sure the summary links are correct. - {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "<li>Summary: </li>" + NL + "<li>Field | </li>" + NL + - "<li><a href=\"#annotation.type.required.element.summary\">" + - "Required</a> | </li>" + NL + "<li>" + - "<a href=\"#annotation.type.optional.element.summary\">Optional</a></li>"}, - //Make sure the detail links are correct. - {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "<li>Detail: </li>" + NL + "<li>Field | </li>" + NL + - "<li><a href=\"#annotation.type.element.detail\">Element</a></li>"}, - //Make sure the heading is correct. - {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "Annotation Type AnnotationType</h2>"}, - //Make sure the signature is correct. - {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "public @interface <span class=\"memberNameLabel\">AnnotationType</span>"}, - //Make sure member summary headings are correct. - {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "<h3>Required Element Summary</h3>"}, - {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "<h3>Optional Element Summary</h3>"}, - //Make sure element detail heading is correct - {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "Element Detail"}, - //Make sure default annotation type value is printed when necessary. - {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "<dl>" + NL + "<dt>Default:</dt>" + NL + "<dd>\"unknown\"</dd>" + NL + - "</dl>"}, + // Signature of subclass that has type parameters. + checkOutput("pkg/TypeParameterSubClass.html", true, + "<pre>public class <span class=\"typeNameLabel\">TypeParameterSubClass<T extends " + + "java.lang.String></span>\n" + + "extends " + + "<a href=\"../pkg/TypeParameterSuperClass.html\" title=\"class in pkg\">" + + "TypeParameterSuperClass</a><T></pre>"); - //================================= - // ANNOTATION TYPE USAGE TESTING - //================================= - - //PACKAGE - {BUG_ID + FS + "pkg" + FS + "package-summary.html", - "<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>=\"Package Annotation\"," + NL + - " <a href=\"../pkg/AnnotationType.html#required--\">required</a>=1994)"}, + // Interface generic parameter substitution + // Signature of subclass that has type parameters. + checkOutput("pkg/TypeParameters.html", true, + "<dl>\n" + + "<dt>All Implemented Interfaces:</dt>\n" + + "<dd><a href=\"../pkg/SubInterface.html\" title=\"interface in pkg\">" + + "SubInterface</a><E>, <a href=\"../pkg/SuperInterface.html\" " + + "title=\"interface in pkg\">SuperInterface</a><E></dd>\n" + + "</dl>"); - //CLASS - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "<pre><a href=\"../pkg/AnnotationType.html\" " + - "title=\"annotation in pkg\">@AnnotationType</a>(" + - "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>" + - "=\"Class Annotation\"," + NL + - " <a href=\"../pkg/AnnotationType.html#required--\">" + - "required</a>=1994)" + NL + "public class <span class=\"typeNameLabel\">" + - "AnnotationTypeUsage</span>" + NL + "extends java.lang.Object</pre>"}, + checkOutput("pkg/SuperInterface.html", true, + "<dl>\n" + + "<dt>All Known Subinterfaces:</dt>\n" + + "<dd><a href=\"../pkg/SubInterface.html\" title=\"interface in pkg\">" + + "SubInterface</a><V></dd>\n" + + "</dl>"); + checkOutput("pkg/SubInterface.html", true, + "<dl>\n" + + "<dt>All Superinterfaces:</dt>\n" + + "<dd><a href=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">" + + "SuperInterface</a><V></dd>\n" + + "</dl>"); - //FIELD - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "<pre><a href=\"../pkg/AnnotationType.html\" " + - "title=\"annotation in pkg\">@AnnotationType</a>(" + - "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>" + - "=\"Field Annotation\"," + NL + - " <a href=\"../pkg/AnnotationType.html#required--\">" + - "required</a>=1994)" + NL + "public int field</pre>"}, - - //CONSTRUCTOR - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "<pre><a href=\"../pkg/AnnotationType.html\" " + - "title=\"annotation in pkg\">@AnnotationType</a>(" + - "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>" + - "=\"Constructor Annotation\"," + NL + - " <a href=\"../pkg/AnnotationType.html#required--\">" + - "required</a>=1994)" + NL + "public AnnotationTypeUsage()</pre>"}, - - //METHOD - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "<pre><a href=\"../pkg/AnnotationType.html\" " + - "title=\"annotation in pkg\">@AnnotationType</a>(" + - "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>" + - "=\"Method Annotation\"," + NL + - " <a href=\"../pkg/AnnotationType.html#required--\">" + - "required</a>=1994)" + NL + "public void method()</pre>"}, + //============================================================== + // Handle multiple bounds. + //============================================================== + checkOutput("pkg/MultiTypeParameters.html", true, + "public <T extends java.lang.Number & java.lang.Runnable> T foo(T t)"); - //METHOD PARAMS - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "<pre>public void methodWithParams(" + - "<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">" + - "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">" + - "optional</a>=\"Parameter Annotation\",<a " + - "href=\"../pkg/AnnotationType.html#required--\">required</a>=1994)" + NL + - " int documented," + NL + - " int undocmented)</pre>"}, - - //CONSTRUCTOR PARAMS - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "<pre>public AnnotationTypeUsage(<a " + - "href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">" + - "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">" + - "optional</a>=\"Constructor Param Annotation\",<a " + - "href=\"../pkg/AnnotationType.html#required--\">required</a>=1994)" + NL + - " int documented," + NL + - " int undocmented)</pre>"}, + //============================================================== + // Test Class-Use Documentation for Type Parameters. + //============================================================== + // ClassUseTest1: <T extends Foo & Foo2> + checkOutput("pkg2/class-use/Foo.html", true, + "<caption><span>Classes in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> with type parameters of " + + "type <a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">" + + "Foo</a></span><span class=\"tabEnd\"> </span></caption>", + "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest1.html\" " + + "title=\"class in pkg2\">ClassUseTest1</a><T extends " + + "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" + + "</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" + + "Foo2</a>></span></code> </td>", + "<caption><span>Methods in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> with type parameters of " + + "type <a href=\"../../pkg2/Foo.html\" title=\"class in " + + "pkg2\">Foo</a></span><span class=\"tabEnd\"> </span></caption>", + "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest1." + + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/" + + "ClassUseTest1.html#method-T-\">method</a></span>" + + "(T t)</code> </td>", + "<caption><span>Fields in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> with type parameters of " + + "type <a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">" + + "Foo</a></span><span class=\"tabEnd\"> </span></caption>", + "td class=\"colFirst\"><code><a href=\"../../pkg2/" + + "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>" + + "<<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\"" + + ">Foo</a>></code></td>" + ); - //================================= - // ANNOTATION TYPE USAGE TESTING (All Different Types). - //================================= - - //Integer - {BUG_ID + FS + "pkg1" + FS + "B.html", - "<a href=\"../pkg1/A.html#d--\">d</a>=3.14,"}, - - //Double - {BUG_ID + FS + "pkg1" + FS + "B.html", - "<a href=\"../pkg1/A.html#d--\">d</a>=3.14,"}, - - //Boolean - {BUG_ID + FS + "pkg1" + FS + "B.html", - "<a href=\"../pkg1/A.html#b--\">b</a>=true,"}, - - //String - {BUG_ID + FS + "pkg1" + FS + "B.html", - "<a href=\"../pkg1/A.html#s--\">s</a>=\"sigh\","}, + checkOutput("pkg2/class-use/ParamTest.html", true, + "<caption><span>Fields in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> declared as <a href=\"../" + + "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" + + "</a></span><span class=\"tabEnd\"> </span></caption>", + "<td class=\"colFirst\"><code><a href=\"../../pkg2/" + + "ParamTest.html\" title=\"class in pkg2\">ParamTest</a><<a " + + "href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</a" + + ">></code></td>" + ); - //Class - {BUG_ID + FS + "pkg1" + FS + "B.html", - "<a href=\"../pkg1/A.html#c--\">c</a>=<a href=\"../pkg2/Foo.html\" title=\"class in pkg2\">Foo.class</a>,"}, - - //Bounded Class - {BUG_ID + FS + "pkg1" + FS + "B.html", - "<a href=\"../pkg1/A.html#w--\">w</a>=<a href=\"../pkg/TypeParameterSubClass.html\" title=\"class in pkg\">TypeParameterSubClass.class</a>,"}, - - //Enum - {BUG_ID + FS + "pkg1" + FS + "B.html", - "<a href=\"../pkg1/A.html#e--\">e</a>=<a href=\"../pkg/Coin.html#Penny\">Penny</a>,"}, - - //Annotation Type - {BUG_ID + FS + "pkg1" + FS + "B.html", - "<a href=\"../pkg1/A.html#a--\">a</a>=<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>=\"foo\",<a href=\"../pkg/AnnotationType.html#required--\">required</a>=1994),"}, - - //String Array - {BUG_ID + FS + "pkg1" + FS + "B.html", - "<a href=\"../pkg1/A.html#sa--\">sa</a>={\"up\",\"down\"},"}, - - //Primitive - {BUG_ID + FS + "pkg1" + FS + "B.html", - "<a href=\"../pkg1/A.html#primitiveClassTest--\">primitiveClassTest</a>=boolean.class,"}, - - //XXX: Add array test case after this if fixed: - //5020899: Incorrect internal representation of class-valued annotation elements - - //Make sure that annotations are surrounded by <pre> and </pre> - {BUG_ID + FS + "pkg1" + FS + "B.html", - "<pre><a href=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</a>"}, - {BUG_ID + FS + "pkg1" + FS + "B.html", - "public interface <span class=\"typeNameLabel\">B</span></pre>"}, - - - //============================================================== - // Handle multiple bounds. - //============================================================== - {BUG_ID + FS + "pkg" + FS + "MultiTypeParameters.html", - "public <T extends java.lang.Number & java.lang.Runnable> T foo(T t)"}, + checkOutput("pkg2/class-use/Foo2.html", true, + "<caption><span>Classes in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> with type parameters of " + + "type <a href=\"../../pkg2/Foo2.html\" title=\"interface " + + "in pkg2\">Foo2</a></span><span class=\"tabEnd\"> " + + "</span></caption>", + "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest1.html\" " + + "title=\"class in pkg2\">ClassUseTest1</a><T extends " + + "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" + + "</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" + + "Foo2</a>></span></code> </td>", + "<caption><span>Methods in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> with type parameters of " + + "type <a href=\"../../pkg2/Foo2.html\" title=\"interface " + + "in pkg2\">Foo2</a></span><span class=\"tabEnd\"> " + + "</span></caption>", + "<td class=\"colLast\"><span class=\"typeNameLabel\">" + + "ClassUseTest1.</span><code><span class=\"memberNameLink\"><a href=\"../../" + + "pkg2/ClassUseTest1.html#method-T-\">method</a></span>" + + "(T t)</code> </td>" + ); - //============================================================== - // Test Class-Use Documenation for Type Parameters. - //============================================================== - - //ClassUseTest1: <T extends Foo & Foo2> - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html", - "<caption><span>Classes in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> with type parameters of " + - "type <a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">" + - "Foo</a></span><span class=\"tabEnd\"> </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html", - "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest1.html\" " + - "title=\"class in pkg2\">ClassUseTest1</a><T extends " + - "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" + - "</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" + - "Foo2</a>></span></code> </td>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html", - "<caption><span>Methods in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> with type parameters of " + - "type <a href=\"../../pkg2/Foo.html\" title=\"class in " + - "pkg2\">Foo</a></span><span class=\"tabEnd\"> </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html", - "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest1." + - "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/" + - "ClassUseTest1.html#method-T-\">method</a></span>" + - "(T t)</code> </td>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html", - "<caption><span>Fields in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> with type parameters of " + - "type <a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">" + - "Foo</a></span><span class=\"tabEnd\"> </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html", - "td class=\"colFirst\"><code><a href=\"../../pkg2/" + - "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>" + - "<<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\"" + - ">Foo</a>></code></td>" - }, + // ClassUseTest2: <T extends ParamTest<Foo3>> + checkOutput("pkg2/class-use/ParamTest.html", true, + "<caption><span>Classes in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> with type parameters of " + + "type <a href=\"../../pkg2/ParamTest.html\" title=\"class " + + "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">" + + " </span></caption>", + "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest2.html\" " + + "title=\"class in pkg2\">ClassUseTest2</a><T extends " + + "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" + + "ParamTest</a><<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" + + "Foo3</a>>></span></code> </td>", + "<caption><span>Methods in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> with type parameters of " + + "type <a href=\"../../pkg2/ParamTest.html\" title=\"class " + + "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">" + + " </span></caption>", + "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest2." + + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/" + + "ClassUseTest2.html#method-T-\">method</a></span>" + + "(T t)</code> </td>", + "<caption><span>Fields in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> declared as <a href=\"../" + + "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" + + "</a></span><span class=\"tabEnd\"> </span></caption>", + "<td class=\"colFirst\"><code><a href=\"../../pkg2/" + + "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>" + + "<<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">" + + "Foo</a>></code></td>", + "<caption><span>Methods in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> with type parameters of " + + "type <a href=\"../../pkg2/ParamTest.html\" title=\"class " + + "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">" + + " </span></caption>", + "<td class=\"colFirst\"><code><T extends <a href=\"../" + + "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" + + "</a><<a href=\"../../pkg2/Foo3.html\" title=\"class in " + + "pkg2\">Foo3</a>>><br><a href=\"../../pkg2/" + + "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>" + + "<<a href=\"../../pkg2/Foo3.html\" title=\"class in " + + "pkg2\">Foo3</a>></code></td>" + ); - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "<caption><span>Fields in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> declared as <a href=\"../" + - "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" + - "</a></span><span class=\"tabEnd\"> </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "<td class=\"colFirst\"><code><a href=\"../../pkg2/" + - "ParamTest.html\" title=\"class in pkg2\">ParamTest</a><<a " + - "href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</a" + - ">></code></td>" - }, + checkOutput("pkg2/class-use/Foo3.html", true, + "<caption><span>Classes in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> with type parameters of " + + "type <a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" + + "Foo3</a></span><span class=\"tabEnd\"> </span></caption>", + "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest2.html\" " + + "title=\"class in pkg2\">ClassUseTest2</a><T extends " + + "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" + + "ParamTest</a><<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" + + "Foo3</a>>></span></code> </td>", + "<caption><span>Methods in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> with type parameters of " + + "type <a href=\"../../pkg2/Foo3.html\" title=\"class in " + + "pkg2\">Foo3</a></span><span class=\"tabEnd\"> " + + "</span></caption>", + "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest2." + + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/" + + "ClassUseTest2.html#method-T-\">method</a></span>" + + "(T t)</code> </td>", + "<caption><span>Methods in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> that return types with " + + "arguments of type <a href=\"../../pkg2/Foo3.html\" title" + + "=\"class in pkg2\">Foo3</a></span><span class=\"tabEnd\">" + + " </span></caption>", + "<td class=\"colFirst\"><code><T extends <a href=\"../../" + + "pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</a><" + + "<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3" + + "</a>>><br><a href=\"../../pkg2/ParamTest.html\" " + + "title=\"class in pkg2\">ParamTest</a><<a href=\"../../pkg2/" + + "Foo3.html\" title=\"class in pkg2\">Foo3</a>></code></td>" + ); - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html", - "<caption><span>Classes in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> with type parameters of " + - "type <a href=\"../../pkg2/Foo2.html\" title=\"interface " + - "in pkg2\">Foo2</a></span><span class=\"tabEnd\"> " + - "</span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html", - "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest1.html\" " + - "title=\"class in pkg2\">ClassUseTest1</a><T extends " + - "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" + - "</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" + - "Foo2</a>></span></code> </td>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html", - "<caption><span>Methods in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> with type parameters of " + - "type <a href=\"../../pkg2/Foo2.html\" title=\"interface " + - "in pkg2\">Foo2</a></span><span class=\"tabEnd\"> " + - "</span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html", - "<td class=\"colLast\"><span class=\"typeNameLabel\">" + - "ClassUseTest1.</span><code><span class=\"memberNameLink\"><a href=\"../../" + - "pkg2/ClassUseTest1.html#method-T-\">method</a></span>" + - "(T t)</code> </td>" - }, + // ClassUseTest3: <T extends ParamTest2<List<? extends Foo4>>> + checkOutput("pkg2/class-use/ParamTest2.html", true, + "<caption><span>Classes in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> with type parameters of " + + "type <a href=\"../../pkg2/ParamTest2.html\" title=\"class " + + "in pkg2\">ParamTest2</a></span><span class=\"tabEnd\">" + + " </span></caption>", + "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3.html\" " + + "title=\"class in pkg2\">ClassUseTest3</a><T extends " + + "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" + + "ParamTest2</a><java.util.List<? extends " + + "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" + + "Foo4</a>>>></span></code> </td>", + "<caption><span>Methods in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> with type parameters of " + + "type <a href=\"../../pkg2/ParamTest2.html\" title=\"class " + + "in pkg2\">ParamTest2</a></span><span class=\"tabEnd\">" + + " </span></caption>", + "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest3" + + ".</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3." + + "html#method-T-\">method</a></span>(T t)</code> </td>", + "<td class=\"colFirst\"><code><T extends <a href=\"../" + + "../pkg2/ParamTest2.html\" title=\"class in pkg2\">" + + "ParamTest2</a><java.util.List<? extends <a href=\".." + + "/../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</a>>" + + ">><br><a href=\"../../pkg2/ParamTest2.html\" " + + "title=\"class in pkg2\">ParamTest2</a><java.util.List" + + "<? extends <a href=\"../../pkg2/Foo4.html\" title=\"" + + "class in pkg2\">Foo4</a>>></code></td>" + ); - //ClassUseTest2: <T extends ParamTest<Foo3>> - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "<caption><span>Classes in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> with type parameters of " + - "type <a href=\"../../pkg2/ParamTest.html\" title=\"class " + - "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">" + - " </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest2.html\" " + - "title=\"class in pkg2\">ClassUseTest2</a><T extends " + - "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" + - "ParamTest</a><<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" + - "Foo3</a>>></span></code> </td>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "<caption><span>Methods in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> with type parameters of " + - "type <a href=\"../../pkg2/ParamTest.html\" title=\"class " + - "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">" + - " </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest2." + - "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/" + - "ClassUseTest2.html#method-T-\">method</a></span>" + - "(T t)</code> </td>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "<caption><span>Fields in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> declared as <a href=\"../" + - "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" + - "</a></span><span class=\"tabEnd\"> </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "<td class=\"colFirst\"><code><a href=\"../../pkg2/" + - "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>" + - "<<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">" + - "Foo</a>></code></td>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "<caption><span>Methods in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> with type parameters of " + - "type <a href=\"../../pkg2/ParamTest.html\" title=\"class " + - "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">" + - " </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "<td class=\"colFirst\"><code><T extends <a href=\"../" + - "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" + - "</a><<a href=\"../../pkg2/Foo3.html\" title=\"class in " + - "pkg2\">Foo3</a>>><br><a href=\"../../pkg2/" + - "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>" + - "<<a href=\"../../pkg2/Foo3.html\" title=\"class in " + - "pkg2\">Foo3</a>></code></td>" - }, + checkOutput("pkg2/class-use/Foo4.html", true, + "<caption><span>Classes in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> with type parameters of " + + "type <a href=\"../../pkg2/Foo4.html\" title=\"class in " + + "pkg2\">Foo4</a></span><span class=\"tabEnd\"> " + + "</span></caption>", + "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3.html\" " + + "title=\"class in pkg2\">ClassUseTest3</a><T extends " + + "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" + + "ParamTest2</a><java.util.List<? extends " + + "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" + + "Foo4</a>>>></span></code> </td>", + "<caption><span>Methods in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> with type parameters of " + + "type <a href=\"../../pkg2/Foo4.html\" title=\"class in " + + "pkg2\">Foo4</a></span><span class=\"tabEnd\"> </span></caption>", + "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest3." + + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3." + + "html#method-T-\">method</a></span>(T t)</code>" + + " </td>", + "<caption><span>Methods in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> that return types with " + + "arguments of type <a href=\"../../pkg2/Foo4.html\" " + + "title=\"class in pkg2\">Foo4</a></span><span class=\"" + + "tabEnd\"> </span></caption>", + "<td class=\"colFirst\"><code><T extends <a href=\"../" + + "../pkg2/ParamTest2.html\" title=\"class in pkg2\">" + + "ParamTest2</a><java.util.List<? extends <a href=\".." + + "/../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</a>>" + + ">><br><a href=\"../../pkg2/ParamTest2.html\" " + + "title=\"class in pkg2\">ParamTest2</a><java.util.List" + + "<? extends <a href=\"../../pkg2/Foo4.html\" title=\"" + + "class in pkg2\">Foo4</a>>></code></td>" + ); - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html", - "<caption><span>Classes in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> with type parameters of " + - "type <a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" + - "Foo3</a></span><span class=\"tabEnd\"> </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html", - "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest2.html\" " + - "title=\"class in pkg2\">ClassUseTest2</a><T extends " + - "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" + - "ParamTest</a><<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" + - "Foo3</a>>></span></code> </td>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html", - "<caption><span>Methods in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> with type parameters of " + - "type <a href=\"../../pkg2/Foo3.html\" title=\"class in " + - "pkg2\">Foo3</a></span><span class=\"tabEnd\"> " + - "</span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html", - "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest2." + - "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/" + - "ClassUseTest2.html#method-T-\">method</a></span>" + - "(T t)</code> </td>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html", - "<caption><span>Methods in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> that return types with " + - "arguments of type <a href=\"../../pkg2/Foo3.html\" title" + - "=\"class in pkg2\">Foo3</a></span><span class=\"tabEnd\">" + - " </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html", - "<td class=\"colFirst\"><code><T extends <a href=\"../../" + - "pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</a><" + - "<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3" + - "</a>>><br><a href=\"../../pkg2/ParamTest.html\" " + - "title=\"class in pkg2\">ParamTest</a><<a href=\"../../pkg2/" + - "Foo3.html\" title=\"class in pkg2\">Foo3</a>></code></td>" - }, + // Type parameters in constructor and method args + checkOutput("pkg2/class-use/Foo4.html", true, + "<caption><span>Method parameters in <a href=\"../../pkg2/" + + "package-summary.html\">pkg2</a> with type arguments of " + + "type <a href=\"../../pkg2/Foo4.html\" title=\"class in " + + "pkg2\">Foo4</a></span><span class=\"tabEnd\"> " + + "</span></caption>\n" + + "<tr>\n" + + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" + + "<th class=\"colLast\" scope=\"col\">Method and Description</th>\n" + + "</tr>\n" + + "<tbody>\n" + + "<tr class=\"altColor\">\n" + + "<td class=\"colFirst\"><code>void</code></td>\n" + + "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest3." + + "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3." + + "html#method-java.util.Set-\">method</a></span>(java." + + "util.Set<<a href=\"../../pkg2/Foo4.html\" title=\"" + + "class in pkg2\">Foo4</a>> p)</code> </td>\n" + + "</tr>\n" + + "</tbody>", + "<caption><span>Constructor parameters in <a href=\"../../" + + "pkg2/package-summary.html\">pkg2</a> with type arguments " + + "of type <a href=\"../../pkg2/Foo4.html\" title=\"class in " + + "pkg2\">Foo4</a></span><span class=\"tabEnd\"> " + + "</span></caption>" + ); + + //================================= + // TYPE PARAMETER IN INDEX + //================================= + checkOutput("index-all.html", true, + "<span class=\"memberNameLink\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">" + + "method(Vector<Object>)</a></span>" + ); + + // TODO: duplicate of previous case; left in delibarately for now to simplify comparison testing + //================================= + // TYPE PARAMETER IN INDEX + //================================= + checkOutput("index-all.html", true, + "<span class=\"memberNameLink\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">" + + "method(Vector<Object>)</a></span>" + ); - //ClassUseTest3: <T extends ParamTest2<List<? extends Foo4>>> - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html", - "<caption><span>Classes in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> with type parameters of " + - "type <a href=\"../../pkg2/ParamTest2.html\" title=\"class " + - "in pkg2\">ParamTest2</a></span><span class=\"tabEnd\">" + - " </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html", - "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3.html\" " + - "title=\"class in pkg2\">ClassUseTest3</a><T extends " + - "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" + - "ParamTest2</a><java.util.List<? extends " + - "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" + - "Foo4</a>>>></span></code> </td>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html", - "<caption><span>Methods in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> with type parameters of " + - "type <a href=\"../../pkg2/ParamTest2.html\" title=\"class " + - "in pkg2\">ParamTest2</a></span><span class=\"tabEnd\">" + - " </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html", - "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest3" + - ".</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3." + - "html#method-T-\">method</a></span>(T t)</code> </td>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html", - "<td class=\"colFirst\"><code><T extends <a href=\"../" + - "../pkg2/ParamTest2.html\" title=\"class in pkg2\">" + - "ParamTest2</a><java.util.List<? extends <a href=\".." + - "/../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</a>>" + - ">><br><a href=\"../../pkg2/ParamTest2.html\" " + - "title=\"class in pkg2\">ParamTest2</a><java.util.List" + - "<? extends <a href=\"../../pkg2/Foo4.html\" title=\"" + - "class in pkg2\">Foo4</a>>></code></td>" - }, + // No type parameters in class frame. + checkOutput("allclasses-frame.html", false, + "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" + + "TypeParameters</a><<a href=\"../pkg/TypeParameters.html\" " + + "title=\"type parameter in TypeParameters\">E</a>>" + ); + + } + + //================================= + // VAR ARG TESTING + //================================= + void checkVarArgs() { + checkOutput("pkg/VarArgs.html", true, + "(int... i)", + "(int[][]... i)", + "-int:A...-", + "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" + + "TypeParameters</a>... t"); + } - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "<caption><span>Classes in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> with type parameters of " + - "type <a href=\"../../pkg2/Foo4.html\" title=\"class in " + - "pkg2\">Foo4</a></span><span class=\"tabEnd\"> " + - "</span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3.html\" " + - "title=\"class in pkg2\">ClassUseTest3</a><T extends " + - "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" + - "ParamTest2</a><java.util.List<? extends " + - "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" + - "Foo4</a>>>></span></code> </td>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "<caption><span>Methods in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> with type parameters of " + - "type <a href=\"../../pkg2/Foo4.html\" title=\"class in " + - "pkg2\">Foo4</a></span><span class=\"tabEnd\"> </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest3." + - "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3." + - "html#method-T-\">method</a></span>(T t)</code>" + - " </td>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "<caption><span>Methods in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> that return types with " + - "arguments of type <a href=\"../../pkg2/Foo4.html\" " + - "title=\"class in pkg2\">Foo4</a></span><span class=\"" + - "tabEnd\"> </span></caption>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "<td class=\"colFirst\"><code><T extends <a href=\"../" + - "../pkg2/ParamTest2.html\" title=\"class in pkg2\">" + - "ParamTest2</a><java.util.List<? extends <a href=\".." + - "/../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</a>>" + - ">><br><a href=\"../../pkg2/ParamTest2.html\" " + - "title=\"class in pkg2\">ParamTest2</a><java.util.List" + - "<? extends <a href=\"../../pkg2/Foo4.html\" title=\"" + - "class in pkg2\">Foo4</a>>></code></td>" - }, + //================================= + // ANNOTATION TYPE TESTING + //================================= + void checkAnnotationTypes() { + checkOutput("pkg/AnnotationType.html", true, + // Make sure the summary links are correct. + "<li>Summary: </li>\n" + + "<li>Field | </li>\n" + + "<li><a href=\"#annotation.type.required.element.summary\">" + + "Required</a> | </li>\n" + + "<li>" + + "<a href=\"#annotation.type.optional.element.summary\">Optional</a></li>", + // Make sure the detail links are correct. + "<li>Detail: </li>\n" + + "<li>Field | </li>\n" + + "<li><a href=\"#annotation.type.element.detail\">Element</a></li>", + // Make sure the heading is correct. + "Annotation Type AnnotationType</h2>", + // Make sure the signature is correct. + "public @interface <span class=\"memberNameLabel\">AnnotationType</span>", + // Make sure member summary headings are correct. + "<h3>Required Element Summary</h3>", + "<h3>Optional Element Summary</h3>", + // Make sure element detail heading is correct + "Element Detail", + // Make sure default annotation type value is printed when necessary. + "<dl>\n" + + "<dt>Default:</dt>\n" + + "<dd>\"unknown\"</dd>\n" + + "</dl>"); + } + + //================================= + // ANNOTATION TYPE USAGE TESTING + //================================= + void checkAnnotationTypeUsage() { + checkOutput("pkg/package-summary.html", true, + // PACKAGE + "<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>=\"Package Annotation\",\n" + + " <a href=\"../pkg/AnnotationType.html#required--\">required</a>=1994)"); - //Type parameters in constructor and method args - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "<caption><span>Method parameters in <a href=\"../../pkg2/" + - "package-summary.html\">pkg2</a> with type arguments of " + - "type <a href=\"../../pkg2/Foo4.html\" title=\"class in " + - "pkg2\">Foo4</a></span><span class=\"tabEnd\"> " + - "</span></caption>" + NL + "<tr>" + NL + - "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL + - "<th class=\"colLast\" scope=\"col\">Method and Description</th>" + NL + - "</tr>" + NL + "<tbody>" + NL + "<tr class=\"altColor\">" + NL + - "<td class=\"colFirst\"><code>void</code></td>" + NL + - "<td class=\"colLast\"><span class=\"typeNameLabel\">ClassUseTest3." + - "</span><code><span class=\"memberNameLink\"><a href=\"../../pkg2/ClassUseTest3." + - "html#method-java.util.Set-\">method</a></span>(java." + - "util.Set<<a href=\"../../pkg2/Foo4.html\" title=\"" + - "class in pkg2\">Foo4</a>> p)</code> </td>" + NL + - "</tr>" + NL + "</tbody>" - }, - {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "<caption><span>Constructor parameters in <a href=\"../../" + - "pkg2/package-summary.html\">pkg2</a> with type arguments " + - "of type <a href=\"../../pkg2/Foo4.html\" title=\"class in " + - "pkg2\">Foo4</a></span><span class=\"tabEnd\"> " + - "</span></caption>" - }, - - //================================= - // Annotatation Type Usage - //================================= - {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html", - "<caption><span>Packages with annotations of type <a href=\"" + - "../../pkg/AnnotationType.html\" title=\"annotation in pkg\">" + - "AnnotationType</a></span><span class=\"tabEnd\"> " + - "</span></caption>" - }, - - {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html", - "<caption><span>Classes in <a href=\"../../pkg/" + - "package-summary.html\">pkg</a> with annotations of type " + - "<a href=\"../../pkg/AnnotationType.html\" title=\"" + - "annotation in pkg\">AnnotationType</a></span><span class" + - "=\"tabEnd\"> </span></caption>" - }, - - {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html", - "<caption><span>Fields in <a href=\"../../pkg/" + - "package-summary.html\">pkg</a> with annotations of type " + - "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " + - "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">" + - " </span></caption>" - }, + checkOutput("pkg/AnnotationTypeUsage.html", true, + // CLASS + "<pre><a href=\"../pkg/AnnotationType.html\" " + + "title=\"annotation in pkg\">@AnnotationType</a>(" + + "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>" + + "=\"Class Annotation\",\n" + + " <a href=\"../pkg/AnnotationType.html#required--\">" + + "required</a>=1994)\n" + + "public class <span class=\"typeNameLabel\">" + + "AnnotationTypeUsage</span>\n" + + "extends java.lang.Object</pre>", + // FIELD + "<pre><a href=\"../pkg/AnnotationType.html\" " + + "title=\"annotation in pkg\">@AnnotationType</a>(" + + "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>" + + "=\"Field Annotation\",\n" + + " <a href=\"../pkg/AnnotationType.html#required--\">" + + "required</a>=1994)\n" + + "public int field</pre>", + // CONSTRUCTOR + "<pre><a href=\"../pkg/AnnotationType.html\" " + + "title=\"annotation in pkg\">@AnnotationType</a>(" + + "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>" + + "=\"Constructor Annotation\",\n" + + " <a href=\"../pkg/AnnotationType.html#required--\">" + + "required</a>=1994)\n" + + "public AnnotationTypeUsage()</pre>", + // METHOD + "<pre><a href=\"../pkg/AnnotationType.html\" " + + "title=\"annotation in pkg\">@AnnotationType</a>(" + + "<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>" + + "=\"Method Annotation\",\n" + + " <a href=\"../pkg/AnnotationType.html#required--\">" + + "required</a>=1994)\n" + + "public void method()</pre>", + // METHOD PARAMS + "<pre>public void methodWithParams(" + + "<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">" + + "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">" + + "optional</a>=\"Parameter Annotation\",<a " + + "href=\"../pkg/AnnotationType.html#required--\">required</a>=1994)\n" + + " int documented,\n" + + " int undocmented)</pre>", + // CONSTRUCTOR PARAMS + "<pre>public AnnotationTypeUsage(<a " + + "href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">" + + "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">" + + "optional</a>=\"Constructor Param Annotation\",<a " + + "href=\"../pkg/AnnotationType.html#required--\">required</a>=1994)\n" + + " int documented,\n" + + " int undocmented)</pre>"); - {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html", - "<caption><span>Methods in <a href=\"../../pkg/" + - "package-summary.html\">pkg</a> with annotations of type " + - "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " + - "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">" + - " </span></caption>" - }, - - {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html", - "<caption><span>Method parameters in <a href=\"../../pkg/" + - "package-summary.html\">pkg</a> with annotations of type " + - "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " + - "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">" + - " </span></caption>" - }, - - {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html", - "<caption><span>Constructors in <a href=\"../../pkg/" + - "package-summary.html\">pkg</a> with annotations of type " + - "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " + - "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">" + - " </span></caption>" - }, - - {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html", - "<caption><span>Constructor parameters in <a href=\"../../" + - "pkg/package-summary.html\">pkg</a> with annotations of " + - "type <a href=\"../../pkg/AnnotationType.html\" title=\"" + - "annotation in pkg\">AnnotationType</a></span><span class=\"" + - "tabEnd\"> </span></caption>" - }, - - //================================= - // TYPE PARAMETER IN INDEX - //================================= - {BUG_ID + FS + "index-all.html", - "<span class=\"memberNameLink\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">" + - "method(Vector<Object>)</a></span>" - }, - //================================= - // TYPE PARAMETER IN INDEX - //================================= - {BUG_ID + FS + "index-all.html", - "<span class=\"memberNameLink\"><a href=\"pkg2/Foo.html#method-java.util.Vector-\">" + - "method(Vector<Object>)</a></span>" - }, - }; - private static final String[][] NEGATED_TEST = { + //================================= + // Annotatation Type Usage //================================= - // ENUM TESTING - //================================= - //NO constructor section - {BUG_ID + FS + "pkg" + FS + "Coin.html", "<h3>Constructor Summary</h3>"}, - //================================= - // TYPE PARAMETER TESTING - //================================= - //No type parameters in class frame. - {BUG_ID + FS + "allclasses-frame.html", - "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" + - "TypeParameters</a><<a href=\"../pkg/TypeParameters.html\" " + - "title=\"type parameter in TypeParameters\">E</a>>" - }, + checkOutput("pkg/class-use/AnnotationType.html", true, + "<caption><span>Packages with annotations of type <a href=\"" + + "../../pkg/AnnotationType.html\" title=\"annotation in pkg\">" + + "AnnotationType</a></span><span class=\"tabEnd\"> " + + "</span></caption>", + "<caption><span>Classes in <a href=\"../../pkg/" + + "package-summary.html\">pkg</a> with annotations of type " + + "<a href=\"../../pkg/AnnotationType.html\" title=\"" + + "annotation in pkg\">AnnotationType</a></span><span class" + + "=\"tabEnd\"> </span></caption>", + "<caption><span>Fields in <a href=\"../../pkg/" + + "package-summary.html\">pkg</a> with annotations of type " + + "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " + + "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">" + + " </span></caption>", + "<caption><span>Methods in <a href=\"../../pkg/" + + "package-summary.html\">pkg</a> with annotations of type " + + "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " + + "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">" + + " </span></caption>", + "<caption><span>Method parameters in <a href=\"../../pkg/" + + "package-summary.html\">pkg</a> with annotations of type " + + "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " + + "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">" + + " </span></caption>", + "<caption><span>Constructors in <a href=\"../../pkg/" + + "package-summary.html\">pkg</a> with annotations of type " + + "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " + + "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">" + + " </span></caption>", + "<caption><span>Constructor parameters in <a href=\"../../" + + "pkg/package-summary.html\">pkg</a> with annotations of " + + "type <a href=\"../../pkg/AnnotationType.html\" title=\"" + + "annotation in pkg\">AnnotationType</a></span><span class=\"" + + "tabEnd\"> </span></caption>" + ); //============================================================== // ANNOTATION TYPE USAGE TESTING (When @Documented is omitted) //=============================================================== - - //CLASS - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Class Annotation\"," + NL + - " <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL + - "public class <span class=\"typeNameLabel\">AnnotationTypeUsage</span></dt><dt>extends java.lang.Object</dt>"}, - - //FIELD - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Field Annotation\"," + NL + - " <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL + - "public int <span class=\"memberNameLabel\">field</span>"}, - - //CONSTRUCTOR - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Constructor Annotation\"," + NL + - " <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL + - "public <span class=\"typeNameLabel\">AnnotationTypeUsage</span>()"}, - - //METHOD - {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", - "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Method Annotation\"," + NL + - " <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL + - "public void <span class=\"memberNameLabel\">method</span>()"}, + checkOutput("pkg/AnnotationTypeUsage.html", false, + // CLASS + "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Class Annotation\",\n" + + " <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n" + + "public class <span class=\"typeNameLabel\">AnnotationTypeUsage</span></dt><dt>extends java.lang.Object</dt>", + // FIELD + "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Field Annotation\",\n" + + " <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n" + + "public int <span class=\"memberNameLabel\">field</span>", + // CONSTRUCTOR + "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Constructor Annotation\",\n" + + " <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n" + + "public <span class=\"typeNameLabel\">AnnotationTypeUsage</span>()", + // METHOD + "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Method Annotation\",\n" + + " <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)\n" + + "public void <span class=\"memberNameLabel\">method</span>()"); //================================= // Make sure annotation types do not // trigger this warning. //================================= - {WARNING_OUTPUT, - "Internal error: package sets don't match: [] with: null" - }, - }; + checkOutput(Output.WARNING, false, + "Internal error: package sets don't match: [] with: null"); - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestNewLanguageFeatures tester = new TestNewLanguageFeatures(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + //================================= + // ANNOTATION TYPE USAGE TESTING (All Different Types). + //================================= + checkOutput("pkg1/B.html", true, + // Integer + "<a href=\"../pkg1/A.html#d--\">d</a>=3.14,", + // Double + "<a href=\"../pkg1/A.html#d--\">d</a>=3.14,", + // Boolean + "<a href=\"../pkg1/A.html#b--\">b</a>=true,", + // String + "<a href=\"../pkg1/A.html#s--\">s</a>=\"sigh\",", + // Class + "<a href=\"../pkg1/A.html#c--\">c</a>=<a href=\"../pkg2/Foo.html\" title=\"class in pkg2\">Foo.class</a>,", + // Bounded Class + "<a href=\"../pkg1/A.html#w--\">w</a>=<a href=\"../pkg/TypeParameterSubClass.html\" title=\"class in pkg\">TypeParameterSubClass.class</a>,", + // Enum + "<a href=\"../pkg1/A.html#e--\">e</a>=<a href=\"../pkg/Coin.html#Penny\">Penny</a>,", + // Annotation Type + "<a href=\"../pkg1/A.html#a--\">a</a>=<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional--\">optional</a>=\"foo\",<a href=\"../pkg/AnnotationType.html#required--\">required</a>=1994),", + // String Array + "<a href=\"../pkg1/A.html#sa--\">sa</a>={\"up\",\"down\"},", + // Primitive + "<a href=\"../pkg1/A.html#primitiveClassTest--\">primitiveClassTest</a>=boolean.class,"); + + // XXX: Add array test case after this if fixed: + //5020899: Incorrect internal representation of class-valued annotation elements + // Make sure that annotations are surrounded by <pre> and </pre> + checkOutput("pkg1/B.html", true, + "<pre><a href=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</a>", + "public interface <span class=\"typeNameLabel\">B</span></pre>"); + } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } }
--- a/test/com/sun/javadoc/testNoPackagesFile/TestNoPackagesFile.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testNoPackagesFile/TestNoPackagesFile.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,48 +27,26 @@ * @summary Verify that packages.html is no longer generated since it is no * longer used. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestNoPackagesFile * @run main TestNoPackagesFile */ public class TestNoPackagesFile extends JavadocTester { - //Test information. - private static final String BUG_ID = "4475679"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - SRC_DIR + FS + "C.java" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestNoPackagesFile tester = new TestNoPackagesFile(); - run(tester, ARGS, NO_TEST, NO_TEST); - if ((new java.io.File(BUG_ID + FS + "packages.html")).exists()) { - throw new Error("Test Fails: packages file should not be " + "generated anymore."); - } else { - System.out.println("Test passes: packages.html not found."); - } + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + testSrc("C.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + // packages.html file should not be generated anymore. + checkFiles(false, "packages.html"); } }
--- a/test/com/sun/javadoc/testNonFrameWarning/TestNonFrameWarning.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testNonFrameWarning/TestNonFrameWarning.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,46 +26,28 @@ * @bug 7001086 * @summary Test Non-frame warning. * @author Bhavesh Patel - * @library ../lib/ - * @build JavadocTester TestNonFrameWarning + * @library ../lib + * @build JavadocTester * @run main TestNonFrameWarning */ public class TestNonFrameWarning extends JavadocTester { - private static final String BUG_ID = "7001086"; - private static final String[][] TEST = { - {BUG_ID + FS + "index.html", - "<p>This document is designed to be viewed using the frames feature. " + - "If you see this message, you are using a non-frame-capable web client. " + - "Link to <a href=\"pkg/package-summary.html\">Non-frame version</a>.</p>" - } - }; - private static final String[] ARGS = new String[]{ - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestNonFrameWarning tester = new TestNonFrameWarning(); - run(tester, ARGS, TEST, NO_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("index.html", true, + "<p>This document is designed to be viewed using the frames feature. " + + "If you see this message, you are using a non-frame-capable web client. " + + "Link to <a href=\"pkg/package-summary.html\">Non-frame version</a>.</p>"); } }
--- a/test/com/sun/javadoc/testNotifications/TestNotifications.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testNotifications/TestNotifications.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,65 +28,43 @@ * be created. * Make sure classname is not include in javadoc usage message. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestNotifications * @run main TestNotifications */ public class TestNotifications extends JavadocTester { - //Test information. - private static final String BUG_ID = "4657239"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" - }; - - private static final String[] ARGS2 = new String[] { - "-help" - }; + public static void main(String... args) throws Exception { + TestNotifications tester = new TestNotifications(); + tester.runTests(); + } - //Input for string search tests. - private static final String[][] TEST = { - {NOTICE_OUTPUT, "Creating destination directory: \"4657239"} - }; - private static final String[][] NEGATED_TEST = { - {NOTICE_OUTPUT, "Creating destination directory: \"4657239"} - }; + @Test + void test1() { + String outDir = "out"; - private static final String[][] NEGATED_TEST2 = { - {NOTICE_OUTPUT, "[classnames]"} - }; + // Notify that the destination directory must be created. + javadoc("-d", outDir, "-sourcepath", testSrc, "pkg"); + checkExit(Exit.OK); + checkOutput(Output.NOTICE, true, + "Creating destination directory: \"" + outDir); - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestNotifications tester = new TestNotifications(); - // Notify that the destination directory must be created. - run(tester, ARGS, TEST, NO_TEST); // No need to notify that the destination must be created because // it already exists. - run(tester, ARGS, NO_TEST, NEGATED_TEST); - //Make sure classname is not include in javadoc usage message. - run(tester, ARGS2, NO_TEST, NEGATED_TEST2); - tester.printSummary(); + setOutputDirectoryCheck(DirectoryCheck.NONE); + javadoc("-d", outDir, "-sourcepath", testSrc, "pkg"); + checkExit(Exit.OK); + checkOutput(Output.NOTICE, false, + "Creating destination directory: \"" + outDir); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void test() { + //Make sure classname is not include in javadoc usage message. + setOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES); + javadoc("-help"); + checkOutput(Output.NOTICE, false, + "[classnames]"); } }
--- a/test/com/sun/javadoc/testOptions/TestOptions.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testOptions/TestOptions.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,53 +26,30 @@ * @bug 4749567 * @summary Test the output for -header and -footer options. * @author Bhavesh Patel - * @library ../lib/ - * @build JavadocTester TestOptions + * @library ../lib + * @build JavadocTester * @run main TestOptions */ public class TestOptions extends JavadocTester { - //Test information. - private static final String BUG_ID = "4749567"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-header", "Test header", "-footer", "Test footer", - "-sourcepath", SRC_DIR, "pkg" - }; - - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "package-summary.html", - "<div class=\"aboutLanguage\">Test header</div>"}, - {BUG_ID + FS + "pkg" + FS + "package-summary.html", - "<div class=\"aboutLanguage\">Test footer</div>"} - }; - - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestOptions tester = new TestOptions(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-header", "Test header", + "-footer", "Test footer", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/package-summary.html", true, + "<div class=\"aboutLanguage\">Test header</div>", + "<div class=\"aboutLanguage\">Test footer</div>"); } }
--- a/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,76 +27,54 @@ * @summary Make sure that all inherited methods from multiple extended * interfaces are documented * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestMultiInheritence * @run main TestMultiInheritence */ +// TODO: should be TestMultiInheritance public class TestMultiInheritence extends JavadocTester { - //Test information. - private static final String BUG_ID = "4933335"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg3" - }; - - //Method foo() is inherited from BOTH I2 and I3 - private static final String[][] TEST = { - {BUG_ID + FS + "pkg3" + FS + "I1.html", - "Methods inherited from interface pkg3." + - "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">" + - "I2</a>"}, - {BUG_ID + FS + "pkg3" + FS +"I1.html", - "Methods inherited from interface pkg3." + - "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">" + - "I3</a>"}, - {BUG_ID + FS + "pkg3" + FS + "I0.html", - "Methods inherited from interface pkg3." + - "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">" + - "I2</a>"}, - {BUG_ID + FS + "pkg3" + FS +"I0.html", - "Methods inherited from interface pkg3." + - "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">" + - "I3</a>"}, - }; - - //Method foo() is NOT inherited from I4 because it is overriden by - //I3. - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg3" + FS + "I1.html", - "Methods inherited from interface pkg3." + - "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">" + - "I4</a>"}, - {BUG_ID + FS + "pkg3" + FS + "I0.html", - "Methods inherited from interface pkg3." + - "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">" + - "I4</a>"}, - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestMultiInheritence tester = new TestMultiInheritence(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg3"); + checkExit(Exit.OK); + + // Method foo() is inherited from BOTH I2 and I3 + + checkOutput("pkg3/I1.html", true, + "Methods inherited from interface pkg3." + + "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">" + + "I2</a>", + "Methods inherited from interface pkg3." + + "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">" + + "I3</a>"); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg3/I0.html", true, + "Methods inherited from interface pkg3." + + "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">" + + "I2</a>", + "Methods inherited from interface pkg3." + + "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">" + + "I3</a>"); + + // Method foo() is NOT inherited from I4 because it is overriden by I3. + + checkOutput("pkg3/I1.html", false, + "Methods inherited from interface pkg3." + + "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">" + + "I4</a>"); + + checkOutput("pkg3/I0.html", false, + "Methods inherited from interface pkg3." + + "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">" + + "I4</a>"); } }
--- a/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,53 +27,32 @@ * @summary Inherited comment should link directly to member, not just * class * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestOverridenMethodDocCopy * @run main TestOverridenMethodDocCopy */ public class TestOverridenMethodDocCopy extends JavadocTester { - //Test information. - private static final String BUG_ID = "4368820"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg1" + FS + "SubClass.html", - "<span class=\"descfrmTypeLabel\">Description copied from class: <code>" + - "<a href=\"../pkg1/BaseClass.html#overridenMethodWithDocsToCopy--\">" + - "BaseClass</a></code></span>" - } - }; - private static final String[][] NEGATED_TEST = NO_TEST; - /** * The entry point of the test. * @param args the array of command line arguments. */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestOverridenMethodDocCopy tester = new TestOverridenMethodDocCopy(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg1", "pkg2"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg1/SubClass.html", true, + "<span class=\"descfrmTypeLabel\">Description copied from class: <code>" + + "<a href=\"../pkg1/BaseClass.html#overridenMethodWithDocsToCopy--\">" + + "BaseClass</a></code></span>"); } }
--- a/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,77 +27,50 @@ * @summary Determine if overriden methods are properly documented when * -protected (default) visibility flag is used. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestOverridenPrivateMethods * @run main TestOverridenPrivateMethods */ public class TestOverridenPrivateMethods extends JavadocTester { - private static final String BUG_ID = "4634891"; - - private static final String[][] TEST = { - //The public method should be overriden - {BUG_ID + FS + "pkg1" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"}, - - //The public method in different package should be overriden - {BUG_ID + FS + "pkg2" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"} - }; - - private static final String[][] NEGATED_TEST = { - - //The package private method should be overriden since the base and sub class are in the same - //package. However, the link should not show up because the package private methods are not documented. - {BUG_ID + FS + "pkg1" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}, - - //The private method in should not be overriden - {BUG_ID + FS + "pkg1" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"}, - - //The private method in different package should not be overriden - {BUG_ID + FS + "pkg2" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"}, - - //The package private method should not be overriden since the base and sub class are in - //different packages. - {BUG_ID + FS + "pkg2" + FS + "SubClass.html", - "Overrides:</span></dt><dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"} - }; - - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestOverridenPrivateMethods tester = new TestOverridenPrivateMethods(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg1", "pkg2"); + checkExit(Exit.OK); + + // The public method should be overridden + checkOutput("pkg1/SubClass.html", true, + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"); + + // The public method in different package should be overridden + checkOutput("pkg2/SubClass.html", true, + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg1/SubClass.html", false, + //The package private method should be overridden since the base and sub class are in the same + //package. However, the link should not show up because the package private methods are not documented. + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod", + //The private method in should not be overridden + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"); + + checkOutput("pkg2/SubClass.html", false, + //The private method in different package should not be overridden + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod", + //The package private method should not be overridden since the base and sub class are in + //different packages. + "Overrides:</span></dt><dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"); } }
--- a/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,87 +24,65 @@ /* * @test * @bug 4634891 8025633 8026567 - * @summary Determine if overriden methods are properly documented when + * @summary Determine if overridden methods are properly documented when * -protected (default) visibility flag is used. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestOverridenPrivateMethodsWithPackageFlag * @run main TestOverridenPrivateMethodsWithPackageFlag */ public class TestOverridenPrivateMethodsWithPackageFlag extends JavadocTester { - private static final String BUG_ID = "4634891"; - - private static final String[][] TEST = { - //The public method should be overriden - {BUG_ID + FS + "pkg1" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod--\">" + - "publicMethod</a></code> in class <code>" + - "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"}, - - //The public method in different package should be overriden - {BUG_ID + FS + "pkg2" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod--\">" + - "publicMethod</a></code> in class <code>" + - "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"}, - - //The package private method should be overriden since the base and sub class are in the same - //package. - {BUG_ID + FS + "pkg1" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod--\">" + - "packagePrivateMethod</a></code> in class <code>" + - "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"} - }; - - private static final String[][] NEGATED_TEST = { - - //The private method in should not be overriden - {BUG_ID + FS + "pkg1" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"}, - - //The private method in different package should not be overriden - {BUG_ID + FS + "pkg2" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"}, - - //The package private method should not be overriden since the base and sub class are in - //different packages. - {BUG_ID + FS + "pkg2" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod()\">"}, - }; - - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-package", "pkg1", "pkg2"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestOverridenPrivateMethodsWithPackageFlag tester = new TestOverridenPrivateMethodsWithPackageFlag(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-package", + "pkg1", "pkg2"); + checkExit(Exit.OK); + + // The public method should be overridden + checkOutput("pkg1/SubClass.html", true, + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod--\">" + + "publicMethod</a></code> in class <code>" + + "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"); + + // The public method in different package should be overridden + checkOutput("pkg2/SubClass.html", true, + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod--\">" + + "publicMethod</a></code> in class <code>" + + "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + // The package private method should be overridden since the base and sub class are in the same + // package. + checkOutput("pkg1/SubClass.html", true, + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod--\">" + + "packagePrivateMethod</a></code> in class <code>" + + "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"); + + // The private method in should not be overridden + checkOutput("pkg1/SubClass.html", false, + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"); + + // The private method in different package should not be overridden + checkOutput("pkg2/SubClass.html", false, + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"); + + // The package private method should not be overridden since the base and sub class are in + // different packages. + checkOutput("pkg2/SubClass.html", false, + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod()\">"); } }
--- a/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,83 +24,59 @@ /* * @test * @bug 4634891 8026567 - * @summary Determine if overriden methods are properly documented when + * @summary Determine if overridden methods are properly documented when * -protected (default) visibility flag is used. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestOverridenPrivateMethodsWithPrivateFlag * @run main TestOverridenPrivateMethodsWithPrivateFlag */ public class TestOverridenPrivateMethodsWithPrivateFlag extends JavadocTester { - private static final String BUG_ID = "4634891"; - - private static final String[][] TEST = { - //The public method should be overriden - {BUG_ID + FS + "pkg1" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"}, - - //The package private method should be overriden since the base and sub class are in the same - //package. - {BUG_ID + FS + "pkg1" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}, - - //The public method in different package should be overriden - {BUG_ID + FS + "pkg2" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"}, - }; - - private static final String[][] NEGATED_TEST = { - - //The private method in should not be overriden - {BUG_ID + FS + "pkg1" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"}, - - //The private method in different package should not be overriden - {BUG_ID + FS + "pkg2" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"}, - - //The package private method should not be overriden since the base and sub class are in - //different packages. - {BUG_ID + FS + "pkg2" + FS + "SubClass.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"} - - - }; - - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-private", "pkg1", "pkg2"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestOverridenPrivateMethodsWithPrivateFlag tester = new TestOverridenPrivateMethodsWithPrivateFlag(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-private", + "pkg1", "pkg2"); + checkExit(Exit.OK); + + // The public method should be overridden + checkOutput("pkg1/SubClass.html", true, + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"); + + // The package private method should be overridden since the base and sub class are in the same + // package. + checkOutput("pkg1/SubClass.html", true, + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + // The public method in different package should be overridden + checkOutput("pkg2/SubClass.html", true, + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"); + + // The private method in should not be overridden + checkOutput("pkg1/SubClass.html", false, + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"); + + // The private method in different package should not be overridden + checkOutput("pkg2/SubClass.html", false, + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"); + + // The package private method should not be overridden since the base and sub class are in + // different packages. + checkOutput("pkg2/SubClass.html", false, + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"); } }
--- a/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,72 +33,46 @@ public class TestPackageDeprecation extends JavadocTester { - //Test information. - private static final String BUG_ID = "6492694"; + public static void main(String... args) throws Exception { + TestPackageDeprecation tester = new TestPackageDeprecation(); + tester.runTests(); + } - //Javadoc arguments. - private static final String[] ARGS1 = new String[]{ - "-d", BUG_ID + "-1", "-source", "1.5", "-sourcepath", SRC_DIR, "-use", "pkg", "pkg1", - SRC_DIR + FS + "C2.java", SRC_DIR + FS + "FooDepr.java" - }; - private static final String[] ARGS2 = new String[]{ - "-d", BUG_ID + "-2", "-source", "1.5", "-sourcepath", SRC_DIR, "-use", "-nodeprecated", - "pkg", "pkg1", SRC_DIR + FS + "C2.java", SRC_DIR + FS + "FooDepr.java" - }; + @Test + void testDefault() { + javadoc("-d", "out-default", + "-sourcepath", testSrc, + "-use", + "pkg", "pkg1", testSrc("C2.java"), testSrc("FooDepr.java")); + checkExit(Exit.OK); - //Input for string search tests. - private static final String[][] TEST1 = { - {BUG_ID + "-1" + FS + "pkg1" + FS + "package-summary.html", - "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>" + NL + + checkOutput("pkg1/package-summary.html", true, + "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n" + "<div class=\"block\"><span class=\"deprecationComment\">This package is Deprecated." + "</span></div>" - }, - {BUG_ID + "-1" + FS + "deprecated-list.html", - "<li><a href=\"#package\">Deprecated Packages</a></li>" - } - }; - private static final String[][] TEST2 = NO_TEST; - private static final String[][] NEGATED_TEST1 = NO_TEST; - private static final String[][] NEGATED_TEST2 = { - {BUG_ID + "-2" + FS + "overview-summary.html", "pkg1"}, - {BUG_ID + "-2" + FS + "allclasses-frame.html", "FooDepr"} - }; + ); - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestPackageDeprecation tester = new TestPackageDeprecation(); - run(tester, ARGS1, TEST1, NEGATED_TEST1); - run(tester, ARGS2, TEST2, NEGATED_TEST2); - if ((new java.io.File(BUG_ID + "-2" + FS + "pkg1" + FS + - "package-summary.html")).exists()) { - throw new Error("Test Fails: packages summary should not be" + - "generated for deprecated package."); - } else { - System.out.println("Test passes: package-summary.html not found."); - } - if ((new java.io.File(BUG_ID + "-2" + FS + "FooDepr.html")).exists()) { - throw new Error("Test Fails: FooDepr should not be" + - "generated as it is deprecated."); - } else { - System.out.println("Test passes: FooDepr.html not found."); - } - tester.printSummary(); + checkOutput("deprecated-list.html", true, + "<li><a href=\"#package\">Deprecated Packages</a></li>" + ); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void testNoDeprecated() { + javadoc("-d", "out-nodepr", + "-sourcepath", testSrc, + "-use", + "-nodeprecated", + "pkg", "pkg1", testSrc("C2.java"), testSrc("FooDepr.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("overview-summary.html", false, + "pkg1"); + checkOutput("allclasses-frame.html", false, + "FooDepr"); + + checkFiles(false, + "pkg1/package-summary.html", + "FooDepr.html"); } }
--- a/test/com/sun/javadoc/testPackagePage/TestPackagePage.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testPackagePage/TestPackagePage.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,84 +28,58 @@ * passed to Javadoc. Also test that the proper package links are generated * when single or multiple packages are documented. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestPackagePage * @run main TestPackagePage */ public class TestPackagePage extends JavadocTester { - private static final String BUG_ID = "4492643-4689286"; + public static void main(String... args) throws Exception { + TestPackagePage tester = new TestPackagePage(); + tester.runTests(); + } + + @Test + void testSinglePackage() { + javadoc("-d", "out-1", + "-sourcepath", testSrc, + testSrc("com/pkg/C.java")); + checkExit(Exit.OK); + + checkOutput("com/pkg/package-summary.html", true, + "This is a package page."); + + // With just one package, all general pages link to the single package page. + checkOutput("com/pkg/C.html", true, + "<a href=\"../../com/pkg/package-summary.html\">Package</a>"); + checkOutput("com/pkg/package-tree.html", true, + "<li><a href=\"../../com/pkg/package-summary.html\">Package</a></li>"); + checkOutput("deprecated-list.html", true, + "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>"); + checkOutput("index-all.html", true, + "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>"); + checkOutput("help-doc.html", true, + "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>"); + } + private static final String[][] TEST1 = { - {BUG_ID + "-1" + FS + "com" + FS + "pkg" + FS + "package-summary.html", - "This is a package page." - }, - //With just one package, all general pages link to the single package page. - {BUG_ID + "-1" + FS + "com" + FS + "pkg" + FS + "C.html", - "<a href=\"../../com/pkg/package-summary.html\">Package</a>" - }, - {BUG_ID + "-1" + FS + "com" + FS + "pkg" + FS + "package-tree.html", - "<li><a href=\"../../com/pkg/package-summary.html\">Package</a></li>" - }, - {BUG_ID + "-1" + FS + "deprecated-list.html", - "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>" - }, - {BUG_ID + "-1" + FS + "index-all.html", - "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>" - }, - {BUG_ID + "-1" + FS + "help-doc.html", - "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>" - }, - }; - - private static final String[][] TEST2 = { - //With multiple packages, there is no package link in general pages. - {BUG_ID + "-2" + FS + "deprecated-list.html", - "<li>Package</li>" - }, - {BUG_ID + "-2" + FS + "index-all.html", - "<li>Package</li>" - }, - {BUG_ID + "-2" + FS + "help-doc.html", - "<li>Package</li>" - }, }; - private static final String[] ARGS1 = - new String[] { - "-d", BUG_ID + "-1", "-sourcepath", SRC_DIR, - SRC_DIR + FS + "com" + FS + "pkg" + FS + "C.java" - }; - private static final String[] ARGS2 = - new String[] { - "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, - "com.pkg", "pkg2" - }; + @Test + void testMultiplePackages() { + javadoc("-d", "out-2", + "-sourcepath", testSrc, + "com.pkg", "pkg2"); + checkExit(Exit.OK); - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestPackagePage tester = new TestPackagePage(); - run(tester, ARGS1, TEST1, NO_TEST); - run(tester, ARGS2, TEST2, NO_TEST); - tester.printSummary(); - } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + //With multiple packages, there is no package link in general pages. + checkOutput("deprecated-list.html", true, + "<li>Package</li>"); + checkOutput("index-all.html", true, + "<li>Package</li>"); + checkOutput("help-doc.html", true, + "<li>Package</li>"); } }
--- a/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,66 +28,38 @@ * match up with a real parameters. * Make sure inheritDoc cannot be used in an invalid param tag. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestParamTaglet * @run main TestParamTaglet */ public class TestParamTaglet extends JavadocTester { - //Test information. - private static final String BUG_ID = "4802275-4967243"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" - }; - - //Input for string search tests. - private static final String[][] TEST = { - //Regular param tags. - {BUG_ID + FS + "pkg" + FS + "C.html", - "<span class=\"paramLabel\">Parameters:</span></dt>" + NL + "<dd><code>param1</code> - testing 1 2 3.</dd>" + - NL + "<dd><code>param2</code> - testing 1 2 3." - }, - //Param tags that don't match with any real parameters. - {BUG_ID + FS + "pkg" + FS + "C.html", - "<span class=\"paramLabel\">Parameters:</span></dt>" + NL + "<dd><code><I>p1</I></code> - testing 1 2 3.</dd>" + - NL + "<dd><code><I>p2</I></code> - testing 1 2 3." - }, - //{@inherit} doc misuse does not cause doclet to throw exception. - // Param is printed with nothing inherited. - //XXX: in the future when Configuration is available during doc inheritence, - //print a warning for this mistake. - {BUG_ID + FS + "pkg" + FS + "C.html", - "<code><I>inheritBug</I></code> -" - }, - - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestParamTaglet tester = new TestParamTaglet(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.FAILED); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/C.html", true, + //Regular param tags. + "<span class=\"paramLabel\">Parameters:</span></dt>\n" + + "<dd><code>param1</code> - testing 1 2 3.</dd>\n" + + "<dd><code>param2</code> - testing 1 2 3.", + //Param tags that don't match with any real parameters. + "<span class=\"paramLabel\">Parameters:</span></dt>\n" + + "<dd><code><I>p1</I></code> - testing 1 2 3.</dd>\n" + + "<dd><code><I>p2</I></code> - testing 1 2 3.", + //{@inherit} doc misuse does not cause doclet to throw exception. + // Param is printed with nothing inherited. + //XXX: in the future when Configuration is available during doc inheritence, + //print a warning for this mistake. + "<code><I>inheritBug</I></code> -"); } }
--- a/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,241 +37,185 @@ * Make sure when no modifier appear in the class signature, the * signature is displayed correctly without extra space at the beginning. * @author jamieh - * @library ../lib/ - * @build JavadocTester TestPrivateClasses + * @library ../lib + * @build JavadocTester * @run main TestPrivateClasses */ public class TestPrivateClasses extends JavadocTester { - //Test information. - private static final String BUG_ID = "4780441-4874845-4978816-8014017"; - - //Javadoc arguments. - private static final String[] ARGS1 = new String[] { - "-d", BUG_ID + "-1", "-sourcepath", SRC_DIR, "-source", "1.5", "pkg", "pkg2" - }; - private static final String[] ARGS2 = new String[] { - "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, "-private", - "-source", "1.5", "pkg", "pkg2" - }; - - // Test output when -private flag is not used. - private static final String[][] TEST1 = { - // Field inheritence from non-public superclass. - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "<a href=\"../pkg/PublicChild.html#fieldInheritedFromParent\">" + - "fieldInheritedFromParent</a>" - }, + public static void main(String... args) throws Exception { + TestPrivateClasses tester = new TestPrivateClasses(); + tester.runTests(); + } - // Method inheritence from non-public superclass. - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "<a href=\"../pkg/PublicChild.html#methodInheritedFromParent-int-\">" + - "methodInheritedFromParent</a>" - }, - - // Field inheritence from non-public superinterface. - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", - "<a href=\"../pkg/PublicInterface.html#fieldInheritedFromInterface\">" + - "fieldInheritedFromInterface</a>" - }, - - // Method inheritence from non-public superinterface. - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", - "<a href=\"../pkg/PublicInterface.html#methodInterface-int-\">" + - "methodInterface</a>" - }, - - // private class does not show up in tree - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "<ul class=\"inheritance\">" + NL + "<li>java.lang.Object</li>" + NL + - "<li>" + NL + "<ul class=\"inheritance\">" + NL + "<li>pkg.PublicChild</li>" + NL + - "</ul>" + NL + "</li>" + NL + "</ul>" - }, + @Test + void testDefault() { + javadoc("-d", "out-default", + "-sourcepath", testSrc, + "pkg", "pkg2"); + checkExit(Exit.OK); - // Method is documented as though it is declared in the inheriting method. - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "<pre>public void methodInheritedFromParent(int p1)" - }, - - //Make sure implemented interfaces from private superclass are inherited - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", - "<dl>" + NL + "<dt>All Known Implementing Classes:</dt>" + NL + - "<dd><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">" + - "PublicChild</a></dd>" + NL + "</dl>"}, - - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "<dl>" + NL + "<dt>All Implemented Interfaces:</dt>" + NL + - "<dd><a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" + - "PublicInterface</a></dd>" + NL + "</dl>"}, - - //Generic interface method test. - {BUG_ID + "-1" + FS + "pkg2" + FS + "C.html", - "This comment should get copied to the implementing class"}, - }; - private static final String[][] NEGATED_TEST1 = { - // Should not document that a method overrides method from private class. - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "<span class=\"overrideSpecifyLabel\">Overrides:</span>"}, - // Should not document that a method specified by private interface. - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "<span class=\"overrideSpecifyLabel\">Specified by:</span>"}, - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", - "<span class=\"overrideSpecifyLabel\">Specified by:</span>"}, - // Should not mention that any documentation was copied. - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "Description copied from"}, - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", - "Description copied from"}, - // Don't extend private classes or interfaces - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "PrivateParent"}, - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", - "PrivateInterface"}, - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", - "PrivateInterface"}, - {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", - "All Superinterfaces"}, - // Make inherited constant are documented correctly. - {BUG_ID + "-1" + FS + "constant-values.html", - "PrivateInterface"}, - - //Do not inherit private interface method with generic parameters. - //This method has been implemented. - {BUG_ID + "-1" + FS + "pkg2" + FS + "C.html", - "<span class=\"memberNameLink\"><a href=\"../pkg2/I.html#hello-T-\">hello</a></span>"}, - }; + checkOutput("pkg/PublicChild.html", true, + // Field inheritence from non-public superclass. + "<a href=\"../pkg/PublicChild.html#fieldInheritedFromParent\">" + + "fieldInheritedFromParent</a>", + // Method inheritance from non-public superclass. + "<a href=\"../pkg/PublicChild.html#methodInheritedFromParent-int-\">" + + "methodInheritedFromParent</a>", + // private class does not show up in tree + "<ul class=\"inheritance\">\n" + + "<li>java.lang.Object</li>\n" + + "<li>\n" + + "<ul class=\"inheritance\">\n" + + "<li>pkg.PublicChild</li>\n" + + "</ul>\n" + + "</li>\n" + + "</ul>", + // Method is documented as though it is declared in the inheriting method. + "<pre>public void methodInheritedFromParent(int p1)", + "<dl>\n" + + "<dt>All Implemented Interfaces:</dt>\n" + + "<dd><a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" + + "PublicInterface</a></dd>\n" + + "</dl>"); - // Test output when -private flag is used. - private static final String[][] TEST2 = { - // Field inheritence from non-public superclass. - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "Fields inherited from class pkg." + - "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" + - "PrivateParent</a>" - }, - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "<a href=\"../pkg/PrivateParent.html#fieldInheritedFromParent\">" + - "fieldInheritedFromParent</a>" - }, - // Field inheritence from non-public superinterface. - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html", - "Fields inherited from interface pkg." + - "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" + - "PrivateInterface</a>" - }, - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html", - "<a href=\"../pkg/PrivateInterface.html#fieldInheritedFromInterface\">" + - "fieldInheritedFromInterface</a>" - }, - // Method inheritence from non-public superclass. - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "Methods inherited from class pkg." + - "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" + - "PrivateParent</a>" - }, - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "<a href=\"../pkg/PrivateParent.html#methodInheritedFromParent-int-\">" + - "methodInheritedFromParent</a>" - }, - // Should document that a method overrides method from private class. - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL + - "<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent-char:A-int-T-V-java.util.List-\">" + - "methodOverridenFromParent</a></code> in class <code>" + - "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" + - "PrivateParent</a></code></dd>"}, - // Should document that a method is specified by private interface. - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL + - "<dd><code><a href=\"../pkg/PrivateInterface.html#methodInterface-int-\">" + - "methodInterface</a></code> in interface <code>" + - "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" + - "PrivateInterface</a></code></dd>"}, - // Method inheritence from non-public superinterface. - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html", - "Methods inherited from interface pkg." + - "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" + - "PrivateInterface</a>" - }, - {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateInterface.html", - "<a href=\"../pkg/PrivateInterface.html#methodInterface-int-\">" + - "methodInterface</a>" - }, - // Should mention that any documentation was copied. - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "Description copied from"}, - // Extend documented private classes or interfaces - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "extends"}, - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html", - "extends"}, - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html", - "All Superinterfaces"}, + checkOutput("pkg/PublicChild.html", false, + // Should not document that a method overrides method from private class. + "<span class=\"overrideSpecifyLabel\">Overrides:</span>", + // Should not document that a method specified by private interface. + "<span class=\"overrideSpecifyLabel\">Specified by:</span>", + // Should not mention that any documentation was copied. + "Description copied from", + // Don't extend private classes or interfaces + "PrivateParent", + "PrivateInterface"); - //Make sure implemented interfaces from private superclass are inherited - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html", - "<dl>" + NL + "<dt>All Known Implementing Classes:</dt>" + NL + - "<dd><a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" + - "PrivateParent</a>, " + - "<a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild" + - "</a></dd>" + NL + "</dl>"}, - - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "<dl>" + NL + "<dt>All Implemented Interfaces:</dt>" + NL + - "<dd><a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" + - "PrivateInterface</a>, " + - "<a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" + - "PublicInterface</a></dd>" + NL + "</dl>"}, - - //Since private flag is used, we can document that private interface method - //with generic parameters has been implemented. - {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html", - "<span class=\"descfrmTypeLabel\">Description copied from interface: <code>" + - "<a href=\"../pkg2/I.html#hello-T-\">I</a></code></span>"}, + checkOutput("pkg/PublicInterface.html", true, + // Field inheritance from non-public superinterface. + "<a href=\"../pkg/PublicInterface.html#fieldInheritedFromInterface\">" + + "fieldInheritedFromInterface</a>", + // Method inheritance from non-public superinterface. + "<a href=\"../pkg/PublicInterface.html#methodInterface-int-\">" + + "methodInterface</a>", + //Make sure implemented interfaces from private superclass are inherited + "<dl>\n" + + "<dt>All Known Implementing Classes:</dt>\n" + + "<dd><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">" + + "PublicChild</a></dd>\n" + + "</dl>"); - {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html", - "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL + - "<dd><code><a href=\"../pkg2/I.html#hello-T-\">hello</a></code>" + - " in interface <code>" + - "<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>" + - "<java.lang.String></code></dd>"}, - - //Make sure when no modifier appear in the class signature, the - //signature is displayed correctly without extra space at the beginning. - {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html", - "<pre>class <span class=\"typeNameLabel\">PrivateParent</span>"}, + checkOutput("pkg/PublicInterface.html", false, + "<span class=\"overrideSpecifyLabel\">Specified by:</span>", + "Description copied from", + "PrivateInterface", + "All Superinterfaces"); - {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", - "<pre>public class <span class=\"typeNameLabel\">PublicChild</span>"}, - }; - private static final String[][] NEGATED_TEST2 = { - {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html", - "<pre> class <span class=\"typeNameLabel\">PrivateParent</span>"}, - }; + checkOutput("pkg2/C.html", true, + //Generic interface method test. + "This comment should get copied to the implementing class"); - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestPrivateClasses tester = new TestPrivateClasses(); - run(tester, ARGS1, TEST1, NEGATED_TEST1); - run(tester, ARGS2, TEST2, NEGATED_TEST2); - tester.printSummary(); + checkOutput("pkg2/C.html", false, + //Do not inherit private interface method with generic parameters. + //This method has been implemented. + "<span class=\"memberNameLink\"><a href=\"../pkg2/I.html#hello-T-\">hello</a></span>"); + + checkOutput("constant-values.html", false, + // Make inherited constant are documented correctly. + "PrivateInterface"); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void testPrivate() { + javadoc("-d", "out-private", + "-sourcepath", testSrc, + "-private", + "pkg", "pkg2"); + checkExit(Exit.OK); + + checkOutput("pkg/PublicChild.html", true, + // Field inheritence from non-public superclass. + "Fields inherited from class pkg." + + "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" + + "PrivateParent</a>", + "<a href=\"../pkg/PrivateParent.html#fieldInheritedFromParent\">" + + "fieldInheritedFromParent</a>", + // Method inheritence from non-public superclass. + "Methods inherited from class pkg." + + "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" + + "PrivateParent</a>", + "<a href=\"../pkg/PrivateParent.html#methodInheritedFromParent-int-\">" + + "methodInheritedFromParent</a>", + // Should document that a method overrides method from private class. + "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" + + "<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent-char:A-int-T-V-java.util.List-\">" + + "methodOverridenFromParent</a></code> in class <code>" + + "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" + + "PrivateParent</a></code></dd>", + // Should document that a method is specified by private interface. + "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n" + + "<dd><code><a href=\"../pkg/PrivateInterface.html#methodInterface-int-\">" + + "methodInterface</a></code> in interface <code>" + + "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" + + "PrivateInterface</a></code></dd>", + // Should mention that any documentation was copied. + "Description copied from", + // Extend documented private classes or interfaces + "extends", + "<dl>\n" + + "<dt>All Implemented Interfaces:</dt>\n" + + "<dd><a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" + + "PrivateInterface</a>, " + + "<a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" + + "PublicInterface</a></dd>\n" + + "</dl>", + "<pre>public class <span class=\"typeNameLabel\">PublicChild</span>"); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/PublicInterface.html", true, + // Field inheritence from non-public superinterface. + "Fields inherited from interface pkg." + + "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" + + "PrivateInterface</a>", + "<a href=\"../pkg/PrivateInterface.html#fieldInheritedFromInterface\">" + + "fieldInheritedFromInterface</a>", + // Method inheritance from non-public superinterface. + "Methods inherited from interface pkg." + + "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" + + "PrivateInterface</a>", + // Extend documented private classes or interfaces + "extends", + "All Superinterfaces", + //Make sure implemented interfaces from private superclass are inherited + "<dl>\n" + + "<dt>All Known Implementing Classes:</dt>\n" + + "<dd><a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" + + "PrivateParent</a>, " + + "<a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild" + + "</a></dd>\n" + + "</dl>"); + + checkOutput("pkg/PrivateInterface.html", true, + "<a href=\"../pkg/PrivateInterface.html#methodInterface-int-\">" + + "methodInterface</a>" + ); + + checkOutput("pkg2/C.html", true, + //Since private flag is used, we can document that private interface method + //with generic parameters has been implemented. + "<span class=\"descfrmTypeLabel\">Description copied from interface: <code>" + + "<a href=\"../pkg2/I.html#hello-T-\">I</a></code></span>", + "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n" + + "<dd><code><a href=\"../pkg2/I.html#hello-T-\">hello</a></code>" + + " in interface <code>" + + "<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>" + + "<java.lang.String></code></dd>"); + + checkOutput("pkg/PrivateParent.html", true, + //Make sure when no modifier appear in the class signature, the + //signature is displayed correctly without extra space at the beginning. + "<pre>class <span class=\"typeNameLabel\">PrivateParent</span>"); + + checkOutput("pkg/PrivateParent.html", false, + "<pre> class <span class=\"typeNameLabel\">PrivateParent</span>"); } }
--- a/test/com/sun/javadoc/testProfiles/TestProfiles.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testProfiles/TestProfiles.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,248 +26,234 @@ * @bug 8006124 8009684 8016921 8023700 8024096 8008164 8026567 8026770 * @summary Test javadoc support for profiles. * @author Bhavesh Patel, Evgeniya Stepanova - * @library ../lib/ - * @build JavadocTester TestProfiles + * @library ../lib + * @build JavadocTester * @run main TestProfiles */ public class TestProfiles extends JavadocTester { - //Test information. - private static final String BUG_ID = "8006124-8009684-8016921"; - private static final String PROFILE_BUG_ID = BUG_ID + "-1"; - private static final String PACKAGE_BUG_ID = BUG_ID + "-2"; - //Javadoc arguments. - private static final String[] ARGS1 = new String[]{ - "-d", PROFILE_BUG_ID, "-sourcepath", SRC_DIR, "-Xprofilespath", - SRC_DIR + FS + "profile-rtjar-includes.txt", "pkg1", "pkg2", - "pkg3", "pkg4", "pkg5", "pkgDeprecated" - }; - private static final String[] ARGS2 = new String[]{ - "-d", PACKAGE_BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2", "pkg3", "pkg4", "pkg5" - }; - //Input for string tests for profiles. - private static final String[][] PROFILES_TEST = { + public static void main(String... args) throws Exception { + TestProfiles tester = new TestProfiles(); + tester.runTests(); + } + + @Test + void testProfiles() { + javadoc("-d", "out-profiles", + "-sourcepath", testSrc, + "-Xprofilespath", testSrc("profile-rtjar-includes.txt"), + "pkg1", "pkg2", "pkg3", "pkg4", "pkg5", "pkgDeprecated"); + checkExit(Exit.OK); + // Tests for profile-overview-frame.html listing all profiles. - {PROFILE_BUG_ID + FS + "profile-overview-frame.html", - "<span><a href=\"overview-frame.html\" " - + "target=\"packageListFrame\">All Packages</a></span>" - }, - {PROFILE_BUG_ID + FS + "profile-overview-frame.html", - "<li><a href=\"compact1-frame.html\" target=\"packageListFrame\">" - + "compact1</a></li>" - }, + checkOutput("profile-overview-frame.html", true, + "<span><a href=\"overview-frame.html\" " + + "target=\"packageListFrame\">All Packages</a></span>", + "<li><a href=\"compact1-frame.html\" target=\"packageListFrame\">" + + "compact1</a></li>"); + // Tests for profileName-frame.html listing all packages in a profile. - {PROFILE_BUG_ID + FS + "compact2-frame.html", - "<span><a href=\"overview-frame.html\" target=\"packageListFrame\">" - + "All Packages</a></span><span><a href=\"profile-overview-frame.html\" " - + "target=\"packageListFrame\">All Profiles</a></span>" - }, - {PROFILE_BUG_ID + FS + "compact2-frame.html", - "<li><a href=\"pkg4/compact2-package-frame.html\" " - + "target=\"packageFrame\">pkg4</a></li>" - }, + checkOutput("compact2-frame.html", true, + "<span><a href=\"overview-frame.html\" target=\"packageListFrame\">" + + "All Packages</a></span><span><a href=\"profile-overview-frame.html\" " + + "target=\"packageListFrame\">All Profiles</a></span>", + "<li><a href=\"pkg4/compact2-package-frame.html\" " + + "target=\"packageFrame\">pkg4</a></li>"); + // Test for profileName-package-frame.html listing all types in a // package of a profile. - {PROFILE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html", - "<a href=\"../compact2-summary.html\" target=\"classFrame\">" - + "compact2</a> - <a href=\"../pkg2/compact2-package-summary.html\" " - + "target=\"classFrame\">pkg2</a>" - }, + checkOutput("pkg2/compact2-package-frame.html", true, + "<a href=\"../compact2-summary.html\" target=\"classFrame\">" + + "compact2</a> - <a href=\"../pkg2/compact2-package-summary.html\" " + + "target=\"classFrame\">pkg2</a>"); + // Tests for profileName-summary.html listing the summary for a profile. - {PROFILE_BUG_ID + FS + "compact2-summary.html", - "<li><a href=\"compact1-summary.html\">Prev Profile</a></li>" + NL - + "<li><a href=\"compact3-summary.html\">Next Profile</a></li>" - }, - {PROFILE_BUG_ID + FS + "compact2-summary.html", - "<h1 title=\"Profile\" class=\"title\">Profile compact2</h1>" - }, - {PROFILE_BUG_ID + FS + "compact2-summary.html", - "<h3><a href=\"pkg2/compact2-package-summary.html\" " - + "target=\"classFrame\">pkg2</a></h3>" - }, - {PROFILE_BUG_ID + FS + "compact2-summary.html", - "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL - + "<h3><a href=\"pkg2/compact2-package-summary.html\" target=\"classFrame\">" - + "pkg2</a></h3>" + NL + "<table class=\"typeSummary\" border=\"0\" " - + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, " - + "listing classes, and an explanation\">" - }, - {PROFILE_BUG_ID + FS + "compact2-summary.html", - "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL - + "<h3><a href=\"pkg4/compact2-package-summary.html\" target=\"classFrame\">" - + "pkg4</a></h3>" + NL + "<table class=\"typeSummary\" border=\"0\" " - + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, " - + "listing classes, and an explanation\">" - }, + checkOutput("compact2-summary.html", true, + "<li><a href=\"compact1-summary.html\">Prev Profile</a></li>\n" + + "<li><a href=\"compact3-summary.html\">Next Profile</a></li>", + "<h1 title=\"Profile\" class=\"title\">Profile compact2</h1>", + "<h3><a href=\"pkg2/compact2-package-summary.html\" " + + "target=\"classFrame\">pkg2</a></h3>", + "<ul class=\"blockList\">\n" + + "<li class=\"blockList\">\n" + + "<h3><a href=\"pkg2/compact2-package-summary.html\" target=\"classFrame\">" + + "pkg2</a></h3>\n" + + "<table class=\"typeSummary\" border=\"0\" " + + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, " + + "listing classes, and an explanation\">", + "<ul class=\"blockList\">\n" + + "<li class=\"blockList\">\n" + + "<h3><a href=\"pkg4/compact2-package-summary.html\" target=\"classFrame\">" + + "pkg4</a></h3>\n" + + "<table class=\"typeSummary\" border=\"0\" " + + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, " + + "listing classes, and an explanation\">"); + + // Tests for profileName-package-summary.html listing the summary for a // package in a profile. - {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html", - "<li><a href=\"../pkg4/compact3-package-summary.html\">Prev Package" - + "</a></li>" - }, - {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html", - "<div class=\"subTitle\">compact3</div>" - }, - {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html", - "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL + checkOutput("pkg5/compact3-package-summary.html", true, + "<li><a href=\"../pkg4/compact3-package-summary.html\">Prev Package" + + "</a></li>", + "<div class=\"subTitle\">compact3</div>", + "<ul class=\"blockList\">\n" + + "<li class=\"blockList\">\n" + + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" " + + "cellspacing=\"0\" summary=\"Interface Summary table, listing " + + "interfaces, and an explanation\">"); + + // Test for "overview-frame.html" showing the "All Profiles" link. + checkOutput("overview-frame.html", true, + "<span><a href=\"profile-overview-frame.html\" " + + "target=\"packageListFrame\">All Profiles</a></span>"); + + // Test for "className.html" showing the profile information for the type. + checkOutput("pkg2/Class1Pkg2.html", true, + "<div class=\"subTitle\">compact1, compact2, compact3</div>"); + + checkOutput("index.html", true, + "<frame src=\"overview-frame.html\" name=\"packageListFrame\" " + + "title=\"All Packages\">"); + + // Test for "overview-summary.html" showing the profile list. + checkOutput("overview-summary.html", true, + "<ul>\n" + + "<li><a href=\"compact1-summary.html\" target=\"classFrame\">" + + "compact1</a></li>\n" + + "<li><a href=\"compact2-summary.html\" " + + "target=\"classFrame\">compact2</a></li>\n" + + "<li><a href=\"" + + "compact3-summary.html\" target=\"classFrame\">compact3</a></li>\n" + + "</ul>"); + + // Test deprecated class in profiles + checkOutput("compact1-summary.html", true, + "<td class=\"colFirst\"><a href=\"pkg2/Class1Pkg2.html\" title=\"class in pkg2\">Class1Pkg2</a></td>\n" + + "<td class=\"colLast\">Deprecated"); + + checkOutput("deprecated-list.html", true, + "<td class=\"colOne\"><a href=\"pkg2/Class1Pkg2.html\" title=\"class in pkg2\">pkg2.Class1Pkg2</a>\n" + + "<div class=\"block\"><span class=\"deprecationComment\">Class1Pkg2. This class is deprecated</span></div>"); + + //Test deprecated package in profile + checkOutput("deprecated-list.html", true, + "<td class=\"colOne\"><a href=\"pkgDeprecated/package-summary.html\">pkgDeprecated</a>\n" + + "<div class=\"block\"><span class=\"deprecationComment\">This package is <b>Deprecated</b>." + + " Use pkg1.</span></div>"); + + checkOutput("pkgDeprecated/package-summary.html", true, + "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n" + + "<div class=\"block\"><span class=\"deprecationComment\">This package is <b>Deprecated</b>." + + " Use pkg1.</span></div>"); + + // TODO: need to add teststring when JDK-8015496 will be fixed + // Test exception in profiles + checkOutput("compact1-summary.html", true, + "<table class=\"typeSummary\" " + + "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " + + "summary=\"Exception Summary table, listing exceptions, and an explanation\">\n" + + "<caption><span>Exception Summary</span><span class=\"tabEnd\">" + + " </span></caption>\n" + + "<tr>\n" + + "<th class=\"colFirst\" scope=\"col\">Exception</th>\n" + + "<th class=\"colLast\" scope=\"col\">" + + "Description</th>\n" + + "</tr>\n" + + "<tbody>\n" + + "<tr class=\"altColor\">\n" + + "<td class=\"colFirst\"><a href=\"pkg2/ClassException.html\"" + + " title=\"class in pkg2\">ClassException</a></td>"); + + //Test errors in profiles + checkOutput("compact1-summary.html", true, + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " + + "summary=\"Error Summary table, listing errors, and an explanation\">\n" + + "<caption><span>Error Summary</span><span class=\"tabEnd\"> " + + "</span></caption>\n" + + "<tr>\n" + + "<th class=\"colFirst\" scope=\"col\">Error</th>\n" + + "<th class=\"colLast\" scope=\"col\">Description</th>\n" + + "</tr>\n" + + "<tbody>\n" + + "<tr class=\"altColor\">\n" + + "<td class=\"colFirst\">" + + "<a href=\"pkg2/ClassError.html\" title=\"class in pkg2\">ClassError</a></td>"); + + // negative tests + checkOutput("pkg3/Class2Pkg3.html", false, + "<div class=\"subTitle\">compact1"); + + checkOutput("pkg3/Interface1Pkg3.html", false, + "<div class=\"subTitle\">compact1"); + + checkOutput("pkg4/compact2-package-frame.html", false, + "<li><a href=\"Anno1Pkg4.html\" title=\"annotation in pkg4\" " + + "target=\"classFrame\">Anno1Pkg4</a></li>"); + + checkOutput("compact1-summary.html", false, + "<li>Use</li>"); + + checkOutput("compact2-summary.html", false, + "<ul class=\"blockList\">\n" + + "<li class=\"blockList\">\n" + + "<h3><a href=\"pkg2/compact2-package-summary.html\" target=\"classFrame\">" + + "pkg2</a></h3>\n" + + "<li class=\"blockList\">\n" + + "<table class=\"typeSummary\" border=\"0\" " + + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, " + + "listing classes, and an explanation\">"); + + checkOutput("pkg5/compact3-package-summary.html", false, + "<ul class=\"blockList\">\n" + + "<li class=\"blockList\">\n" + + "<li class=\"blockList\">\n" + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" " + "cellspacing=\"0\" summary=\"Interface Summary table, listing " - + "interfaces, and an explanation\">" - }, - //Test for "overview-frame.html" showing the "All Profiles" link. - {PROFILE_BUG_ID + FS + "overview-frame.html", - "<span><a href=\"profile-overview-frame.html\" " - + "target=\"packageListFrame\">All Profiles</a></span>" - }, - //Test for "className.html" showing the profile information for the type. - {PROFILE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html", - "<div class=\"subTitle\">compact1, compact2, compact3</div>" - }, - {PROFILE_BUG_ID + FS + "index.html", - "<frame src=\"overview-frame.html\" name=\"packageListFrame\" " + - "title=\"All Packages\">" - }, - //Test for "overview-summary.html" showing the profile list. - {PROFILE_BUG_ID + FS + "overview-summary.html", - "<ul>" + NL +"<li><a href=\"compact1-summary.html\" target=\"classFrame\">" + - "compact1</a></li>" + NL + "<li><a href=\"compact2-summary.html\" " + - "target=\"classFrame\">compact2</a></li>" + NL + "<li><a href=\"" + - "compact3-summary.html\" target=\"classFrame\">compact3</a></li>" + NL + - "</ul>" - }, - //Test deprecated class in profiles - {PROFILE_BUG_ID + FS + "compact1-summary.html","<td class=\"colFirst\">" - + "<a href=\"pkg2/Class1Pkg2.html\" title=\"class in pkg2\">Class1Pkg2</a></td>" - + NL + "<td class=\"colLast\">Deprecated" - }, - {PROFILE_BUG_ID + FS + "deprecated-list.html","<td class=\"colOne\">" - + "<a href=\"pkg2/Class1Pkg2.html\" title=\"class in pkg2\">pkg2.Class1Pkg2</a>" - + NL +"<div class=\"block\"><span class=\"deprecationComment\">Class1Pkg2. This class is deprecated</span></div>" - }, - //Test deprecated package in profile - {PROFILE_BUG_ID + FS + "deprecated-list.html","<td class=\"colOne\">" - + "<a href=\"pkgDeprecated/package-summary.html\">pkgDeprecated</a>" - + NL +"<div class=\"block\"><span class=\"deprecationComment\">This package is <b>Deprecated</b>." - + " Use pkg1.</span></div>" - }, - {PROFILE_BUG_ID + FS + "pkgDeprecated" + FS + "package-summary.html", - "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>" - + NL + "<div class=\"block\"><span class=\"deprecationComment\">This package is <b>Deprecated</b>." - + " Use pkg1.</span></div>" - }, - // need to add teststring when JDK-8015496 will be fixed - //Test exception in profiles - {PROFILE_BUG_ID + FS + "compact1-summary.html","<table class=\"typeSummary\" " - + "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " - + "summary=\"Exception Summary table, listing exceptions, and an explanation\">" - + NL + "<caption><span>Exception Summary</span><span class=\"tabEnd\">" - + " </span></caption>" + NL + "<tr>" + NL + "<th class=\"colFirst\" " - + "scope=\"col\">Exception</th>" + NL + "<th class=\"colLast\" scope=\"col\">" - + "Description</th>" + NL + "</tr>" + NL + "<tbody>" + NL + "<tr class=\"altColor\">" - + NL + "<td class=\"colFirst\"><a href=\"pkg2/ClassException.html\"" - + " title=\"class in pkg2\">ClassException</a></td>" - }, - //Test errors in profiles - {PROFILE_BUG_ID + FS + "compact1-summary.html", - "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " - + "summary=\"Error Summary table, listing errors, and an explanation\">" - + NL + "<caption><span>Error Summary</span><span class=\"tabEnd\"> " - + "</span></caption>" + NL + "<tr>" + NL + "<th class=\"colFirst\"" - + " scope=\"col\">Error</th>" + NL + "<th class=\"colLast\" " - + "scope=\"col\">Description</th>" + NL + "</tr>" + NL + "<tbody>" - + NL + "<tr class=\"altColor\">" + NL + "<td class=\"colFirst\">" - + "<a href=\"pkg2/ClassError.html\" title=\"class in pkg2\">ClassError</a></td>" - } - }; - private static final String[][] PROFILES_NEGATED_TEST = { - {PROFILE_BUG_ID + FS + "pkg3" + FS + "Class2Pkg3.html", - "<div class=\"subTitle\">compact1" - }, - {PROFILE_BUG_ID + FS + "pkg3" + FS + "Interface1Pkg3.html", - "<div class=\"subTitle\">compact1" - }, - {PROFILE_BUG_ID + FS + "pkg4" + FS + "compact2-package-frame.html", - "<li><a href=\"Anno1Pkg4.html\" title=\"annotation in pkg4\" " - + "target=\"classFrame\">Anno1Pkg4</a></li>" - }, - {PROFILE_BUG_ID + FS + "compact1-summary.html","<li>Use</li>" - }, - {PROFILE_BUG_ID + FS + "compact2-summary.html", - "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL - + "<h3><a href=\"pkg2/compact2-package-summary.html\" target=\"classFrame\">" - + "pkg2</a></h3>" + NL + "<li class=\"blockList\">" + NL - + "<table class=\"typeSummary\" border=\"0\" " - + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, " - + "listing classes, and an explanation\">" - }, - {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html", - "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL - + "<li class=\"blockList\">" + NL - + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" " - + "cellspacing=\"0\" summary=\"Interface Summary table, listing " - + "interfaces, and an explanation\">" - } - }; - private static final String[][] PACKAGES_TEST = { - {PACKAGE_BUG_ID + FS + "overview-frame.html", - "<h2 title=\"Packages\">Packages</h2>" - }, - {PACKAGE_BUG_ID + FS + "pkg4" + FS + "package-frame.html", - "<h1 class=\"bar\"><a href=\"../pkg4/package-summary.html\" " - + "target=\"classFrame\">pkg4</a></h1>" - }, - {PACKAGE_BUG_ID + FS + "pkg4" + FS + "package-summary.html", - "<div class=\"header\">" + NL + "<h1 title=\"Package\" " - + "class=\"title\">Package pkg4</h1>" + NL + "</div>" - } - }; - private static final String[][] PACKAGES_NEGATED_TEST = { - {PACKAGE_BUG_ID + FS + "overview-frame.html", - "<span><a href=\"profile-overview-frame.html\" " - + "target=\"packageListFrame\">All Profiles</a></span>" - }, - {PACKAGE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html", - "<div class=\"subTitle\">compact1, compact2, compact3</div>" - }, - {PACKAGE_BUG_ID + FS + "overview-summary.html", - "<ul>" + NL +"<li><a href=\"compact1-summary.html\" target=\"classFrame\">" + - "compact1</a></li>" + NL + "<li><a href=\"compact2-summary.html\" " + - "target=\"classFrame\">compact2</a></li>" + NL + "<li><a href=\"" + - "compact3-summary.html\" target=\"classFrame\">compact3</a></li>" + NL + - "</ul>" - } - }; - private static final String[] PACKAGES_NEGATED_FILE_TEST = { - PACKAGE_BUG_ID + FS + "profile-overview-frame.html", - PACKAGE_BUG_ID + FS + "compact2-frame.html", - PACKAGE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html", - PACKAGE_BUG_ID + FS + "compact2-summary.html", - PACKAGE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html" - }; - - /** - * The entry point of the test. - * - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestProfiles tester = new TestProfiles(); - run(tester, ARGS1, PROFILES_TEST, PROFILES_NEGATED_TEST); - run(tester, ARGS2, PACKAGES_TEST, PACKAGES_NEGATED_TEST, NO_FILE_TEST, PACKAGES_NEGATED_FILE_TEST); - tester.printSummary(); + + "interfaces, and an explanation\">"); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void testPackages() { + javadoc("-d", "out-packages", + "-sourcepath", testSrc, + "pkg1", "pkg2", "pkg3", "pkg4", "pkg5"); + checkExit(Exit.OK); + + checkOutput("overview-frame.html", true, + "<h2 title=\"Packages\">Packages</h2>"); + + checkOutput("pkg4/package-frame.html", true, + "<h1 class=\"bar\"><a href=\"../pkg4/package-summary.html\" " + + "target=\"classFrame\">pkg4</a></h1>"); + + checkOutput("pkg4/package-summary.html", true, + "<div class=\"header\">\n" + + "<h1 title=\"Package\" " + + "class=\"title\">Package pkg4</h1>\n" + + "</div>"); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("overview-frame.html", false, + "<span><a href=\"profile-overview-frame.html\" " + + "target=\"packageListFrame\">All Profiles</a></span>"); + + checkOutput("pkg2/Class1Pkg2.html", false, + "<div class=\"subTitle\">compact1, compact2, compact3</div>"); + + checkOutput("overview-summary.html", false, + "<ul>\n" + + "<li><a href=\"compact1-summary.html\" target=\"classFrame\">" + + "compact1</a></li>\n" + + "<li><a href=\"compact2-summary.html\" " + + "target=\"classFrame\">compact2</a></li>\n" + + "<li><a href=\"" + + "compact3-summary.html\" target=\"classFrame\">compact3</a></li>\n" + + "</ul>"); + + checkFiles(false, + "profile-overview-frame.html", + "compact2-frame.html", + "pkg2/compact2-package-frame.html", + "compact2-summary.html", + "pkg5/compact3-package-summary.html"); } }
--- a/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,102 +26,98 @@ * @bug 8006124 8009684 8015663 8015496 8026567 * @summary Test javadoc options support for profiles. * @author Evgeniya Stepanova - * @library ../lib/ - * @build JavadocTester TestProfilesConfiguration + * @library ../lib + * @build JavadocTester * @run main TestProfilesConfiguration */ public class TestProfilesConfiguration extends JavadocTester { - //Test information. - private static final String BUG_ID = "8006124-8009684"; - private static final String PROFILE_CONFIGURATION_BUG_ID = BUG_ID + "-3"; - private static final String NODEPR_NOPKGS_BUG_ID = BUG_ID + "-4"; - //Javadoc arguments. - private static final String[] ARGS3 = new String[]{ - "-d", PROFILE_CONFIGURATION_BUG_ID, "-sourcepath", SRC_DIR, "-nocomment", - "-keywords", "-Xprofilespath", SRC_DIR + FS + "profile-rtjar-includes.txt", - "-doctitle", "Simple doctitle", "-use", "pkg3", "pkg1", "pkg2", "pkg4", - "pkg5", "-packagesheader", "Simple packages header","pkgDeprecated" - }; - private static final String[] ARGS4 = new String[]{ - "-d", NODEPR_NOPKGS_BUG_ID, "-sourcepath", SRC_DIR, "-nocomment", "-nodeprecated", - "-keywords", "-Xprofilespath", SRC_DIR + FS + "profile-rtjar-includes-nopkgs.txt", - "-doctitle", "Simple doctitle", "-use", "-packagesheader", "Simple packages header", - "pkg1", "pkg2", "pkg3", "pkg4", "pkg5", "pkgDeprecated" - }; - private static final String[][] NODEPR_NOPKGS_TEST = { - {NODEPR_NOPKGS_BUG_ID + FS + "overview-summary.html", - "<ul>" + NL + "<li><a href=\"compact2-summary.html\" target=\"classFrame\">" + - "compact2</a></li>" + NL + "<li><a href=\"compact3-summary.html\" target=\"" + - "classFrame\">compact3</a></li>" + NL + "</ul>" - }, - {NODEPR_NOPKGS_BUG_ID + FS + "profile-overview-frame.html", - "<ul title=\"Profiles\">" + NL + "<li><a href=\"compact2-frame.html\" target=\"packageListFrame\">" + - "compact2</a></li>" + NL + "<li><a href=\"compact3-frame.html\" target=\"" + - "packageListFrame\">compact3</a></li>" + NL + "</ul>" - } - }; - private static final String[][] NODEPR_NOPKGS_NEGATED_TEST = { - {NODEPR_NOPKGS_BUG_ID + FS + "overview-summary.html", - "compact1" - } - }; - - private static final String[][] PROFILES_CONFIGURATION_TEST = { - //-use option test string fo profile view page - {PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html","<li>Use</li>" - }, - //-doctitle option test string - {PROFILE_CONFIGURATION_BUG_ID + FS + "overview-summary.html", - "<div class=\"header\">" + NL + "<h1 class=\"title\">Simple doctitle</h1>" - }, - //-packagesheader option test string fo profiles - {PROFILE_CONFIGURATION_BUG_ID + FS + "profile-overview-frame.html", - "<h1 title=\"Simple packages header\" class=\"bar\">Simple packages header</h1>" - }, - //-keywords option test string for profiles - {PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html", - "<meta name=\"keywords\" content=\"compact1 profile\">" - }, - //Deprecated information on a package - {PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html", - "<h3><a href=\"pkgDeprecated/compact1-package-summary.html\" target=\"" + - "classFrame\">pkgDeprecated</a></h3>" + NL + "<div class=\"deprecatedContent\">" + - "<span class=\"deprecatedLabel\">Deprecated.</span></div>" - } - }; - private static final String[][] PROFILES_CONFIGURATION_NEGATED_TEST = { - //-nocomments option test string - {PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html", - "<div class=\"block\"><i>Class1Pkg2.</i></div>" - } - }; - - /** - * The entry point of the test. - * - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestProfilesConfiguration tester = new TestProfilesConfiguration(); - run(tester, ARGS3, PROFILES_CONFIGURATION_TEST, - PROFILES_CONFIGURATION_NEGATED_TEST); - run(tester, ARGS4, NODEPR_NOPKGS_TEST, - NODEPR_NOPKGS_NEGATED_TEST); - tester.printSummary(); + tester.runTests(); +// tester.run(ARGS3, PROFILES_CONFIGURATION_TEST, PROFILES_CONFIGURATION_NEGATED_TEST); +// tester.run(ARGS4, NODEPR_NOPKGS_TEST, NODEPR_NOPKGS_NEGATED_TEST); +// tester.printSummary(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void testProfiles() { + javadoc("-d", "out-profiles", + "-sourcepath", testSrc, + "-nocomment", + "-keywords", + "-Xprofilespath", testSrc("profile-rtjar-includes.txt"), + "-doctitle", "Simple doctitle", + "-use", + "-packagesheader", "Simple packages header", + "pkg3", "pkg1", "pkg2", "pkg4", "pkg5", "pkgDeprecated"); + checkExit(Exit.OK); + + checkOutput("compact1-summary.html", true, + //-use option test string fo profile view page + "<li>Use</li>", + // -keywords option test string for profiles + "<meta name=\"keywords\" content=\"compact1 profile\">", + // Deprecated information on a package + "<h3><a href=\"pkgDeprecated/compact1-package-summary.html\" target=\"" + + "classFrame\">pkgDeprecated</a></h3>\n" + + "<div class=\"deprecatedContent\">" + + "<span class=\"deprecatedLabel\">Deprecated.</span></div>" + ); + + //-nocomments option test string + checkOutput("compact1-summary.html", false, + "<div class=\"block\"><i>Class1Pkg2.</i></div>" + ); + + // -doctitle option test string + checkOutput("overview-summary.html", true, + "<div class=\"header\">\n" + + "<h1 class=\"title\">Simple doctitle</h1>" + ); + + // -packagesheader option test string fo profiles + checkOutput("profile-overview-frame.html", true, + "<h1 title=\"Simple packages header\" class=\"bar\">Simple packages header</h1>" + ); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + + @Test + void testNoDeprNoPackages() { + javadoc("-d", "out-noDeprNoPackages", + "-sourcepath", testSrc, + "-nocomment", + "-nodeprecated", + "-keywords", + "-Xprofilespath", testSrc("profile-rtjar-includes-nopkgs.txt"), + "-doctitle", "Simple doctitle", + "-use", + "-packagesheader", "Simple packages header", + "pkg1", "pkg2", "pkg3", "pkg4", "pkg5", "pkgDeprecated"); + checkExit(Exit.OK); + + checkOutput("overview-summary.html", true, + "<ul>\n" + + "<li><a href=\"compact2-summary.html\" target=\"classFrame\">" + + "compact2</a></li>\n" + + "<li><a href=\"compact3-summary.html\" target=\"" + + "classFrame\">compact3</a></li>\n" + + "</ul>" + ); + + checkOutput("profile-overview-frame.html", true, + "<ul title=\"Profiles\">\n" + + "<li><a href=\"compact2-frame.html\" target=\"packageListFrame\">" + + "compact2</a></li>\n" + + "<li><a href=\"compact3-frame.html\" target=\"" + + "packageListFrame\">compact3</a></li>\n" + + "</ul>" + ); + + checkOutput("overview-summary.html", false, + "compact1" + ); + } }
--- a/test/com/sun/javadoc/testRecurseSubPackages/TestRecurseSubPackages.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testRecurseSubPackages/TestRecurseSubPackages.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,50 +26,33 @@ * @bug 4074234 * @summary Make Javadoc capable of traversing/recursing all of given subpackages. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestRecurseSubPackages * @run main TestRecurseSubPackages */ public class TestRecurseSubPackages extends JavadocTester { - private static final String BUG_ID = "4074234"; - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - "-subpackages", "pkg1", "-exclude", "pkg1.pkg2.packageToExclude" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - String[][] tests = new String[6][2]; - for (int i = 0; i < tests.length; i++) { - tests[i][0] = BUG_ID + FS + "allclasses-frame.html"; - tests[i][1] = "C" + (i+1) + ".html"; - } - String[][] negatedTests = new String[][] { - {BUG_ID + FS + "allclasses-frame.html", "DummyClass.html"} - }; + public static void main(String... args) throws Exception { TestRecurseSubPackages tester = new TestRecurseSubPackages(); - run(tester, ARGS, tests, negatedTests); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-subpackages", "pkg1", + "-exclude", "pkg1.pkg2.packageToExclude"); + checkExit(Exit.OK); + + for (int i = 1; i <= 6; i++) { + checkOutput("allclasses-frame.html", true, + "C" + i + ".html"); + } + + checkOutput("allclasses-frame.html", false, + "DummyClass.html"); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } }
--- a/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,101 +27,64 @@ * @summary Test to make sure that relative paths are redirected in the * output so that they are not broken. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestRelativeLinks * @run main TestRelativeLinks */ public class TestRelativeLinks extends JavadocTester { - //Test information. - private static final String BUG_ID = "4460354-8014636"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-use", "-sourcepath", SRC_DIR, "pkg", "pkg2" - }; - - //Input for string search tests. - private static final String[][] TEST = { - //These relative paths should stay relative because they appear - //in the right places. - {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"relative-class-link.html\">relative class link</a>"}, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"relative-field-link.html\">relative field link</a>"}, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"relative-method-link.html\">relative method link</a>"}, - {BUG_ID + FS + "pkg" + FS + "package-summary.html", - "<a href=\"relative-package-link.html\">relative package link</a>"}, - {BUG_ID + FS + "pkg" + FS + "C.html", - " <a" + NL + - " href=\"relative-multi-line-link.html\">relative-multi-line-link</a>."}, - - //These relative paths should be redirected because they are in different - //places. - - //INDEX PAGE - {BUG_ID + FS + "index-all.html", - "<a href=\"./pkg/relative-class-link.html\">relative class link</a>"}, - {BUG_ID + FS + "index-all.html", - "<a href=\"./pkg/relative-field-link.html\">relative field link</a>"}, - {BUG_ID + FS + "index-all.html", - "<a href=\"./pkg/relative-method-link.html\">relative method link</a>"}, - {BUG_ID + FS + "index-all.html", - "<a href=\"./pkg/relative-package-link.html\">relative package link</a>"}, - {BUG_ID + FS + "index-all.html", - " <a" + NL + - " href=\"./pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."}, - - - //PACKAGE USE - {BUG_ID + FS + "pkg" + FS + "package-use.html", - "<a href=\"../pkg/relative-package-link.html\">relative package link</a>."}, - {BUG_ID + FS + "pkg" + FS + "package-use.html", - "<a href=\"../pkg/relative-class-link.html\">relative class link</a>"}, - - //CLASS_USE - {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "C.html", - "<a href=\"../../pkg/relative-field-link.html\">relative field link</a>"}, - {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "C.html", - "<a href=\"../../pkg/relative-method-link.html\">relative method link</a>"}, - {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "C.html", - "<a href=\"../../pkg/relative-package-link.html\">relative package link</a>"}, - {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "C.html", - " <a" + NL + - " href=\"../../pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."}, - - //PACKAGE OVERVIEW - {BUG_ID + FS + "overview-summary.html", - "<a href=\"./pkg/relative-package-link.html\">relative package link</a>"}, - - - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestRelativeLinks tester = new TestRelativeLinks(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-use", + "-sourcepath", testSrc, + "pkg", "pkg2"); + checkExit(Exit.OK); + + // These relative paths should stay relative because they appear + // in the right places. + checkOutput("pkg/C.html", true, + "<a href=\"relative-class-link.html\">relative class link</a>", + "<a href=\"relative-field-link.html\">relative field link</a>", + "<a href=\"relative-method-link.html\">relative method link</a>", + " <a\n" + + " href=\"relative-multi-line-link.html\">relative-multi-line-link</a>."); + checkOutput("pkg/package-summary.html", true, + "<a href=\"relative-package-link.html\">relative package link</a>"); + + // These relative paths should be redirected because they are in different + // places. - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + // INDEX PAGE + checkOutput("index-all.html", true, + "<a href=\"./pkg/relative-class-link.html\">relative class link</a>", + "<a href=\"./pkg/relative-field-link.html\">relative field link</a>", + "<a href=\"./pkg/relative-method-link.html\">relative method link</a>", + "<a href=\"./pkg/relative-package-link.html\">relative package link</a>", + " <a\n" + + " href=\"./pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."); + + // PACKAGE USE + checkOutput("pkg/package-use.html", true, + "<a href=\"../pkg/relative-package-link.html\">relative package link</a>.", + "<a href=\"../pkg/relative-class-link.html\">relative class link</a>"); + + // CLASS_USE + checkOutput("pkg/class-use/C.html", true, + "<a href=\"../../pkg/relative-field-link.html\">relative field link</a>", + "<a href=\"../../pkg/relative-method-link.html\">relative method link</a>", + "<a href=\"../../pkg/relative-package-link.html\">relative package link</a>", + " <a\n" + + " href=\"../../pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."); + + // PACKAGE OVERVIEW + checkOutput("overview-summary.html", true, + "<a href=\"./pkg/relative-package-link.html\">relative package link</a>"); } }
--- a/test/com/sun/javadoc/testRepeatedAnnotations/TestRepeatedAnnotations.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testRepeatedAnnotations/TestRepeatedAnnotations.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,162 +26,125 @@ * @bug 8005092 * @summary Test repeated annotations output. * @author bpatel - * @library ../lib/ - * @build JavadocTester TestRepeatedAnnotations + * @library ../lib + * @build JavadocTester * @run main TestRepeatedAnnotations */ public class TestRepeatedAnnotations extends JavadocTester { - //Test information. - private static final String BUG_ID = "8005092"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "pkg1" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"../pkg/ContaineeSynthDoc.html\" " + - "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " + - "<a href=\"../pkg/ContaineeSynthDoc.html\" " + - "title=\"annotation in pkg\">@ContaineeSynthDoc</a>"}, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"../pkg/ContaineeRegDoc.html\" " + - "title=\"annotation in pkg\">@ContaineeRegDoc</a> " + - "<a href=\"../pkg/ContaineeRegDoc.html\" " + - "title=\"annotation in pkg\">@ContaineeRegDoc</a>"}, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"../pkg/RegContainerDoc.html\" " + - "title=\"annotation in pkg\">@RegContainerDoc</a>" + - "(<a href=\"../pkg/RegContainerDoc.html#value--\">value</a>={" + - "<a href=\"../pkg/RegContaineeNotDoc.html\" " + - "title=\"annotation in pkg\">@RegContaineeNotDoc</a>," + - "<a href=\"../pkg/RegContaineeNotDoc.html\" " + - "title=\"annotation in pkg\">@RegContaineeNotDoc</a>})"}, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"../pkg/ContaineeSynthDoc.html\" " + - "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " + - "<a href=\"../pkg/ContaineeSynthDoc.html\" " + - "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " + - "<a href=\"../pkg/ContaineeSynthDoc.html\" " + - "title=\"annotation in pkg\">@ContaineeSynthDoc</a>"}, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"../pkg/ContainerSynthDoc.html\" " + - "title=\"annotation in pkg\">@ContainerSynthDoc</a>(" + - "<a href=\"../pkg/ContainerSynthDoc.html#value--\">value</a>=" + - "<a href=\"../pkg/ContaineeSynthDoc.html\" " + - "title=\"annotation in pkg\">@ContaineeSynthDoc</a>)"}, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"../pkg/ContaineeSynthDoc.html\" " + - "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " + - "<a href=\"../pkg/ContaineeSynthDoc.html\" " + - "title=\"annotation in pkg\">@ContaineeSynthDoc</a>"}, - - {BUG_ID + FS + "pkg" + FS + "D.html", - "<a href=\"../pkg/RegDoc.html\" title=\"annotation in pkg\">@RegDoc</a>" + - "(<a href=\"../pkg/RegDoc.html#x--\">x</a>=1)"}, - {BUG_ID + FS + "pkg" + FS + "D.html", - "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>" + - "(<a href=\"../pkg/RegArryDoc.html#y--\">y</a>=1)"}, - {BUG_ID + FS + "pkg" + FS + "D.html", - "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>" + - "(<a href=\"../pkg/RegArryDoc.html#y--\">y</a>={1,2})"}, - {BUG_ID + FS + "pkg" + FS + "D.html", - "<a href=\"../pkg/NonSynthDocContainer.html\" " + - "title=\"annotation in pkg\">@NonSynthDocContainer</a>" + - "(<a href=\"../pkg/NonSynthDocContainer.html#value--\">value</a>=" + - "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>)"}, - - {BUG_ID + FS + "pkg1" + FS + "C.html", - "<a href=\"../pkg1/RegContainerValDoc.html\" " + - "title=\"annotation in pkg1\">@RegContainerValDoc</a>" + - "(<a href=\"../pkg1/RegContainerValDoc.html#value--\">value</a>={" + - "<a href=\"../pkg1/RegContaineeNotDoc.html\" " + - "title=\"annotation in pkg1\">@RegContaineeNotDoc</a>," + - "<a href=\"../pkg1/RegContaineeNotDoc.html\" " + - "title=\"annotation in pkg1\">@RegContaineeNotDoc</a>}," + - "<a href=\"../pkg1/RegContainerValDoc.html#y--\">y</a>=3)"}, - {BUG_ID + FS + "pkg1" + FS + "C.html", - "<a href=\"../pkg1/ContainerValDoc.html\" " + - "title=\"annotation in pkg1\">@ContainerValDoc</a>" + - "(<a href=\"../pkg1/ContainerValDoc.html#value--\">value</a>={" + - "<a href=\"../pkg1/ContaineeNotDoc.html\" " + - "title=\"annotation in pkg1\">@ContaineeNotDoc</a>," + - "<a href=\"../pkg1/ContaineeNotDoc.html\" " + - "title=\"annotation in pkg1\">@ContaineeNotDoc</a>}," + - "<a href=\"../pkg1/ContainerValDoc.html#x--\">x</a>=1)"} - }; - - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"../pkg/RegContaineeDoc.html\" " + - "title=\"annotation in pkg\">@RegContaineeDoc</a> " + - "<a href=\"../pkg/RegContaineeDoc.html\" " + - "title=\"annotation in pkg\">@RegContaineeDoc</a>"}, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"../pkg/RegContainerNotDoc.html\" " + - "title=\"annotation in pkg\">@RegContainerNotDoc</a>" + - "(<a href=\"../pkg/RegContainerNotDoc.html#value--\">value</a>={" + - "<a href=\"../pkg/RegContaineeNotDoc.html\" " + - "title=\"annotation in pkg\">@RegContaineeNotDoc</a>," + - "<a href=\"../pkg/RegContaineeNotDoc.html\" " + - "title=\"annotation in pkg\">@RegContaineeNotDoc</a>})"}, - - {BUG_ID + FS + "pkg1" + FS + "C.html", - "<a href=\"../pkg1/ContaineeSynthDoc.html\" " + - "title=\"annotation in pkg1\">@ContaineeSynthDoc</a> " + - "<a href=\"../pkg1/ContaineeSynthDoc.html\" " + - "title=\"annotation in pkg1\">@ContaineeSynthDoc</a>"}, - {BUG_ID + FS + "pkg1" + FS + "C.html", - "<a href=\"../pkg1/RegContainerValNotDoc.html\" " + - "title=\"annotation in pkg1\">@RegContainerValNotDoc</a>" + - "(<a href=\"../pkg1/RegContainerValNotDoc.html#value--\">value</a>={" + - "<a href=\"../pkg1/RegContaineeDoc.html\" " + - "title=\"annotation in pkg1\">@RegContaineeDoc</a>," + - "<a href=\"../pkg1/RegContaineeDoc.html\" " + - "title=\"annotation in pkg1\">@RegContaineeDoc</a>}," + - "<a href=\"../pkg1/RegContainerValNotDoc.html#y--\">y</a>=4)"}, - {BUG_ID + FS + "pkg1" + FS + "C.html", - "<a href=\"../pkg1/ContainerValNotDoc.html\" " + - "title=\"annotation in pkg1\">@ContainerValNotDoc</a>" + - "(<a href=\"../pkg1/ContainerValNotDoc.html#value--\">value</a>={" + - "<a href=\"../pkg1/ContaineeNotDoc.html\" " + - "title=\"annotation in pkg1\">@ContaineeNotDoc</a>," + - "<a href=\"../pkg1/ContaineeNotDoc.html\" " + - "title=\"annotation in pkg1\">@ContaineeNotDoc</a>}," + - "<a href=\"../pkg1/ContainerValNotDoc.html#x--\">x</a>=2)"}, - {BUG_ID + FS + "pkg1" + FS + "C.html", - "<a href=\"../pkg1/ContainerSynthNotDoc.html\" " + - "title=\"annotation in pkg1\">@ContainerSynthNotDoc</a>(" + - "<a href=\"../pkg1/ContainerSynthNotDoc.html#value--\">value</a>=" + - "<a href=\"../pkg1/ContaineeSynthDoc.html\" " + - "title=\"annotation in pkg1\">@ContaineeSynthDoc</a>)"} - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestRepeatedAnnotations tester = new TestRepeatedAnnotations(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg", "pkg1"); + checkExit(Exit.OK); + + checkOutput("pkg/C.html", true, + "<a href=\"../pkg/ContaineeSynthDoc.html\" " + + "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " + + "<a href=\"../pkg/ContaineeSynthDoc.html\" " + + "title=\"annotation in pkg\">@ContaineeSynthDoc</a>", + "<a href=\"../pkg/ContaineeRegDoc.html\" " + + "title=\"annotation in pkg\">@ContaineeRegDoc</a> " + + "<a href=\"../pkg/ContaineeRegDoc.html\" " + + "title=\"annotation in pkg\">@ContaineeRegDoc</a>", + "<a href=\"../pkg/RegContainerDoc.html\" " + + "title=\"annotation in pkg\">@RegContainerDoc</a>" + + "(<a href=\"../pkg/RegContainerDoc.html#value--\">value</a>={" + + "<a href=\"../pkg/RegContaineeNotDoc.html\" " + + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>," + + "<a href=\"../pkg/RegContaineeNotDoc.html\" " + + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>})", + "<a href=\"../pkg/ContaineeSynthDoc.html\" " + + "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " + + "<a href=\"../pkg/ContaineeSynthDoc.html\" " + + "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " + + "<a href=\"../pkg/ContaineeSynthDoc.html\" " + + "title=\"annotation in pkg\">@ContaineeSynthDoc</a>", + "<a href=\"../pkg/ContainerSynthDoc.html\" " + + "title=\"annotation in pkg\">@ContainerSynthDoc</a>(" + + "<a href=\"../pkg/ContainerSynthDoc.html#value--\">value</a>=" + + "<a href=\"../pkg/ContaineeSynthDoc.html\" " + + "title=\"annotation in pkg\">@ContaineeSynthDoc</a>)", + "<a href=\"../pkg/ContaineeSynthDoc.html\" " + + "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " + + "<a href=\"../pkg/ContaineeSynthDoc.html\" " + + "title=\"annotation in pkg\">@ContaineeSynthDoc</a>"); + + checkOutput("pkg/D.html", true, + "<a href=\"../pkg/RegDoc.html\" title=\"annotation in pkg\">@RegDoc</a>" + + "(<a href=\"../pkg/RegDoc.html#x--\">x</a>=1)", + "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>" + + "(<a href=\"../pkg/RegArryDoc.html#y--\">y</a>=1)", + "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>" + + "(<a href=\"../pkg/RegArryDoc.html#y--\">y</a>={1,2})", + "<a href=\"../pkg/NonSynthDocContainer.html\" " + + "title=\"annotation in pkg\">@NonSynthDocContainer</a>" + + "(<a href=\"../pkg/NonSynthDocContainer.html#value--\">value</a>=" + + "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>)"); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg1/C.html", true, + "<a href=\"../pkg1/RegContainerValDoc.html\" " + + "title=\"annotation in pkg1\">@RegContainerValDoc</a>" + + "(<a href=\"../pkg1/RegContainerValDoc.html#value--\">value</a>={" + + "<a href=\"../pkg1/RegContaineeNotDoc.html\" " + + "title=\"annotation in pkg1\">@RegContaineeNotDoc</a>," + + "<a href=\"../pkg1/RegContaineeNotDoc.html\" " + + "title=\"annotation in pkg1\">@RegContaineeNotDoc</a>}," + + "<a href=\"../pkg1/RegContainerValDoc.html#y--\">y</a>=3)", + "<a href=\"../pkg1/ContainerValDoc.html\" " + + "title=\"annotation in pkg1\">@ContainerValDoc</a>" + + "(<a href=\"../pkg1/ContainerValDoc.html#value--\">value</a>={" + + "<a href=\"../pkg1/ContaineeNotDoc.html\" " + + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>," + + "<a href=\"../pkg1/ContaineeNotDoc.html\" " + + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>}," + + "<a href=\"../pkg1/ContainerValDoc.html#x--\">x</a>=1)"); + + checkOutput("pkg/C.html", false, + "<a href=\"../pkg/RegContaineeDoc.html\" " + + "title=\"annotation in pkg\">@RegContaineeDoc</a> " + + "<a href=\"../pkg/RegContaineeDoc.html\" " + + "title=\"annotation in pkg\">@RegContaineeDoc</a>", + "<a href=\"../pkg/RegContainerNotDoc.html\" " + + "title=\"annotation in pkg\">@RegContainerNotDoc</a>" + + "(<a href=\"../pkg/RegContainerNotDoc.html#value--\">value</a>={" + + "<a href=\"../pkg/RegContaineeNotDoc.html\" " + + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>," + + "<a href=\"../pkg/RegContaineeNotDoc.html\" " + + "title=\"annotation in pkg\">@RegContaineeNotDoc</a>})"); + + checkOutput("pkg1/C.html", false, + "<a href=\"../pkg1/ContaineeSynthDoc.html\" " + + "title=\"annotation in pkg1\">@ContaineeSynthDoc</a> " + + "<a href=\"../pkg1/ContaineeSynthDoc.html\" " + + "title=\"annotation in pkg1\">@ContaineeSynthDoc</a>", + "<a href=\"../pkg1/RegContainerValNotDoc.html\" " + + "title=\"annotation in pkg1\">@RegContainerValNotDoc</a>" + + "(<a href=\"../pkg1/RegContainerValNotDoc.html#value--\">value</a>={" + + "<a href=\"../pkg1/RegContaineeDoc.html\" " + + "title=\"annotation in pkg1\">@RegContaineeDoc</a>," + + "<a href=\"../pkg1/RegContaineeDoc.html\" " + + "title=\"annotation in pkg1\">@RegContaineeDoc</a>}," + + "<a href=\"../pkg1/RegContainerValNotDoc.html#y--\">y</a>=4)", + "<a href=\"../pkg1/ContainerValNotDoc.html\" " + + "title=\"annotation in pkg1\">@ContainerValNotDoc</a>" + + "(<a href=\"../pkg1/ContainerValNotDoc.html#value--\">value</a>={" + + "<a href=\"../pkg1/ContaineeNotDoc.html\" " + + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>," + + "<a href=\"../pkg1/ContaineeNotDoc.html\" " + + "title=\"annotation in pkg1\">@ContaineeNotDoc</a>}," + + "<a href=\"../pkg1/ContainerValNotDoc.html#x--\">x</a>=2)", + "<a href=\"../pkg1/ContainerSynthNotDoc.html\" " + + "title=\"annotation in pkg1\">@ContainerSynthNotDoc</a>(" + + "<a href=\"../pkg1/ContainerSynthNotDoc.html#value--\">value</a>=" + + "<a href=\"../pkg1/ContaineeSynthDoc.html\" " + + "title=\"annotation in pkg1\">@ContaineeSynthDoc</a>)"); } }
--- a/test/com/sun/javadoc/testReturnTag/TestReturnTag.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testReturnTag/TestReturnTag.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,29 +26,13 @@ * @bug 4490068 * @summary Warn when a return tag is used on a method without a return type. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestReturnTag * @run main TestReturnTag */ public class TestReturnTag extends JavadocTester { - //Test information. - private static final String BUG_ID = "4490068"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-Xdoclint:none", "-d", BUG_ID, "-sourcepath", SRC_DIR, SRC_DIR + FS + "TestReturnTag.java" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {WARNING_OUTPUT, - "warning - @return tag cannot be used in method with void return type."} - }; - private static final String[][] NEGATED_TEST = NO_TEST; - /** * Trigger warning message when return tag is used on a void method. * @@ -56,27 +40,20 @@ */ public void method() {} - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestReturnTag tester = new TestReturnTag(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void tests() { + javadoc("-Xdoclint:none", + "-d", "out", + "-sourcepath", testSrc, + testSrc("TestReturnTag.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput(Output.WARNING, true, + "warning - @return tag cannot be used in method with void return type."); } }
--- a/test/com/sun/javadoc/testSeeTag/TestSeeTag.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testSeeTag/TestSeeTag.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,55 +26,29 @@ * @bug 8017191 * @summary Javadoc is confused by at-link to imported classes outside of the set of generated packages * @author jjg - * @library ../lib/ - * @build JavadocTester TestSeeTag + * @library ../lib + * @build JavadocTester * @run main TestSeeTag */ public class TestSeeTag extends JavadocTester { - //Test information. - private static final String BUG_ID = "8017191"; - private static final String OUTPUT_DIR = BUG_ID; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg" - }; - - //Input for string search tests. - private static final String[][] TEST = { - { OUTPUT_DIR + FS + "pkg" + FS + "Test.html", - "<code>List</code>" - } - }; - private static final String[][] NEGATED_TEST = { - { OUTPUT_DIR + FS + "pkg" + FS + "Test.html", - "<code>List</code>" - } - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestSeeTag tester = new TestSeeTag(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/Test.html", true, + "<code>List</code>"); + + checkOutput("pkg/Test.html", false, + "<code>List</code>"); } }
--- a/test/com/sun/javadoc/testSerialVersionUID/TestSerialVersionUID.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testSerialVersionUID/TestSerialVersionUID.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,51 +27,25 @@ * @summary Test to make sure that the serialVersionUID is properly * documented in the serialized form. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestSerialVersionUID * @run main TestSerialVersionUID */ public class TestSerialVersionUID extends JavadocTester { - //Test information. - private static final String BUG_ID = "4525039"; - private static final String OUTPUT_DIR = "docs-" + BUG_ID; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", OUTPUT_DIR, - SRC_DIR + FS + "C.java" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {OUTPUT_DIR + FS + "serialized-form.html", "-111111111111111L"} - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestSerialVersionUID tester = new TestSerialVersionUID(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + testSrc("C.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("serialized-form.html", true, + "-111111111111111L"); } }
--- a/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,12 +21,9 @@ * questions. */ -import java.lang.*; -import java.io.*; - /* * @test - * @bug 4341304 4485668 4966728 + * @bug 4341304 4485668 4966728 8032066 * @summary Test that methods readResolve and writeReplace show * up in serialized-form.html the same way that readObject and writeObject do. * If the doclet includes readResolve and writeReplace in the serialized-form @@ -41,26 +38,76 @@ * @run main TestSerializedForm */ +import java.io.*; + public class TestSerializedForm extends JavadocTester implements Serializable { + public static void main(String... args) throws Exception { + TestSerializedForm tester = new TestSerializedForm(); + tester.runTests(); +// tester.run(ARGS, TEST, NEGATED_TEST); +// tester.run(ARGS_PRIVATE, TEST_PRIVATE, NEGATED_TEST_PRIVATE); +// tester.printSummary(); + } - private static final String BUG_ID = "4341304-4485668-4966728"; + @Test + void testDefault() { + javadoc("-d", "out-default", + "-sourcepath", testSrc, + testSrc("TestSerializedForm.java"), "pkg1"); + checkExit(Exit.OK); + + checkOutput("serialized-form.html", true, + "protected java.lang.Object readResolve()", + "protected java.lang.Object writeReplace()", + "protected java.lang.Object readObjectNoData()", + "See Also", + "<h3>Class pkg1.NestedInnerClass.InnerClass.ProNestedInnerClass " + + "extends java.lang.Object implements Serializable</h3>", + "<h3>Class pkg1.PrivateIncludeInnerClass.PriInnerClass extends " + + "java.lang.Object implements Serializable</h3>", + "<h3>Class pkg1.ProtectedInnerClass.ProInnerClass extends " + + "java.lang.Object implements Serializable</h3>"); - private static final String[][] TEST = { - {BUG_ID + FS + "serialized-form.html", - "protected java.lang.Object readResolve()"}, - {BUG_ID + FS + "serialized-form.html", - "protected java.lang.Object writeReplace()"}, - {BUG_ID + FS + "serialized-form.html", - "protected java.lang.Object readObjectNoData()"}, - {BUG_ID + FS + "serialized-form.html", - "See Also"}, - }; + checkOutput("serialized-form.html", false, + "<h3>Class <a href=\"pkg1/NestedInnerClass.InnerClass.ProNestedInnerClass.html\" " + + "title=\"class in pkg1\">pkg1.NestedInnerClass.InnerClass.ProNestedInnerClass</a> " + + "extends java.lang.Object implements Serializable</h3>", + "<h3>Class <a href=\"pkg1/PrivateInnerClass.PriInnerClass.html\" title=\"class in pkg1\">" + + "pkg1.PrivateInnerClass.PriInnerClass</a> extends java.lang.Object implements Serializable</h3>", + "<h3>Class <a href=\"pkg1/ProtectedInnerClass.ProInnerClass.html\" title=\"class in pkg1\">" + + "pkg1.ProtectedInnerClass.ProInnerClass</a> extends java.lang.Object implements Serializable</h3>", + "<h3>Class pkg1.PublicExcludeInnerClass.PubInnerClass extends java.lang.Object implements " + + "Serializable</h3>"); + } + + @Test + void testPrivate() { + javadoc("-private", + "-d", "out-private", + "-sourcepath", testSrc, + testSrc("TestSerializedForm.java"), "pkg1"); + checkExit(Exit.OK); - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - SRC_DIR + FS + "TestSerializedForm.java" - }; + checkOutput("serialized-form.html", true, + "<h3>Class <a href=\"pkg1/NestedInnerClass.InnerClass.ProNestedInnerClass.html\" " + + "title=\"class in pkg1\">pkg1.NestedInnerClass.InnerClass.ProNestedInnerClass</a> " + + "extends java.lang.Object implements Serializable</h3>", + "<h3>Class <a href=\"pkg1/PrivateIncludeInnerClass.PriInnerClass.html\" title=\"class in pkg1\">" + + "pkg1.PrivateIncludeInnerClass.PriInnerClass</a> extends java.lang.Object implements Serializable</h3>", + "<h3>Class <a href=\"pkg1/ProtectedInnerClass.ProInnerClass.html\" title=\"class in pkg1\">" + + "pkg1.ProtectedInnerClass.ProInnerClass</a> extends java.lang.Object implements Serializable</h3>"); + + checkOutput("serialized-form.html", false, + "<h3>Class pkg1.NestedInnerClass.InnerClass.ProNestedInnerClass " + + "extends java.lang.Object implements Serializable</h3>", + "<h3>Class pkg1.PrivateInnerClass.PriInnerClass extends " + + "java.lang.Object implements Serializable</h3>", + "<h3>Class pkg1.ProtectedInnerClass.ProInnerClass extends " + + "java.lang.Object implements Serializable</h3>", + "<h3>Class <a href=\"pkg1/PublicExcludeInnerClass.PubInnerClass.html\" " + + "title=\"class in pkg1\">pkg1.PublicExcludeInnerClass.PubInnerClass</a> " + + "extends java.lang.Object implements Serializable</h3>"); + } /** * @serial @@ -72,55 +119,41 @@ * The entry point of the test. * @param args the array of command line arguments. */ - public static void main(String[] args) { - TestSerializedForm tester = new TestSerializedForm(); - int actualExitCode = run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); - } /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } - - /** + * @param s ObjectInputStream. * @throws IOException when there is an I/O error. * @serial */ - private void readObject(ObjectInputStream s) {} + private void readObject(ObjectInputStream s) throws IOException {} /** + * @param s ObjectOutputStream. * @throws IOException when there is an I/O error. * @serial */ - private void writeObject(ObjectOutputStream s) {} + private void writeObject(ObjectOutputStream s) throws IOException {} /** * @throws IOException when there is an I/O error. * @serialData This is a serial data comment. + * @return an object. */ - protected Object readResolve(){return null;} + protected Object readResolve() throws IOException {return null;} /** * @throws IOException when there is an I/O error. * @serialData This is a serial data comment. + * @return an object. */ - protected Object writeReplace(){return null;} + protected Object writeReplace() throws IOException {return null;} /** * @throws IOException when there is an I/O error. * @serialData This is a serial data comment. + * @return an object. */ - protected Object readObjectNoData() { + protected Object readObjectNoData() throws IOException { return null; }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testSerializedForm/pkg1/NestedInnerClass.java Tue Nov 10 02:47:05 2020 +0000 @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package pkg1; + +import java.io.*; + +/** + * A test class where the outer class is package private and the inner class is private + * and a nested inner class is protected. + * + * @author Bhavesh Patel + */ + +class NestedInnerClass { + + private static class InnerClass { + + protected static class ProNestedInnerClass implements java.io.Serializable { + + public final int SERIALIZABLE_CONSTANT = 1; + + /** + * @param s ObjectInputStream. + * @throws IOException when there is an I/O error. + * @serial + */ + private void readObject(ObjectInputStream s) throws IOException { + } + + /** + * @param s ObjectOutputStream. + * @throws IOException when there is an I/O error. + * @serial + */ + private void writeObject(ObjectOutputStream s) throws IOException { + } + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testSerializedForm/pkg1/PrivateIncludeInnerClass.java Tue Nov 10 02:47:05 2020 +0000 @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package pkg1; + +import java.io.*; + +/** + * A test class where the outer class is package private and inner class + * is private which is included using the tag. + * + * @author Bhavesh Patel + */ + +class PrivateIncludeInnerClass { + + /** + * @serial include + */ + private static class PriInnerClass implements java.io.Serializable { + + public final int SERIALIZABLE_CONSTANT = 1; + + /** + * @param s ObjectInputStream. + * @throws IOException when there is an I/O error. + * @serial + */ + private void readObject(ObjectInputStream s) throws IOException { + } + + /** + * @param s ObjectOutputStream. + * @throws IOException when there is an I/O error. + * @serial + */ + private void writeObject(ObjectOutputStream s) throws IOException { + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testSerializedForm/pkg1/ProtectedInnerClass.java Tue Nov 10 02:47:05 2020 +0000 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package pkg1; + +import java.io.*; + +/** + * A test class where outer class is package private and the inner class is + * protected. + * + * @author Bhavesh Patel + */ + +class ProtectedInnerClass { + + protected static class ProInnerClass implements java.io.Serializable { + + public final int SERIALIZABLE_CONSTANT = 1; + + /** + * @param s ObjectInputStream. + * @throws IOException when there is an I/O error. + * @serial + */ + private void readObject(ObjectInputStream s) throws IOException { + } + + /** + * @param s ObjectOutputStream. + * @throws IOException when there is an I/O error. + * @serial + */ + private void writeObject(ObjectOutputStream s) throws IOException { + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testSerializedForm/pkg1/PublicExcludeInnerClass.java Tue Nov 10 02:47:05 2020 +0000 @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package pkg1; + +import java.io.*; + +/** + * A test class where the outer class is package private and inner class + * is public which is excluded using the tag. + * + * @author Bhavesh Patel + */ + +class PublicExcludeInnerClass { + + /** + * @serial exclude + */ + public static class PubInnerClass implements java.io.Serializable { + + public final int SERIALIZABLE_CONSTANT = 1; + + /** + * @param s ObjectInputStream. + * @throws IOException when there is an I/O error. + * @serial + */ + private void readObject(ObjectInputStream s) throws IOException { + } + + /** + * @param s ObjectOutputStream. + * @throws IOException when there is an I/O error. + * @serial + */ + private void writeObject(ObjectOutputStream s) throws IOException { + } + } +}
--- a/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,114 +28,142 @@ * @bug 6802694 8025633 8026567 * @summary This test verifies deprecation info in serialized-form.html. * @author Bhavesh Patel - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestSerializedFormDeprecationInfo * @run main TestSerializedFormDeprecationInfo */ public class TestSerializedFormDeprecationInfo extends JavadocTester { - private static final String BUG_ID = "6802694"; + public static void main(String... args) throws Exception { + TestSerializedFormDeprecationInfo tester = new TestSerializedFormDeprecationInfo(); + tester.runTests(); + } + + @Test + void testDefault() { + javadoc("-d", "out-default", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.FAILED); // TODO: should be OK + + checkCommentDeprecated(true); + checkNoComment(false); + } + + @Test + void testNoComment() { + javadoc("-d", "out-nocmnt", + "-nocomment", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.FAILED); // TODO: should be OK + + checkNoComment(true); + checkCommentDeprecated(false); + } + + @Test + void testNoDeprecated() { + javadoc("-d", "out-nodepr", + "-nodeprecated", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.FAILED); // TODO: should be OK + + checkNoDeprecated(true); + checkNoCommentNoDeprecated(false); + } + + @Test + void testNoCommentNoDeprecated() { + javadoc("-d", "out-nocmnt-nodepr", + "-nocomment", + "-nodeprecated", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.FAILED); // TODO: should be OK + checkNoCommentNoDeprecated(true); + checkNoDeprecated(false); + } // Test for normal run of javadoc. The serialized-form.html should // display the inline comments, tags and deprecation information if any. - private static final String[][] TEST_CMNT_DEPR = { - {BUG_ID + FS + "serialized-form.html", "<dl>" + NL + - "<dt><span class=\"throwsLabel\">Throws:</span></dt>" + NL + "<dd><code>" + - "java.io.IOException</code></dd>"+ NL + "<dt><span class=\"seeLabel\">See Also:</span>" + - "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" + - " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL + - " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + - "<div class=\"block\">This field indicates whether the C1 " + - "is undecorated.</div>" + NL + " " + NL + - "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL + - "<dd>1.4</dd>" + NL + "<dt><span class=\"seeLabel\">See Also:</span>" + - "</dt>" + NL + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>C1.setUndecorated(boolean)</code></a></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" + - " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL + - " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + - "<div class=\"block\">Reads the object stream.</div>" + NL + - "<dl>" + NL + "<dt><span class=\"throwsLabel\">Throws:</span></dt>" + NL + "<dd><code><code>" + - "IOException</code></code></dd>" + NL + - "<dd><code>java.io.IOException</code></dd>" + NL + "</dl>"}, - {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated.</span>" + - " </div>" + NL + "<div class=\"block\">" + - "The name for this class.</div>"}}; + void checkCommentDeprecated(boolean expectFound) { + checkOutput("serialized-form.html", expectFound, + "<dl>\n" + + "<dt><span class=\"throwsLabel\">Throws:</span></dt>\n" + + "<dd><code>" + + "java.io.IOException</code></dd>\n" + + "<dt><span class=\"seeLabel\">See Also:</span>" + + "</dt>\n" + + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>C1.setUndecorated(boolean)</code></a></dd>\n" + + "</dl>", + "<span class=\"deprecatedLabel\">Deprecated.</span>" + + " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" + + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>setUndecorated(boolean)</code></a>.</span></div>\n" + + "<div class=\"block\">This field indicates whether the C1 " + + "is undecorated.</div>\n" + + " \n" + + "<dl>\n" + + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" + + "<dd>1.4</dd>\n" + + "<dt><span class=\"seeLabel\">See Also:</span>" + + "</dt>\n" + + "<dd><a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>C1.setUndecorated(boolean)</code></a></dd>\n" + + "</dl>", + "<span class=\"deprecatedLabel\">Deprecated.</span>" + + " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by\n" + + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>setUndecorated(boolean)</code></a>.</span></div>\n" + + "<div class=\"block\">Reads the object stream.</div>\n" + + "<dl>\n" + + "<dt><span class=\"throwsLabel\">Throws:</span></dt>\n" + + "<dd><code><code>" + + "IOException</code></code></dd>\n" + + "<dd><code>java.io.IOException</code></dd>\n" + + "</dl>", + "<span class=\"deprecatedLabel\">Deprecated.</span>" + + " </div>\n" + + "<div class=\"block\">" + + "The name for this class.</div>"); + } // Test with -nocomment option. The serialized-form.html should // not display the inline comments and tags but should display deprecation // information if any. - private static final String[][] TEST_NOCMNT = { - {BUG_ID + FS + "serialized-form.html", "<pre>boolean undecorated</pre>" + NL + - "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> <span class=\"deprecationComment\">" + - "As of JDK version 1.5, replaced by" + NL + - " <a href=\"pkg1/C1.html#setUndecorated-boolean-\"><code>" + - "setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"}, - {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">" + - "Deprecated.</span> <span class=\"deprecationComment\">As of JDK version" + - " 1.5, replaced by" + NL + - " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + - "<code>setUndecorated(boolean)</code></a>.</span></div>" + NL + "</li>"}}; + void checkNoComment(boolean expectFound) { + checkOutput("serialized-form.html", expectFound, + "<pre>boolean undecorated</pre>\n" + + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> <span class=\"deprecationComment\">" + + "As of JDK version 1.5, replaced by\n" + + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\"><code>" + + "setUndecorated(boolean)</code></a>.</span></div>\n" + + "</li>", + "<span class=\"deprecatedLabel\">" + + "Deprecated.</span> <span class=\"deprecationComment\">As of JDK version" + + " 1.5, replaced by\n" + + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + + "<code>setUndecorated(boolean)</code></a>.</span></div>\n" + + "</li>"); + } // Test with -nodeprecated option. The serialized-form.html should // ignore the -nodeprecated tag and display the deprecation info. This // test is similar to the normal run of javadoc in which inline comment, tags // and deprecation information will be displayed. - private static final String[][] TEST_NODEPR = TEST_CMNT_DEPR; + void checkNoDeprecated(boolean expectFound) { + checkCommentDeprecated(expectFound); + } // Test with -nodeprecated and -nocomment options. The serialized-form.html should // ignore the -nodeprecated tag and display the deprecation info but should not // display the inline comments and tags. This test is similar to the test with // -nocomment option. - private static final String[][] TEST_NOCMNT_NODEPR = TEST_NOCMNT; - - private static final String[] ARGS1 = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"}; - - private static final String[] ARGS2 = - new String[] { - "-d", BUG_ID, "-nocomment", "-sourcepath", SRC_DIR, "pkg1"}; - - private static final String[] ARGS3 = - new String[] { - "-d", BUG_ID, "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"}; - - private static final String[] ARGS4 = - new String[] { - "-d", BUG_ID, "-nocomment", "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestSerializedFormDeprecationInfo tester = new TestSerializedFormDeprecationInfo(); - tester.exactNewlineMatch = false; - run(tester, ARGS1, TEST_CMNT_DEPR, TEST_NOCMNT); - run(tester, ARGS2, TEST_NOCMNT, TEST_CMNT_DEPR); - run(tester, ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR); - run(tester, ARGS4, TEST_NOCMNT_NODEPR, TEST_NODEPR); - tester.printSummary(); - } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + void checkNoCommentNoDeprecated(boolean expectFound) { + checkNoComment(expectFound); } }
--- a/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,63 +24,38 @@ /* * @test * @bug 4695326 4750173 4920381 8026567 - * @summary Test the declarartion of simple tags using -tag. Verify that + * @summary Test the declaration of simple tags using -tag. Verify that * "-tag name" is a shortcut for "-tag name:a:Name:". Also verity that * you can escape the ":" character with a back slash so that it is not * considered a separator when parsing the simple tag argument. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestSimpleTag * @run main TestSimpleTag */ public class TestSimpleTag extends JavadocTester { - private static final String BUG_ID = "4695326-4750173-4920381"; - - private static final String[][] TEST = - new String[][] { - {"./" + BUG_ID + "/C.html", - "<span class=\"simpleTagLabel\">Todo:</span>"}, - {"./" + BUG_ID + "/C.html", - "<span class=\"simpleTagLabel\">EJB Beans:</span>"}, - {"./" + BUG_ID + "/C.html", - "<span class=\"simpleTagLabel\">Regular Tag:</span>"}, - {"./" + BUG_ID + "/C.html", - "<span class=\"simpleTagLabel\">Back-Slash-Tag:</span>"}, - }; - - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - "-tag", "todo", - "-tag", "ejb\\:bean:a:EJB Beans:", - "-tag", "regular:a:Regular Tag:", - "-tag", "back-slash\\:tag\\\\:a:Back-Slash-Tag:", - SRC_DIR + FS + "C.java" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestSimpleTag tester = new TestSimpleTag(); - run(tester, ARGS, TEST, NO_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-tag", "todo", + "-tag", "ejb\\:bean:a:EJB Beans:", + "-tag", "regular:a:Regular Tag:", + "-tag", "back-slash\\:tag\\\\:a:Back-Slash-Tag:", + testSrc("C.java")); + checkExit(Exit.FAILED); // TODO: investigate why failed - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("C.html", true, + "<span class=\"simpleTagLabel\">Todo:</span>", + "<span class=\"simpleTagLabel\">EJB Beans:</span>", + "<span class=\"simpleTagLabel\">Regular Tag:</span>", + "<span class=\"simpleTagLabel\">Back-Slash-Tag:</span>"); } }
--- a/test/com/sun/javadoc/testSimpleTagExclude/TestSimpleTagExclude.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testSimpleTagExclude/TestSimpleTagExclude.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,47 +27,27 @@ * @summary Test the parsing of the -tag option. The user should be able to * exclude a simple tag by using -tag tagname:X * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestSimpleTagExclude * @run main TestSimpleTagExclude */ public class TestSimpleTagExclude extends JavadocTester { - private static final String BUG_ID = "4628181"; - private static final String[][] TEST = NO_TEST; - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "DummyClass.html", "todo"} - }; - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-tag", "todo:X", - SRC_DIR + FS + "DummyClass.java" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestSimpleTagExclude tester = new TestSimpleTagExclude(); - if (run(tester, ARGS, TEST, NEGATED_TEST) != 0) { - throw new Error("Javadoc failed to execute."); - } - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-tag", "todo:X", + testSrc("DummyClass.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("DummyClass.html", false, + "todo"); } }
--- a/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,56 +25,40 @@ * @test * @bug 8008768 8026567 * @summary Using {@inheritDoc} in simple tag defined via -tag fails - * @library ../lib/ - * @build JavadocTester TestSimpleTagInherit + * @library ../lib + * @build JavadocTester * @run main TestSimpleTagInherit */ public class TestSimpleTagInherit extends JavadocTester { - //Test information. - private static final String BUG_ID = "8008768"; - private static final String OUTPUT_DIR = BUG_ID; - //Javadoc arguments. private static final String[] ARGS = new String[] { - "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, - "-tag", "custom:optcm:<em>Custom:</em>", - "p" + }; //Input for string search tests. private static final String[][] TEST = { - { BUG_ID + FS + "p" + FS + "TestClass.html", - "<dt><span class=\"simpleTagLabel\"><em>Custom:</em></span></dt>" + NL + - "<dd>doc for BaseClass class</dd>" }, - { BUG_ID + FS + "p" + FS + "TestClass.html", - "<dt><span class=\"simpleTagLabel\"><em>Custom:</em></span></dt>" + NL + - "<dd>doc for BaseClass method</dd>" } + { } }; - private static final String[][] NEGATED_TEST = NO_TEST; - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestSimpleTagInherit tester = new TestSimpleTagInherit(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-tag", "custom:optcm:<em>Custom:</em>", + "p"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("p/TestClass.html", true, + "<dt><span class=\"simpleTagLabel\"><em>Custom:</em></span></dt>\n" + + "<dd>doc for BaseClass class</dd>", + "<dt><span class=\"simpleTagLabel\"><em>Custom:</em></span></dt>\n" + + "<dd>doc for BaseClass method</dd>"); } }
--- a/test/com/sun/javadoc/testSinceTag/TestSinceTag.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testSinceTag/TestSinceTag.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,59 +26,49 @@ * @bug 7180906 8026567 * @summary Test to make sure that the since tag works correctly * @author Bhavesh Patel - * @library ../lib/ - * @build JavadocTester TestSinceTag + * @library ../lib + * @build JavadocTester * @run main TestSinceTag */ public class TestSinceTag extends JavadocTester { - //Test information. - private static final String BUG_ID = "7180906"; - - //Javadoc arguments. - private static final String[] ARGS1 = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1" - }; - - private static final String[] ARGS2 = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-nosince", "pkg1" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", - "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL + - "<dd>JDK1.0</dd>" - }, - {BUG_ID + FS + "serialized-form.html", - "<dl>" + NL + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>" + NL + - "<dd>1.4</dd>" - } - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestSinceTag tester = new TestSinceTag(); - run(tester, ARGS1, TEST, NO_TEST); - run(tester, ARGS2, NO_TEST, TEST); + tester.runTests(); tester.printSummary(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void testSince() { + javadoc("-d", "out-since", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.FAILED); // TODO: investigate + + checkSince(true); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void testNoSince() { + javadoc("-d", "out-nosince", + "-sourcepath", testSrc, + "-nosince", + "pkg1"); + checkExit(Exit.FAILED); // TODO: investigate + + checkSince(false); + } + + void checkSince(boolean on) { + checkOutput("pkg1/C1.html", on, + "<dl>\n" + + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" + + "<dd>JDK1.0</dd>"); + + checkOutput("serialized-form.html", on, + "<dl>\n" + + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" + + "<dd>1.4</dd>"); } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testSingleQuotedLink/TestSingleQuotedLink.java Tue Nov 10 02:47:05 2020 +0000 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 6457406 + * @summary Verify that a link in single quotes copied to the class-use page as is. + * @author Yuri Nesterenko + * @library ../lib + * @build JavadocTester + * @run main TestSingleQuotedLink + */ +public class TestSingleQuotedLink extends JavadocTester { + + public static void main(String... args) throws Exception { + TestSingleQuotedLink tester = new TestSingleQuotedLink(); + tester.runTests(); + } + + @Test + void run() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-use", + "pkg1"); + checkExit(Exit.OK); + + // We are testing the redirection algorithm with a known scenario when a + // writer is not forced to ignore it: "-use". + + checkOutput("pkg1/class-use/C1.html", true, + "<a href=\'http://download.oracle.com/javase/8/docs/technotes/guides/indexC2.html\'>"); + + checkOutput("pkg1/class-use/C1.html", false, + "pkg1/\'http://download.oracle.com/javase/8/docs/technotes/guides/indexC2.html\'>"); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testSingleQuotedLink/pkg1/C1.java Tue Nov 10 02:47:05 2020 +0000 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package pkg1; + +/** + * Class 1. This is a test. + */ +public class C1 {}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testSingleQuotedLink/pkg1/C2.java Tue Nov 10 02:47:05 2020 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package pkg1; + +/** + * Class 2 refers to <a href='http://download.oracle.com/javase/8/docs/technotes/guides/indexC2.html'>Here</a>. + * This is a single quoted link. + */ +public class C2 extends C1 {} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testSingleQuotedLink/pkg1/package.html Tue Nov 10 02:47:05 2020 +0000 @@ -0,0 +1,14 @@ +<html> +<head> +<title>javax.management package</title> +</head> +<body bgcolor="white"> + This is a test. + <p id="spec"> + <a href='http://download.oracle.com/javase/8/docs/technotes/guides/indexdocument.html'> + Another Test document 2.</a> Single quotes also but as of now, package-summary writer excluded from redirection algorithm. + + @since 1.5 + +</body> +</html>
--- a/test/com/sun/javadoc/testSourceTab/TestSourceTab.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testSourceTab/TestSourceTab.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,9 +27,8 @@ * @summary Test to make sure that the source documentation is indented properly * when -linksourcetab is used. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestSourceTab * @run main TestSourceTab */ @@ -37,53 +36,39 @@ public class TestSourceTab extends JavadocTester { - private static final String BUG_ID = "4510979"; - private static final String TMP_SRC_DIR = "tmpSrc"; - private static final String OUTPUT_DIR1 = BUG_ID + "-tabLengthEight"; - private static final String OUTPUT_DIR2 = BUG_ID + "-tabLengthFour"; - private static final String[][] TEST = NO_TEST; - private static final String[][] NEGATED_TEST = NO_TEST; - - //Run Javadoc on a source file with that is indented with a single tab per line - private static final String[] ARGS1 = - new String[] { - "-d", OUTPUT_DIR1, "-sourcepath", TMP_SRC_DIR, - "-notimestamp", "-linksource", TMP_SRC_DIR + FS + "SingleTab" + FS + "C.java" - }; - - //Run Javadoc on a source file with that is indented with a two tab per line - //If we double the tabs and decrease the tab length by a half, the output should - //be the same as the one generated above. - private static final String[] ARGS2 = - new String[] { - "-d", OUTPUT_DIR2, "-sourcepath", TMP_SRC_DIR, - "-notimestamp", "-sourcetab", "4", TMP_SRC_DIR + FS + "DoubleTab" + FS + "C.java" - }; - - //Files to diff - private static final String[][] FILES_TO_DIFF = { - {OUTPUT_DIR1 + FS + "src-html" + FS + "C.html", - OUTPUT_DIR2 + FS + "src-html" + FS + "C.html" - }, - {OUTPUT_DIR1 + FS + "C.html", - OUTPUT_DIR2 + FS + "C.html" - } - - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) throws IOException { + public static void main(String... args) throws Exception { TestSourceTab tester = new TestSourceTab(); - run(tester, ARGS1, TEST, NEGATED_TEST); - run(tester, ARGS2, TEST, NEGATED_TEST); - tester.runDiffs(FILES_TO_DIFF); + tester.runTests(); } - TestSourceTab() throws IOException { - initTabs(new File(SRC_DIR), new File(TMP_SRC_DIR)); + @Test + void test() throws Exception { + String tmpSrcDir = "tmpSrc"; + String outdir1 = "out-tabLengthEight"; + String outdir2 = "out-tabLengthFour"; + initTabs(new File(testSrc), new File(tmpSrcDir)); + + // Run Javadoc on a source file with that is indented with a single tab per line + javadoc("-d", outdir1, + "-sourcepath", tmpSrcDir, + "-notimestamp", + "-linksource", + tmpSrcDir + "/SingleTab/C.java"); + checkExit(Exit.OK); + + // Run Javadoc on a source file with that is indented with a two tab per line + // If we double the tabs and decrease the tab length by a half, the output should + // be the same as the one generated above. + javadoc("-d", outdir2, + "-sourcepath", tmpSrcDir, + "-notimestamp", + "-sourcetab", "4", + tmpSrcDir + "/DoubleTab/C.java"); + checkExit(Exit.OK); + + diff(outdir1, outdir2, + "src-html/C.html", + "C.html"); } void initTabs(File from, File to) throws IOException { @@ -99,40 +84,20 @@ String read(File f) throws IOException { StringBuilder sb = new StringBuilder(); - BufferedReader in = new BufferedReader(new FileReader(f)); - try { + try (BufferedReader in = new BufferedReader(new FileReader(f))) { String line; while ((line = in.readLine()) != null) { sb.append(line); - sb.append("\n"); + sb.append(NL); } - } finally { - in.close(); } return sb.toString(); } void write(File f, String s) throws IOException { f.getParentFile().mkdirs(); - Writer out = new FileWriter(f); - try { + try (Writer out = new FileWriter(f)) { out.write(s); - } finally { - out.close(); } } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); - } }
--- a/test/com/sun/javadoc/testStylesheet/TestStylesheet.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testStylesheet/TestStylesheet.java Tue Nov 10 02:47:05 2020 +0000 @@ -26,152 +26,133 @@ * @bug 4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461 * @summary Run tests on doclet stylesheet. * @author jamieh - * @library ../lib/ - * @build JavadocTester TestStylesheet + * @library ../lib + * @build JavadocTester * @run main TestStylesheet */ public class TestStylesheet extends JavadocTester { - //Test information. - private static final String BUG_ID = "4494033-7028815-7052425-8007338-8072461"; + public static void main(String... args) throws Exception { + TestStylesheet tester = new TestStylesheet(); + tester.runTests(); + } - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" - }; + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "stylesheet.css", - "/* Javadoc style sheet */"}, - {BUG_ID + FS + "stylesheet.css", - "/*" + NL + "Overall document style" + NL + "*/"}, - {BUG_ID + FS + "stylesheet.css", - "/*" + NL + "Heading styles" + NL + "*/"}, - {BUG_ID + FS + "stylesheet.css", - "/*" + NL + "Navigation bar styles" + NL + "*/"}, - {BUG_ID + FS + "stylesheet.css", - "body {" + NL + " background-color:#ffffff;" + NL + - " color:#353833;" + NL + - " font-family:'DejaVu Sans', Arial, Helvetica, sans-serif;" + NL + - " font-size:14px;" + NL + " margin:0;" + NL + "}"}, - {BUG_ID + FS + "stylesheet.css", - "ul {" + NL + " list-style-type:disc;" + NL + "}"}, - {BUG_ID + FS + "stylesheet.css", - ".overviewSummary caption, .memberSummary caption, .typeSummary caption," + NL + - ".useSummary caption, .constantsSummary caption, .deprecatedSummary caption {" + NL + - " position:relative;" + NL + - " text-align:left;" + NL + - " background-repeat:no-repeat;" + NL + - " color:#253441;" + NL + - " font-weight:bold;" + NL + - " clear:none;" + NL + - " overflow:hidden;" + NL + - " padding:0px;" + NL + - " padding-top:10px;" + NL + - " padding-left:1px;" + NL + - " margin:0px;" + NL + - " white-space:pre;" + NL + - "}"}, - {BUG_ID + FS + "stylesheet.css", - ".overviewSummary caption span, .memberSummary caption span, .typeSummary caption span," + NL + - ".useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span {" + NL + - " white-space:nowrap;" + NL + - " padding-top:5px;" + NL + - " padding-left:12px;" + NL + - " padding-right:12px;" + NL + - " padding-bottom:7px;" + NL + - " display:inline-block;" + NL + - " float:left;" + NL + - " background-color:#F8981D;" + NL + - " border: none;" + NL + - " height:16px;" + NL + - "}"}, - {BUG_ID + FS + "stylesheet.css", - ".memberSummary caption span.activeTableTab span {" + NL + - " white-space:nowrap;" + NL + - " padding-top:5px;" + NL + - " padding-left:12px;" + NL + - " padding-right:12px;" + NL + - " margin-right:3px;" + NL + - " display:inline-block;" + NL + - " float:left;" + NL + - " background-color:#F8981D;" + NL + - " height:16px;" + NL + - "}"}, - {BUG_ID + FS + "stylesheet.css", - ".memberSummary caption span.tableTab span {" + NL + - " white-space:nowrap;" + NL + - " padding-top:5px;" + NL + - " padding-left:12px;" + NL + - " padding-right:12px;" + NL + - " margin-right:3px;" + NL + - " display:inline-block;" + NL + - " float:left;" + NL + - " background-color:#4D7A97;" + NL + - " height:16px;" + NL + - "}"}, - {BUG_ID + FS + "stylesheet.css", - ".memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab {" + NL + - " padding-top:0px;" + NL + - " padding-left:0px;" + NL + - " padding-right:0px;" + NL + - " background-image:none;" + NL + - " float:none;" + NL + - " display:inline;" + NL + - "}"}, - {BUG_ID + FS + "stylesheet.css", - "@import url('resources/fonts/dejavu.css');"}, - // Test the formatting styles for proper content display in use and constant values pages. - {BUG_ID + FS + "stylesheet.css", - ".overviewSummary td.colFirst, .overviewSummary th.colFirst," + NL + - ".useSummary td.colFirst, .useSummary th.colFirst," + NL + - ".overviewSummary td.colOne, .overviewSummary th.colOne," + NL + - ".memberSummary td.colFirst, .memberSummary th.colFirst," + NL + - ".memberSummary td.colOne, .memberSummary th.colOne," + NL + - ".typeSummary td.colFirst{" + NL + - " width:25%;" + NL + - " vertical-align:top;" + NL + - "}"}, - {BUG_ID + FS + "stylesheet.css", - ".overviewSummary td, .memberSummary td, .typeSummary td," + NL + - ".useSummary td, .constantsSummary td, .deprecatedSummary td {" + NL + - " text-align:left;" + NL + - " padding:0px 0px 12px 10px;" + NL + - "}"}, + // TODO: most of this test seems a bit silly, since javadoc is simply + // copying in the stylesheet from the source directory + checkOutput("stylesheet.css", true, + "/* Javadoc style sheet */", + "/*\n" + + "Overall document style\n" + + "*/", + "/*\n" + + "Heading styles\n" + + "*/", + "/*\n" + + "Navigation bar styles\n" + + "*/", + "body {\n" + + " background-color:#ffffff;\n" + + " color:#353833;\n" + + " font-family:'DejaVu Sans', Arial, Helvetica, sans-serif;\n" + + " font-size:14px;\n" + + " margin:0;\n" + + "}", + "ul {\n" + + " list-style-type:disc;\n" + + "}", + ".overviewSummary caption, .memberSummary caption, .typeSummary caption,\n" + + ".useSummary caption, .constantsSummary caption, .deprecatedSummary caption {\n" + + " position:relative;\n" + + " text-align:left;\n" + + " background-repeat:no-repeat;\n" + + " color:#253441;\n" + + " font-weight:bold;\n" + + " clear:none;\n" + + " overflow:hidden;\n" + + " padding:0px;\n" + + " padding-top:10px;\n" + + " padding-left:1px;\n" + + " margin:0px;\n" + + " white-space:pre;\n" + + "}", + ".overviewSummary caption span, .memberSummary caption span, .typeSummary caption span,\n" + + ".useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span {\n" + + " white-space:nowrap;\n" + + " padding-top:5px;\n" + + " padding-left:12px;\n" + + " padding-right:12px;\n" + + " padding-bottom:7px;\n" + + " display:inline-block;\n" + + " float:left;\n" + + " background-color:#F8981D;\n" + + " border: none;\n" + + " height:16px;\n" + + "}", + ".memberSummary caption span.activeTableTab span {\n" + + " white-space:nowrap;\n" + + " padding-top:5px;\n" + + " padding-left:12px;\n" + + " padding-right:12px;\n" + + " margin-right:3px;\n" + + " display:inline-block;\n" + + " float:left;\n" + + " background-color:#F8981D;\n" + + " height:16px;\n" + + "}", + ".memberSummary caption span.tableTab span {\n" + + " white-space:nowrap;\n" + + " padding-top:5px;\n" + + " padding-left:12px;\n" + + " padding-right:12px;\n" + + " margin-right:3px;\n" + + " display:inline-block;\n" + + " float:left;\n" + + " background-color:#4D7A97;\n" + + " height:16px;\n" + + "}", + // Test the formatting styles for proper content display in use and constant values pages. + ".overviewSummary td.colFirst, .overviewSummary th.colFirst,\n" + + ".useSummary td.colFirst, .useSummary th.colFirst,\n" + + ".overviewSummary td.colOne, .overviewSummary th.colOne,\n" + + ".memberSummary td.colFirst, .memberSummary th.colFirst,\n" + + ".memberSummary td.colOne, .memberSummary th.colOne,\n" + + ".typeSummary td.colFirst{\n" + + " width:25%;\n" + + " vertical-align:top;\n" + + "}", + ".overviewSummary td, .memberSummary td, .typeSummary td,\n" + + ".useSummary td, .constantsSummary td, .deprecatedSummary td {\n" + + " text-align:left;\n" + + " padding:0px 0px 12px 10px;\n" + + "}", + ".memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab {\n" + + " padding-top:0px;\n" + + " padding-left:0px;\n" + + " padding-right:0px;\n" + + " background-image:none;\n" + + " float:none;\n" + + " display:inline;\n" + + "}", + "@import url('resources/fonts/dejavu.css');"); + // Test whether a link to the stylesheet file is inserted properly // in the class documentation. - {BUG_ID + FS + "pkg" + FS + "A.html", - "<link rel=\"stylesheet\" type=\"text/css\" " + - "href=\"../stylesheet.css\" title=\"Style\">"} - }; - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "stylesheet.css", - "* {" + NL + " margin:0;" + NL + " padding:0;" + NL + "}"} - }; + checkOutput("pkg/A.html", true, + "<link rel=\"stylesheet\" type=\"text/css\" " + + "href=\"../stylesheet.css\" title=\"Style\">"); - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestStylesheet tester = new TestStylesheet(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); - } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("stylesheet.css", false, + "* {\n" + + " margin:0;\n" + + " padding:0;\n" + + "}"); } }
--- a/test/com/sun/javadoc/testSubTitle/TestSubTitle.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testSubTitle/TestSubTitle.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,57 +26,38 @@ * @bug 7010342 * @summary Test for correct sub title generation. * @author Bhavesh Patel - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestSubTitle * @run main TestSubTitle */ public class TestSubTitle extends JavadocTester { - private static final String BUG_ID = "7010342"; - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "package-summary.html", - "<div class=\"block\">This is the description of package pkg.</div>" - }, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<div class=\"subTitle\">pkg</div>" - } - }; - private static final String[][] NEG_TEST = { - {BUG_ID + FS + "pkg" + FS + "package-summary.html", - "<p class=\"subTitle\">" + NL + "<div class=\"block\">This is the " + - "description of package pkg.</div>" + NL + "</p>" - }, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<p class=\"subTitle\">pkg</p>" - } - }; - private static final String[] ARGS = new String[]{ - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestSubTitle tester = new TestSubTitle(); - run(tester, ARGS, TEST, NEG_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); + + checkOutput("pkg/package-summary.html", true, + "<div class=\"block\">This is the description of package pkg.</div>"); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/C.html", true, + "<div class=\"subTitle\">pkg</div>"); + + checkOutput("pkg/package-summary.html", false, + "<p class=\"subTitle\">\n" + + "<div class=\"block\">This is the " + + "description of package pkg.</div>\n" + + "</p>"); + + checkOutput("pkg/C.html", false, + "<p class=\"subTitle\">pkg</p>"); } }
--- a/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,49 +28,26 @@ * "Method Summary" heading should still show up since the class * inherits methods. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestSummaryHeading * @run main TestSummaryHeading */ public class TestSummaryHeading extends JavadocTester { - //Test information. - private static final String BUG_ID = "4904036"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, SRC_DIR + FS + "C.java" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "C.html", "<h3>Method Summary</h3>"} - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestSummaryHeading tester = new TestSummaryHeading(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + testSrc("C.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("C.html", true, + "<h3>Method Summary</h3>"); } }
--- a/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,47 +27,27 @@ * @summary Test to make sure link to superclass is generated for * each class in serialized form page. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestSuperClassInSerialForm * @run main TestSuperClassInSerialForm */ public class TestSuperClassInSerialForm extends JavadocTester { - private static final String BUG_ID = "4671694"; - - private static final String[][] TEST = { - {BUG_ID + FS + "serialized-form.html", - "<a href=\"pkg/SubClass.html\" title=\"class in pkg\">pkg.SubClass</a> extends <a href=\"pkg/SuperClass.html\" title=\"class in pkg\">SuperClass</a>"} - }; - - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestSuperClassInSerialForm tester = new TestSuperClassInSerialForm(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("serialized-form.html", true, + "<a href=\"pkg/SubClass.html\" title=\"class in pkg\">pkg.SubClass</a>" + + " extends <a href=\"pkg/SuperClass.html\" title=\"class in pkg\">SuperClass</a>"); } }
--- a/test/com/sun/javadoc/testSupplementary/TestSupplementary.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testSupplementary/TestSupplementary.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,9 +27,8 @@ * @summary Test to make sure that "see" tag and "serialField" tag handle supplementary * characters correctly. This test case needs to be run in en_US locale. * @author Naoto Sato - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestSupplementary * @run main TestSupplementary */ @@ -37,48 +36,33 @@ public class TestSupplementary extends JavadocTester { - private static final String BUG_ID = "4914724"; - private static final String[][] TEST = { - {WARNING_OUTPUT, "C.java:38: warning - Tag @see:illegal character: \"119040\" in \"C#method\ud834\udd00()"}, - {WARNING_OUTPUT, "C.java:44: warning - illegal character \ud801 in @serialField tag: field\ud801\ud801 int."}, - {WARNING_OUTPUT, "C.java:44: warning - illegal character \ud834\udd7b in @serialField tag: \ud834\udd7bfield int."}, - }; - private static final String[][] NEGATED_TEST = { - {WARNING_OUTPUT, "C.java:14: warning - Tag @see:illegal character"}, - {WARNING_OUTPUT, "C.java:19: warning - Tag @see:illegal character"}, - {WARNING_OUTPUT, "C.java:24: warning - Tag @see:illegal character"}, - {WARNING_OUTPUT, "C.java:31: warning - illegal character"}, - }; - private static final String[] ARGS = new String[] { - "-locale", "en_US", "-d", BUG_ID, SRC_DIR + FS + "C.java" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { Locale saveLocale = Locale.getDefault(); try { TestSupplementary tester = new TestSupplementary(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } finally { Locale.setDefault(saveLocale); } } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-locale", "en_US", + "-d", "out", + testSrc("C.java")); + checkExit(Exit.FAILED); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput(Output.WARNING, true, + "C.java:38: warning - Tag @see:illegal character: \"119040\" in \"C#method\ud834\udd00()", + "C.java:44: warning - illegal character \ud801 in @serialField tag: field\ud801\ud801 int.", + "C.java:44: warning - illegal character \ud834\udd7b in @serialField tag: \ud834\udd7bfield int."); + + // TODO: do we need to specify the file and line number in these messages? + checkOutput(Output.WARNING, false, + "C.java:14: warning - Tag @see:illegal character", + "C.java:19: warning - Tag @see:illegal character", + "C.java:24: warning - Tag @see:illegal character", + "C.java:31: warning - illegal character"); } }
--- a/test/com/sun/javadoc/testTagHolderMethod/TestTagHolderMethod.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testTagHolderMethod/TestTagHolderMethod.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,25 +21,20 @@ * questions. */ -import com.sun.javadoc.*; - /* * @test * @bug 4706525 * @summary Determine if the new Tag.holder() method works properly. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester * @build TestTagHolderMethod * @run main TestTagHolderMethod */ -public class TestTagHolderMethod extends JavadocTester { +import com.sun.javadoc.*; - private static final String BUG_ID = "4706525"; - public static final String[] ARGS = new String[] { - "-docletpath", SRC_DIR, "-doclet", "TestTagHolderMethod", "-sourcepath", - SRC_DIR, "pkg"}; +public class TestTagHolderMethod extends JavadocTester { /** * Doclet entry point. @@ -56,14 +51,13 @@ } private static void checkHolders(Doc[] holders) throws Exception { - for (int i = 0; i < holders.length; i++) { - Doc holder = holders[i]; + for (Doc holder : holders) { Tag[] tags = holder.tags(); - for (int j = 0; j < tags.length; j++) { - if (! tags[j].holder().name().equals(holder.name())) { + for (Tag tag : tags) { + if (!tag.holder().name().equals(holder.name())) { throw new Exception("The holder method does not return the correct Doc object."); } else { - System.out.println(tags[j].name() + " is held by " + holder.name()); + System.out.println(tag.name() + " is held by " + holder.name()); } } } @@ -72,22 +66,19 @@ /** * The entry point of the test. * @param args the array of command line arguments. + * @throws Exception if the test fails */ - public static void main(String[] args) { - run(new TestTagHolderMethod(), ARGS, new String[][]{}, new String[][]{}); + public static void main(String... args) throws Exception { + JavadocTester tester = new TestTagHolderMethod(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void test() { + javadoc("-docletpath", testSrc, // unlikely to be effective + "-doclet", "TestTagHolderMethod", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); } }
--- a/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,62 +26,44 @@ * @bug 4496223 4496270 4618686 4720974 4812240 6253614 6253604 * @summary <DESC> * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestTagInheritence * @run main TestTagInheritence */ +// TODO: Inheritence should be Inheritance! fix separately as noreg-trivial public class TestTagInheritence extends JavadocTester { - private static final String BUG_ID = "4496223-4496270-4618686-4720974-4812240-6253614-6253604"; - private static final String[] ARGS = new String[] { - "-Xdoclint:none", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "firstSentence", "firstSentence2" - }; + public static void main(String... args) throws Exception { + TestTagInheritence tester = new TestTagInheritence(); + tester.runTests(); + } - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - String[][] tests = new String[42][2]; + @Test + void test() { + javadoc("-Xdoclint:none", + "-d", "out", + "-sourcepath", testSrc, + "pkg", "firstSentence", "firstSentence2"); + checkExit(Exit.OK); + //Test bad inheritDoc tag warning. - tests[0][0]= WARNING_OUTPUT; - tests[0][1] = "warning - @inheritDoc used but testBadInheritDocTag() " + - "does not override or implement any method."; + checkOutput(Output.WARNING, true, + "warning - @inheritDoc used but testBadInheritDocTag() " + + "does not override or implement any method."); //Test valid usage of inheritDoc tag. - for (int i = 1; i < tests.length-2; i++) { - tests[i][0] = BUG_ID + FS + "pkg" + FS + "TestTagInheritence.html"; - tests[i][1] = "Test " + i + " passes"; + for (int i = 1; i < 40; i++) { + checkOutput("pkg/TestTagInheritence.html", true, + "Test " + i + " passes"); } //First sentence test (6253614) - tests[tests.length - 2][0] =BUG_ID + FS + "firstSentence" + FS + - "B.html"; - tests[tests.length - 2][1] = "<div class=\"block\">First sentence.</div>"; + checkOutput("firstSentence/B.html", true, + "<div class=\"block\">First sentence.</div>"); //Another first sentence test (6253604) - tests[tests.length - 1][0] =BUG_ID + FS + "firstSentence2" + FS + - "C.html"; - tests[tests.length - 1][1] = "<div class=\"block\">First sentence.</div>"; - - TestTagInheritence tester = new TestTagInheritence(); - run(tester, ARGS, tests, NO_TEST); - tester.printSummary(); - } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("firstSentence2/C.html", true, + "<div class=\"block\">First sentence.</div>"); } }
--- a/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,47 +25,35 @@ * @test * @summary Determine if proper warning messages are printed when know. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester * @build TestTagMisuse * @run main TestTagMisuse */ public class TestTagMisuse extends JavadocTester { - private static final String BUG_ID = "no-bug-id"; - private static final String[][] TEST = { - {WARNING_OUTPUT, "warning - Tag @param cannot be used in field documentation."}, - {WARNING_OUTPUT, "warning - Tag @throws cannot be used in field documentation."}, - {WARNING_OUTPUT, "warning - Tag @return cannot be used in constructor documentation."}, - {WARNING_OUTPUT, "warning - Tag @throws cannot be used in inline documentation."}, - }; - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = new String[] { - "-Xdoclint:none", "-d", BUG_ID, SRC_DIR + FS + "TestTagMisuse.java" - }; - /** * The entry point of the test. * @param args the array of command line arguments. + * @throws Exception if the test fails */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestTagMisuse tester = new TestTagMisuse(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-Xdoclint:none", + "-d", "out", + testSrc("TestTagMisuse.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput(Output.WARNING, true, + "warning - Tag @param cannot be used in field documentation.", + "warning - Tag @throws cannot be used in field documentation.", + "warning - Tag @return cannot be used in constructor documentation.", + "warning - Tag @throws cannot be used in inline documentation."); } /**
--- a/test/com/sun/javadoc/testTagOutput/TestTagOutput.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testTagOutput/TestTagOutput.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,51 +28,32 @@ * @bug 8026370 8026567 * @summary This test checks the generated tag output. * @author Bhavesh Patel - * @library ../lib/ - * @build JavadocTester TestTagOutput + * @library ../lib + * @build JavadocTester * @run main TestTagOutput */ public class TestTagOutput extends JavadocTester { - private static final String BUG_ID = "8026370"; - private static final String[][] TEST = { - {BUG_ID + FS + "pkg1" + FS + "DeprecatedTag.html", - "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"}, - {BUG_ID + FS + "pkg1" + FS + "DeprecatedTag.html", - "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> " + - "<span class=\"deprecationComment\">Do not use this.</span></div>"}}; - - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg1" + FS + "DeprecatedTag.html", - "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated." + - "</span> <span class=\"deprecationComment\"></span></div>"}}; - - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"}; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestTagOutput tester = new TestTagOutput(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg1"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg1/DeprecatedTag.html", true, + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>", + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> " + + "<span class=\"deprecationComment\">Do not use this.</span></div>"); + + checkOutput("pkg1/DeprecatedTag.html", false, + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated." + + "</span> <span class=\"deprecationComment\"></span></div>"); } }
--- a/test/com/sun/javadoc/testTaglets/TestTaglets.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testTaglets/TestTaglets.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,69 +29,41 @@ * Run Javadoc on some sample source that uses {@inheritDoc}. Make * sure that only the first sentence shows up in the summary table. * @author jamieh - * @library ../lib/ - * @build JavadocTester - * @build TestTaglets - * @build taglets.Foo + * @library ../lib + * @build JavadocTester taglets.Foo * @run main TestTaglets */ public class TestTaglets extends JavadocTester { - //Test information. - private static final String BUG_ID = "4654308-4767038"; - private static final String OUTPUT_DIR = BUG_ID; - - //Javadoc arguments. - private static final String[] ARGS_4654308 = new String[] { - "-d", "4654308", "-tagletpath", SRC_DIR, "-taglet", "taglets.Foo", - "-sourcepath", SRC_DIR, SRC_DIR + FS + "C.java" - }; - - private static final String[] ARGS_4767038 = new String[] { - "-d", "4767038", "-sourcepath", SRC_DIR, SRC_DIR + FS + "Parent.java", - SRC_DIR + FS + "Child.java" - }; - - //Input for string search tests. - private static final String[][] TEST_4654308 = new String[][] { - {"4654308" + FS + "C.html", "<span class=\"simpleTagLabel\">Foo:</span></dt>" + - "<dd>my only method is <a href=\"C.html#method--\"><code>here" + - "</code></a></dd></dl>"} - }; - private static final String[][] NEGATED_TEST_4654308 = NO_TEST; - - private static final String[][] TEST_4767038 = new String[][] { - {"4767038" + FS + "Child.html", - "This is the first sentence."} - }; - private static final String[][] NEGATED_TEST_4767038 = NO_TEST; - - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestTaglets tester = new TestTaglets(); - run(tester, ARGS_4654308, TEST_4654308, NEGATED_TEST_4654308); - tester.printSummary(); - tester = new TestTaglets(); - run(tester, ARGS_4767038, TEST_4767038, NEGATED_TEST_4767038); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void test_4654308() { + javadoc("-d", "out-4654308", + "-tagletpath", testSrc, // TODO: probably does no good + "-taglet", "taglets.Foo", + "-sourcepath", testSrc, + testSrc("C.java")); + checkExit(Exit.OK); + + checkOutput("C.html", true, + "<span class=\"simpleTagLabel\">Foo:</span></dt>" + + "<dd>my only method is <a href=\"C.html#method--\"><code>here" + + "</code></a></dd></dl>"); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void test_4767038() { + javadoc("-d", "out-4767038", + "-sourcepath", testSrc, + testSrc("Parent.java"), testSrc("Child.java")); + checkExit(Exit.OK); + + checkOutput("Child.html", true, + "This is the first sentence."); } }
--- a/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,51 +21,32 @@ * questions. */ -/** +/* * @test * @bug 4530727 8026567 * @summary When an exception is declared in the method signature but * not documented with a throws tag, we generate a link to it in the * throws section. Make sure that the link is below a Throws heading. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestThrowsHead * @run main TestThrowsHead */ public class TestThrowsHead extends JavadocTester { - private static final String BUG_ID = "4530727"; - private static final String[][] TEST = { - {BUG_ID + FS + "C.html", "<dt><span class=\"throwsLabel\">Throws:</span>"} - }; - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = new String[] { - "-d", BUG_ID, SRC_DIR + FS + "C.java" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestThrowsHead tester = new TestThrowsHead(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + testSrc("C.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("C.html", true, + "<dt><span class=\"throwsLabel\">Throws:</span>"); } }
--- a/test/com/sun/javadoc/testThrowsInheritence/TestThrowsTagInheritence.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testThrowsInheritence/TestThrowsTagInheritence.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,51 +28,35 @@ * override the throws tags in interface. This test also verifies that throws tags are inherited properly * the case where the name of one exception is not fully qualified. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestThrowsTagInheritence * @run main TestThrowsTagInheritence */ +// TODO: should be TestThrowsInheritance! public class TestThrowsTagInheritence extends JavadocTester { - private static final String BUG_ID = "4684827-4633969"; - private static final String[][] TEST = { - //The class should not inherit the tag from the interface. - {BUG_ID + FS + "Foo.html", "Test 1 passes."} - }; - private static final String[][] NEGATED_TEST = { - //The class should not inherit the tag from the interface. - {BUG_ID + FS + "C.html", "Test 1 fails."} - - }; - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, SRC_DIR + FS + "C.java", - SRC_DIR + FS + "I.java", SRC_DIR + FS + "Foo.java", - SRC_DIR + FS + "Iface.java" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestThrowsTagInheritence tester = new TestThrowsTagInheritence(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + testSrc("C.java"), + testSrc("I.java"), + testSrc("Foo.java"), + testSrc("Iface.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + // The class should not inherit the tag from the interface. + checkOutput("Foo.html", true, + "Test 1 passes."); + + //The class should not inherit the tag from the interface. + checkOutput("C.html", false, + "Test 1 fails."); } }
--- a/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,58 +27,34 @@ * @summary Test to make sure that exceptions always show up in the * correct order. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestThrowsTag * @run main TestThrowsTag */ public class TestThrowsTag extends JavadocTester { - //Test information. - private static final String BUG_ID = "4985072"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "C.html", - "<dd><code><a href=\"../pkg/T1.html\" title=\"class in pkg\">T1</a></code> - the first throws tag.</dd>" + NL + - "<dd><code><a href=\"../pkg/T2.html\" title=\"class in pkg\">T2</a></code> - the second throws tag.</dd>" + NL + - "<dd><code><a href=\"../pkg/T3.html\" title=\"class in pkg\">T3</a></code> - the third throws tag.</dd>" + NL + - "<dd><code><a href=\"../pkg/T4.html\" title=\"class in pkg\">T4</a></code> - the fourth throws tag.</dd>" + NL + - "<dd><code><a href=\"../pkg/T5.html\" title=\"class in pkg\">T5</a></code> - the first inherited throws tag.</dd>" + NL + - "<dd><code><a href=\"../pkg/T6.html\" title=\"class in pkg\">T6</a></code> - the second inherited throws tag.</dd>" + NL + - "<dd><code><a href=\"../pkg/T7.html\" title=\"class in pkg\">T7</a></code> - the third inherited throws tag.</dd>" + NL + - "<dd><code><a href=\"../pkg/T8.html\" title=\"class in pkg\">T8</a></code> - the fourth inherited throws tag.</dd>" - }, - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestThrowsTag tester = new TestThrowsTag(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.FAILED); // TODO: investigate why failed - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/C.html", true, + "<dd><code><a href=\"../pkg/T1.html\" title=\"class in pkg\">T1</a></code> - the first throws tag.</dd>\n" + + "<dd><code><a href=\"../pkg/T2.html\" title=\"class in pkg\">T2</a></code> - the second throws tag.</dd>\n" + + "<dd><code><a href=\"../pkg/T3.html\" title=\"class in pkg\">T3</a></code> - the third throws tag.</dd>\n" + + "<dd><code><a href=\"../pkg/T4.html\" title=\"class in pkg\">T4</a></code> - the fourth throws tag.</dd>\n" + + "<dd><code><a href=\"../pkg/T5.html\" title=\"class in pkg\">T5</a></code> - the first inherited throws tag.</dd>\n" + + "<dd><code><a href=\"../pkg/T6.html\" title=\"class in pkg\">T6</a></code> - the second inherited throws tag.</dd>\n" + + "<dd><code><a href=\"../pkg/T7.html\" title=\"class in pkg\">T7</a></code> - the third inherited throws tag.</dd>\n" + + "<dd><code><a href=\"../pkg/T8.html\" title=\"class in pkg\">T8</a></code> - the fourth inherited throws tag.</dd>" + ); } }
--- a/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,56 +26,35 @@ * @bug 4714257 * @summary Test to make sure that the title attribute shows up in links. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestTitleInHref * @run main TestTitleInHref */ public class TestTitleInHref extends JavadocTester { - private static final String BUG_ID = "4714257"; - - private static final String[][] TEST = { - //Test to make sure that the title shows up in a class link. - {BUG_ID + FS + "pkg" + FS + "Links.html", "<a href=\"../pkg/Class.html\" title=\"class in pkg\">"}, - - //Test to make sure that the title shows up in an interface link. - {BUG_ID + FS + "pkg" + FS + "Links.html", "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">"}, - - //Test to make sure that the title shows up in cross link shows up - {BUG_ID + FS + "pkg" + FS + "Links.html", "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/io/File.html?is-external=true\" title=\"class or interface in java.io\"><code>This is a cross link to class File</code></a>"}, - - }; - - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - "-linkoffline", "http://java.sun.com/j2se/1.4/docs/api", - SRC_DIR, "pkg" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestTitleInHref tester = new TestTitleInHref(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + String uri = "http://java.sun.com/j2se/1.4/docs/api"; + javadoc("-d", "out", + "-sourcepath", testSrc, + "-linkoffline", uri, testSrc, + "pkg"); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/Links.html", true, + //Test to make sure that the title shows up in a class link. + "<a href=\"../pkg/Class.html\" title=\"class in pkg\">", + //Test to make sure that the title shows up in an interface link. + "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">", + //Test to make sure that the title shows up in cross link shows up + "<a href=\"" + uri + "/java/io/File.html?is-external=true\" " + + "title=\"class or interface in java.io\">" + + "<code>This is a cross link to class File</code></a>"); } }
--- a/test/com/sun/javadoc/testTopOption/TestTopOption.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testTopOption/TestTopOption.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,72 +26,44 @@ * @bug 6227616 8043186 * @summary Test the new -top option. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestTopOption * @run main TestTopOption */ public class TestTopOption extends JavadocTester { - //Test information. - private static final String BUG_ID = "6227616"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-overview", SRC_DIR + FS + "overview.html", "-use", "-top", "\u0130{@docroot}TOP TEXT", "-d", BUG_ID, "-sourcepath", - SRC_DIR, "pkg" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "TOP TEXT"}, - {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html", - "TOP TEXT"}, - - {BUG_ID + FS + "pkg" + FS + "Cl.html", - "TOP TEXT"}, - {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "Cl.html", - "TOP TEXT"}, - - {BUG_ID + FS + "pkg" + FS + "package-summary.html", - "TOP TEXT"}, - {BUG_ID + FS + "pkg" + FS + "package-use.html", - "TOP TEXT"}, - - {BUG_ID + FS + "overview-summary.html", - "TOP TEXT"}, - {BUG_ID + FS + "overview-tree.html", - "TOP TEXT"}, - {BUG_ID + FS + "constant-values.html", - "TOP TEXT"}, - {BUG_ID + FS + "help-doc.html", - "TOP TEXT"}, - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestTopOption tester = new TestTopOption(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void test() { + javadoc("-overview", testSrc("overview.html"), + "-use", + "-top", "\u0130{@docroot}TOP TEXT", + "-d", "out", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); + + checkTopText( + "pkg/AnnotationType.html", + "pkg/class-use/AnnotationType.html", + "pkg/Cl.html", + "pkg/class-use/Cl.html", + "pkg/package-summary.html", + "pkg/package-use.html", + "overview-summary.html", + "overview-tree.html", + "constant-values.html", + "help-doc.html"); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + void checkTopText(String... files) { + for (String file : files) { + checkOutput(file, true, "TOP TEXT"); + } } }
--- a/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,377 +26,327 @@ * @bug 8005091 8009686 8025633 8026567 * @summary Make sure that type annotations are displayed correctly * @author Bhavesh Patel - * @library ../lib/ + * @library ../lib * @ignore - * @build JavadocTester TestTypeAnnotations + * @build JavadocTester * @run main TestTypeAnnotations */ public class TestTypeAnnotations extends JavadocTester { - //Test information. - private static final String BUG_ID = "8005091-8009686"; + public static void main(String... args) throws Exception { + TestTypeAnnotations tester = new TestTypeAnnotations(); + tester.runTests(); + } - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-private", "typeannos" - }; + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + "-private", + "typeannos"); + checkExit(Exit.OK); - //Input for string search tests. - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[][] TEST = { // Test for type annotations on Class Extends (ClassExtends.java). - {BUG_ID + FS + "typeannos" + FS + "MyClass.html", - "extends <a href=\"../typeannos/ClassExtA.html\" title=\"annotation " + - "in typeannos\">@ClassExtA</a> <a href=\"../typeannos/ParameterizedClass.html\" " + - "title=\"class in typeannos\">ParameterizedClass</a><<a href=\"" + - "../typeannos/ClassExtB.html\" title=\"annotation in typeannos\">" + - "@ClassExtB</a> java.lang.String>" - }, - {BUG_ID + FS + "typeannos" + FS + "MyClass.html", - "implements <a href=\"../typeannos/ClassExtB.html\" title=\"" + - "annotation in typeannos\">@ClassExtB</a> java.lang.CharSequence, " + - "<a href=\"../typeannos/ClassExtA.html\" title=\"annotation in " + - "typeannos\">@ClassExtA</a> <a href=\"../typeannos/ParameterizedInterface.html\" " + - "title=\"interface in typeannos\">ParameterizedInterface</a><" + - "<a href=\"../typeannos/ClassExtB.html\" title=\"annotation in " + - "typeannos\">@ClassExtB</a> java.lang.String></pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "MyInterface.html", - "extends <a href=\"../typeannos/ClassExtA.html\" title=\"annotation " + - "in typeannos\">@ClassExtA</a> <a href=\"../typeannos/" + - "ParameterizedInterface.html\" title=\"interface in typeannos\">" + - "ParameterizedInterface</a><<a href=\"../typeannos/ClassExtA.html\" " + - "title=\"annotation in typeannos\">@ClassExtA</a> java.lang.String>, " + - "<a href=\"../typeannos/ClassExtB.html\" title=\"annotation in " + - "typeannos\">@ClassExtB</a> java.lang.CharSequence</pre>" - }, + checkOutput("typeannos/MyClass.html", true, + "extends <a href=\"../typeannos/ClassExtA.html\" title=\"annotation " + + "in typeannos\">@ClassExtA</a> <a href=\"../typeannos/ParameterizedClass.html\" " + + "title=\"class in typeannos\">ParameterizedClass</a><<a href=\"" + + "../typeannos/ClassExtB.html\" title=\"annotation in typeannos\">" + + "@ClassExtB</a> java.lang.String>", + + "implements <a href=\"../typeannos/ClassExtB.html\" title=\"" + + "annotation in typeannos\">@ClassExtB</a> java.lang.CharSequence, " + + "<a href=\"../typeannos/ClassExtA.html\" title=\"annotation in " + + "typeannos\">@ClassExtA</a> <a href=\"../typeannos/ParameterizedInterface.html\" " + + "title=\"interface in typeannos\">ParameterizedInterface</a><" + + "<a href=\"../typeannos/ClassExtB.html\" title=\"annotation in " + + "typeannos\">@ClassExtB</a> java.lang.String></pre>"); + + checkOutput("typeannos/MyInterface.html", true, + "extends <a href=\"../typeannos/ClassExtA.html\" title=\"annotation " + + "in typeannos\">@ClassExtA</a> <a href=\"../typeannos/" + + "ParameterizedInterface.html\" title=\"interface in typeannos\">" + + "ParameterizedInterface</a><<a href=\"../typeannos/ClassExtA.html\" " + + "title=\"annotation in typeannos\">@ClassExtA</a> java.lang.String>, " + + "<a href=\"../typeannos/ClassExtB.html\" title=\"annotation in " + + "typeannos\">@ClassExtB</a> java.lang.CharSequence</pre>"); // Test for type annotations on Class Parameters (ClassParameters.java). - {BUG_ID + FS + "typeannos" + FS + "ExtendsBound.html", - "class <span class=\"typeNameLabel\">ExtendsBound<K extends <a " + - "href=\"../typeannos/ClassParamA.html\" title=\"annotation in " + - "typeannos\">@ClassParamA</a> java.lang.String></span>" - }, - {BUG_ID + FS + "typeannos" + FS + "ExtendsGeneric.html", - "<pre>class <span class=\"typeNameLabel\">ExtendsGeneric<K extends " + - "<a href=\"../typeannos/ClassParamA.html\" title=\"annotation in " + - "typeannos\">@ClassParamA</a> <a href=\"../typeannos/Unannotated.html\" " + - "title=\"class in typeannos\">Unannotated</a><<a href=\"" + - "../typeannos/ClassParamB.html\" title=\"annotation in typeannos\">" + - "@ClassParamB</a> java.lang.String>></span>" - }, - {BUG_ID + FS + "typeannos" + FS + "TwoBounds.html", - "<pre>class <span class=\"typeNameLabel\">TwoBounds<K extends <a href=\"" + - "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" + - "@ClassParamA</a> java.lang.String,V extends <a href=\"../typeannos/" + - "ClassParamB.html\" title=\"annotation in typeannos\">@ClassParamB" + - "</a> java.lang.String></span>" - }, - {BUG_ID + FS + "typeannos" + FS + "Complex1.html", - "class <span class=\"typeNameLabel\">Complex1<K extends <a href=\"../" + - "typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" + - "@ClassParamA</a> java.lang.String & java.lang.Runnable></span>" - }, - {BUG_ID + FS + "typeannos" + FS + "Complex2.html", - "class <span class=\"typeNameLabel\">Complex2<K extends java.lang." + - "String & <a href=\"../typeannos/ClassParamB.html\" title=\"" + - "annotation in typeannos\">@ClassParamB</a> java.lang.Runnable></span>" - }, - {BUG_ID + FS + "typeannos" + FS + "ComplexBoth.html", - "class <span class=\"typeNameLabel\">ComplexBoth<K extends <a href=\"" + - "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\"" + - ">@ClassParamA</a> java.lang.String & <a href=\"../typeannos/" + - "ClassParamA.html\" title=\"annotation in typeannos\">@ClassParamA" + - "</a> java.lang.Runnable></span>" - }, + checkOutput("typeannos/ExtendsBound.html", true, + "class <span class=\"typeNameLabel\">ExtendsBound<K extends <a " + + "href=\"../typeannos/ClassParamA.html\" title=\"annotation in " + + "typeannos\">@ClassParamA</a> java.lang.String></span>"); + + checkOutput("typeannos/ExtendsGeneric.html", true, + "<pre>class <span class=\"typeNameLabel\">ExtendsGeneric<K extends " + + "<a href=\"../typeannos/ClassParamA.html\" title=\"annotation in " + + "typeannos\">@ClassParamA</a> <a href=\"../typeannos/Unannotated.html\" " + + "title=\"class in typeannos\">Unannotated</a><<a href=\"" + + "../typeannos/ClassParamB.html\" title=\"annotation in typeannos\">" + + "@ClassParamB</a> java.lang.String>></span>"); + + checkOutput("typeannos/TwoBounds.html", true, + "<pre>class <span class=\"typeNameLabel\">TwoBounds<K extends <a href=\"" + + "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" + + "@ClassParamA</a> java.lang.String,V extends <a href=\"../typeannos/" + + "ClassParamB.html\" title=\"annotation in typeannos\">@ClassParamB" + + "</a> java.lang.String></span>"); + + checkOutput("typeannos/Complex1.html", true, + "class <span class=\"typeNameLabel\">Complex1<K extends <a href=\"../" + + "typeannos/ClassParamA.html\" title=\"annotation in typeannos\">" + + "@ClassParamA</a> java.lang.String & java.lang.Runnable></span>"); + + checkOutput("typeannos/Complex2.html", true, + "class <span class=\"typeNameLabel\">Complex2<K extends java.lang." + + "String & <a href=\"../typeannos/ClassParamB.html\" title=\"" + + "annotation in typeannos\">@ClassParamB</a> java.lang.Runnable></span>"); + + checkOutput("typeannos/ComplexBoth.html", true, + "class <span class=\"typeNameLabel\">ComplexBoth<K extends <a href=\"" + + "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\"" + + ">@ClassParamA</a> java.lang.String & <a href=\"../typeannos/" + + "ClassParamA.html\" title=\"annotation in typeannos\">@ClassParamA" + + "</a> java.lang.Runnable></span>"); // Test for type annotations on fields (Fields.java). - {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html", - "<pre><a href=\"../typeannos/Parameterized.html\" title=\"class in " + - "typeannos\">Parameterized</a><<a href=\"../typeannos/FldA.html\" " + - "title=\"annotation in typeannos\">@FldA</a> java.lang.String,<a " + - "href=\"../typeannos/FldB.html\" title=\"annotation in typeannos\">" + - "@FldB</a> java.lang.String> bothTypeArgs</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html", - "<pre><a href=\"../typeannos/FldA.html\" title=\"annotation in " + - "typeannos\">@FldA</a> java.lang.String <a href=\"../typeannos/" + - "FldB.html\" title=\"annotation in typeannos\">@FldB</a> [] " + - "array1Deep</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html", - "<pre>java.lang.String[] <a href=\"../typeannos/FldB.html\" " + - "title=\"annotation in typeannos\">@FldB</a> [] array2SecondOld</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "DefaultScope.html", - "<pre><a href=\"../typeannos/FldD.html\" title=\"annotation in " + - "typeannos\">@FldD</a> java.lang.String <a href=\"../typeannos/" + - "FldC.html\" title=\"annotation in typeannos\">@FldC</a> <a href=\"" + - "../typeannos/FldA.html\" title=\"annotation in typeannos\">@FldA" + - "</a> [] <a href=\"../typeannos/FldC.html\" title=\"annotation in " + - "typeannos\">@FldC</a> <a href=\"../typeannos/FldB.html\" title=\"" + - "annotation in typeannos\">@FldB</a> [] array2Deep</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "ModifiedScoped.html", - "<pre>public final <a href=\"../typeannos/Parameterized.html\" " + - "title=\"class in typeannos\">Parameterized</a><<a href=\"../" + - "typeannos/FldA.html\" title=\"annotation in typeannos\">@FldA</a> " + - "<a href=\"../typeannos/Parameterized.html\" title=\"class in " + - "typeannos\">Parameterized</a><<a href=\"../typeannos/FldA.html\" " + - "title=\"annotation in typeannos\">@FldA</a> java.lang.String,<a " + - "href=\"../typeannos/FldB.html\" title=\"annotation in typeannos\">" + - "@FldB</a> java.lang.String>,<a href=\"../typeannos/FldB.html\" " + - "title=\"annotation in typeannos\">@FldB</a> java.lang.String> " + - "nestedParameterized</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "ModifiedScoped.html", - "<pre>public final <a href=\"../typeannos/FldA.html\" " + - "title=\"annotation in typeannos\">@FldA</a> java.lang.String[][] " + - "array2</pre>" - }, + checkOutput("typeannos/DefaultScope.html", true, + "<pre><a href=\"../typeannos/Parameterized.html\" title=\"class in " + + "typeannos\">Parameterized</a><<a href=\"../typeannos/FldA.html\" " + + "title=\"annotation in typeannos\">@FldA</a> java.lang.String,<a " + + "href=\"../typeannos/FldB.html\" title=\"annotation in typeannos\">" + + "@FldB</a> java.lang.String> bothTypeArgs</pre>", + + "<pre><a href=\"../typeannos/FldA.html\" title=\"annotation in " + + "typeannos\">@FldA</a> java.lang.String <a href=\"../typeannos/" + + "FldB.html\" title=\"annotation in typeannos\">@FldB</a> [] " + + "array1Deep</pre>", + + "<pre>java.lang.String[] <a href=\"../typeannos/FldB.html\" " + + "title=\"annotation in typeannos\">@FldB</a> [] array2SecondOld</pre>", + + "<pre><a href=\"../typeannos/FldD.html\" title=\"annotation in " + + "typeannos\">@FldD</a> java.lang.String <a href=\"../typeannos/" + + "FldC.html\" title=\"annotation in typeannos\">@FldC</a> <a href=\"" + + "../typeannos/FldA.html\" title=\"annotation in typeannos\">@FldA" + + "</a> [] <a href=\"../typeannos/FldC.html\" title=\"annotation in " + + "typeannos\">@FldC</a> <a href=\"../typeannos/FldB.html\" title=\"" + + "annotation in typeannos\">@FldB</a> [] array2Deep</pre>"); + + checkOutput("typeannos/ModifiedScoped.html", true, + "<pre>public final <a href=\"../typeannos/Parameterized.html\" " + + "title=\"class in typeannos\">Parameterized</a><<a href=\"../" + + "typeannos/FldA.html\" title=\"annotation in typeannos\">@FldA</a> " + + "<a href=\"../typeannos/Parameterized.html\" title=\"class in " + + "typeannos\">Parameterized</a><<a href=\"../typeannos/FldA.html\" " + + "title=\"annotation in typeannos\">@FldA</a> java.lang.String,<a " + + "href=\"../typeannos/FldB.html\" title=\"annotation in typeannos\">" + + "@FldB</a> java.lang.String>,<a href=\"../typeannos/FldB.html\" " + + "title=\"annotation in typeannos\">@FldB</a> java.lang.String> " + + "nestedParameterized</pre>", + + "<pre>public final <a href=\"../typeannos/FldA.html\" " + + "title=\"annotation in typeannos\">@FldA</a> java.lang.String[][] " + + "array2</pre>"); // Test for type annotations on method return types (MethodReturnType.java). - {BUG_ID + FS + "typeannos" + FS + "MtdDefaultScope.html", - "<pre>public <T> <a href=\"../typeannos/MRtnA.html\" " + - "title=\"annotation in typeannos\">@MRtnA</a> java.lang.String" + - " method()</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "MtdDefaultScope.html", - "<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in " + - "typeannos\">@MRtnA</a> java.lang.String <a href=\"../typeannos/" + - "MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> [] <a " + - "href=\"../typeannos/MRtnB.html\" title=\"annotation in typeannos\">" + - "@MRtnB</a> [] array2Deep()</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "MtdDefaultScope.html", - "<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in " + - "typeannos\">@MRtnA</a> java.lang.String[][] array2()</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "MtdModifiedScoped.html", - "<pre>public final <a href=\"../typeannos/MtdParameterized.html\" " + - "title=\"class in typeannos\">MtdParameterized</a><<a href=\"../" + - "typeannos/MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> " + - "<a href=\"../typeannos/MtdParameterized.html\" title=\"class in " + - "typeannos\">MtdParameterized</a><<a href=\"../typeannos/MRtnA." + - "html\" title=\"annotation in typeannos\">@MRtnA</a> java.lang." + - "String,<a href=\"../typeannos/MRtnB.html\" title=\"annotation in " + - "typeannos\">@MRtnB</a> java.lang.String>,<a href=\"../typeannos/" + - "MRtnB.html\" title=\"annotation in typeannos\">@MRtnB</a> java." + - "lang.String> nestedMtdParameterized()</pre>" - }, + checkOutput("typeannos/MtdDefaultScope.html", true, + "<pre>public <T> <a href=\"../typeannos/MRtnA.html\" " + + "title=\"annotation in typeannos\">@MRtnA</a> java.lang.String" + + " method()</pre>", + + "<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in " + + "typeannos\">@MRtnA</a> java.lang.String <a href=\"../typeannos/" + + "MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> [] <a " + + "href=\"../typeannos/MRtnB.html\" title=\"annotation in typeannos\">" + + "@MRtnB</a> [] array2Deep()</pre>", + + "<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in " + + "typeannos\">@MRtnA</a> java.lang.String[][] array2()</pre>"); + + checkOutput("typeannos/MtdModifiedScoped.html", true, + "<pre>public final <a href=\"../typeannos/MtdParameterized.html\" " + + "title=\"class in typeannos\">MtdParameterized</a><<a href=\"../" + + "typeannos/MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> " + + "<a href=\"../typeannos/MtdParameterized.html\" title=\"class in " + + "typeannos\">MtdParameterized</a><<a href=\"../typeannos/MRtnA." + + "html\" title=\"annotation in typeannos\">@MRtnA</a> java.lang." + + "String,<a href=\"../typeannos/MRtnB.html\" title=\"annotation in " + + "typeannos\">@MRtnB</a> java.lang.String>,<a href=\"../typeannos/" + + "MRtnB.html\" title=\"annotation in typeannos\">@MRtnB</a> java." + + "lang.String> nestedMtdParameterized()</pre>"); // Test for type annotations on method type parameters (MethodTypeParameters.java). - {BUG_ID + FS + "typeannos" + FS + "UnscopedUnmodified.html", - "<pre><K extends <a href=\"../typeannos/MTyParamA.html\" title=\"" + - "annotation in typeannos\">@MTyParamA</a> java.lang.String>" + - " void methodExtends()</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "UnscopedUnmodified.html", - "<pre><K extends <a href=\"../typeannos/MTyParamA.html\" title=\"" + - "annotation in typeannos\">@MTyParamA</a> <a href=\"../typeannos/" + - "MtdTyParameterized.html\" title=\"class in typeannos\">" + - "MtdTyParameterized</a><<a href=\"../typeannos/MTyParamB.html\" " + - "title=\"annotation in typeannos\">@MTyParamB</a> java.lang.String" + - ">> void nestedExtends()</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "PublicModifiedMethods.html", - "<pre>public final <K extends <a href=\"../typeannos/" + - "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> " + - "java.lang.String> void methodExtends()</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "PublicModifiedMethods.html", - "<pre>public final <K extends <a href=\"../typeannos/" + - "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> " + - "java.lang.String,V extends <a href=\"../typeannos/MTyParamA.html\" " + - "title=\"annotation in typeannos\">@MTyParamA</a> <a href=\"../" + - "typeannos/MtdTyParameterized.html\" title=\"class in typeannos\">" + - "MtdTyParameterized</a><<a href=\"../typeannos/MTyParamB.html\" " + - "title=\"annotation in typeannos\">@MTyParamB</a> java.lang.String" + - ">> void dual()</pre>" - }, + checkOutput("typeannos/UnscopedUnmodified.html", true, + "<pre><K extends <a href=\"../typeannos/MTyParamA.html\" title=\"" + + "annotation in typeannos\">@MTyParamA</a> java.lang.String>" + + " void methodExtends()</pre>", + + "<pre><K extends <a href=\"../typeannos/MTyParamA.html\" title=\"" + + "annotation in typeannos\">@MTyParamA</a> <a href=\"../typeannos/" + + "MtdTyParameterized.html\" title=\"class in typeannos\">" + + "MtdTyParameterized</a><<a href=\"../typeannos/MTyParamB.html\" " + + "title=\"annotation in typeannos\">@MTyParamB</a> java.lang.String" + + ">> void nestedExtends()</pre>"); + + checkOutput("typeannos/PublicModifiedMethods.html", true, + "<pre>public final <K extends <a href=\"../typeannos/" + + "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> " + + "java.lang.String> void methodExtends()</pre>", + + "<pre>public final <K extends <a href=\"../typeannos/" + + "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> " + + "java.lang.String,V extends <a href=\"../typeannos/MTyParamA.html\" " + + "title=\"annotation in typeannos\">@MTyParamA</a> <a href=\"../" + + "typeannos/MtdTyParameterized.html\" title=\"class in typeannos\">" + + "MtdTyParameterized</a><<a href=\"../typeannos/MTyParamB.html\" " + + "title=\"annotation in typeannos\">@MTyParamB</a> java.lang.String" + + ">> void dual()</pre>"); // Test for type annotations on parameters (Parameters.java). - {BUG_ID + FS + "typeannos" + FS + "Parameters.html", - "<pre>void unannotated(<a href=\"../typeannos/" + - "ParaParameterized.html\" title=\"class in typeannos\">" + - "ParaParameterized</a><java.lang.String,java.lang.String>" + - " a)</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "Parameters.html", - "<pre>void nestedParaParameterized(<a href=\"../typeannos/" + - "ParaParameterized.html\" title=\"class in typeannos\">" + - "ParaParameterized</a><<a href=\"../typeannos/ParamA.html\" " + - "title=\"annotation in typeannos\">@ParamA</a> <a href=\"../" + - "typeannos/ParaParameterized.html\" title=\"class in typeannos\">" + - "ParaParameterized</a><<a href=\"../typeannos/ParamA.html\" " + - "title=\"annotation in typeannos\">@ParamA</a> java.lang.String," + - "<a href=\"../typeannos/ParamB.html\" title=\"annotation in " + - "typeannos\">@ParamB</a> java.lang.String>,<a href=\"../" + - "typeannos/ParamB.html\" title=\"annotation in typeannos\">@ParamB" + - "</a> java.lang.String> a)</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "Parameters.html", - "<pre>void array2Deep(<a href=\"../typeannos/ParamA.html\" " + - "title=\"annotation in typeannos\">@ParamA</a> java.lang.String " + - "<a href=\"../typeannos/ParamA.html\" title=\"annotation in " + - "typeannos\">@ParamA</a> [] <a href=\"../typeannos/ParamB.html\" " + - "title=\"annotation in typeannos\">@ParamB</a> [] a)</pre>" - }, + checkOutput("typeannos/Parameters.html", true, + "<pre>void unannotated(<a href=\"../typeannos/" + + "ParaParameterized.html\" title=\"class in typeannos\">" + + "ParaParameterized</a><java.lang.String,java.lang.String>" + + " a)</pre>", + + "<pre>void nestedParaParameterized(<a href=\"../typeannos/" + + "ParaParameterized.html\" title=\"class in typeannos\">" + + "ParaParameterized</a><<a href=\"../typeannos/ParamA.html\" " + + "title=\"annotation in typeannos\">@ParamA</a> <a href=\"../" + + "typeannos/ParaParameterized.html\" title=\"class in typeannos\">" + + "ParaParameterized</a><<a href=\"../typeannos/ParamA.html\" " + + "title=\"annotation in typeannos\">@ParamA</a> java.lang.String," + + "<a href=\"../typeannos/ParamB.html\" title=\"annotation in " + + "typeannos\">@ParamB</a> java.lang.String>,<a href=\"../" + + "typeannos/ParamB.html\" title=\"annotation in typeannos\">@ParamB" + + "</a> java.lang.String> a)</pre>", + + "<pre>void array2Deep(<a href=\"../typeannos/ParamA.html\" " + + "title=\"annotation in typeannos\">@ParamA</a> java.lang.String " + + "<a href=\"../typeannos/ParamA.html\" title=\"annotation in " + + "typeannos\">@ParamA</a> [] <a href=\"../typeannos/ParamB.html\" " + + "title=\"annotation in typeannos\">@ParamB</a> [] a)</pre>"); // Test for type annotations on throws (Throws.java). - {BUG_ID + FS + "typeannos" + FS + "ThrDefaultUnmodified.html", - "<pre>void oneException()" + NL + - " throws <a href=\"../typeannos/ThrA.html\" title=\"" + - "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "ThrDefaultUnmodified.html", - "<pre>void twoExceptions()" + NL + - " throws <a href=\"../typeannos/ThrA.html\" title=\"" + - "annotation in typeannos\">@ThrA</a> java.lang.RuntimeException," + NL + - " <a href=\"../typeannos/ThrA.html\" title=\"" + - "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "ThrPublicModified.html", - "<pre>public final void oneException(java.lang.String a)" + NL + - " throws <a href=\"../typeannos/ThrA.html\" " + - "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "ThrPublicModified.html", - "<pre>public final void twoExceptions(java.lang.String a)" + NL + - " throws <a href=\"../typeannos/ThrA.html\" " + - "title=\"annotation in typeannos\">@ThrA</a> java.lang.RuntimeException," + NL + - " <a href=\"../typeannos/ThrA.html\" " + - "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "ThrWithValue.html", - "<pre>void oneException()" + NL + - " throws <a href=\"../typeannos/ThrB.html\" title=\"" + - "annotation in typeannos\">@ThrB</a>(<a href=\"../typeannos/" + - "ThrB.html#value--\">value</a>=\"m\") java.lang.Exception</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "ThrWithValue.html", - "<pre>void twoExceptions()" + NL + - " throws <a href=\"../typeannos/ThrB.html\" title=\"" + - "annotation in typeannos\">@ThrB</a>(<a href=\"../typeannos/" + - "ThrB.html#value--\">value</a>=\"m\") java.lang.RuntimeException," + NL + - " <a href=\"../typeannos/ThrA.html\" title=\"" + - "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>" - }, + checkOutput("typeannos/ThrDefaultUnmodified.html", true, + "<pre>void oneException()\n" + + " throws <a href=\"../typeannos/ThrA.html\" title=\"" + + "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>", + + "<pre>void twoExceptions()\n" + + " throws <a href=\"../typeannos/ThrA.html\" title=\"" + + "annotation in typeannos\">@ThrA</a> java.lang.RuntimeException,\n" + + " <a href=\"../typeannos/ThrA.html\" title=\"" + + "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>"); + + checkOutput("typeannos/ThrPublicModified.html", true, + "<pre>public final void oneException(java.lang.String a)\n" + + " throws <a href=\"../typeannos/ThrA.html\" " + + "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>", + + "<pre>public final void twoExceptions(java.lang.String a)\n" + + " throws <a href=\"../typeannos/ThrA.html\" " + + "title=\"annotation in typeannos\">@ThrA</a> java.lang.RuntimeException,\n" + + " <a href=\"../typeannos/ThrA.html\" " + + "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>"); + + checkOutput("typeannos/ThrWithValue.html", true, + "<pre>void oneException()\n" + + " throws <a href=\"../typeannos/ThrB.html\" title=\"" + + "annotation in typeannos\">@ThrB</a>(<a href=\"../typeannos/" + + "ThrB.html#value--\">value</a>=\"m\") java.lang.Exception</pre>", + + "<pre>void twoExceptions()\n" + + " throws <a href=\"../typeannos/ThrB.html\" title=\"" + + "annotation in typeannos\">@ThrB</a>(<a href=\"../typeannos/" + + "ThrB.html#value--\">value</a>=\"m\") java.lang.RuntimeException,\n" + + " <a href=\"../typeannos/ThrA.html\" title=\"" + + "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>"); // Test for type annotations on type parameters (TypeParameters.java). - {BUG_ID + FS + "typeannos" + FS + "TestMethods.html", - "<pre><K,V extends <a href=\"../typeannos/TyParaA.html\" title=\"" + - "annotation in typeannos\">@TyParaA</a> java.lang.String> " + - "void secondAnnotated()</pre>" - }, + checkOutput("typeannos/TestMethods.html", true, + "<pre><K,V extends <a href=\"../typeannos/TyParaA.html\" title=\"" + + "annotation in typeannos\">@TyParaA</a> java.lang.String> " + + "void secondAnnotated()</pre>"); // Test for type annotations on wildcard type (Wildcards.java). - {BUG_ID + FS + "typeannos" + FS + "BoundTest.html", - "<pre>void wcExtends(<a href=\"../typeannos/MyList.html\" " + - "title=\"class in typeannos\">MyList</a><? extends <a href=\"" + - "../typeannos/WldA.html\" title=\"annotation in typeannos\">@WldA" + - "</a> java.lang.String> l)</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "BoundTest.html", - "<pre><a href=\"../typeannos/MyList.html\" title=\"class in " + - "typeannos\">MyList</a><? super <a href=\"../typeannos/WldA.html\" " + - "title=\"annotation in typeannos\">@WldA</a> java.lang.String>" + - " returnWcSuper()</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "BoundWithValue.html", - "<pre>void wcSuper(<a href=\"../typeannos/MyList.html\" title=\"" + - "class in typeannos\">MyList</a><? super <a href=\"../typeannos/" + - "WldB.html\" title=\"annotation in typeannos\">@WldB</a>(<a href=\"" + - "../typeannos/WldB.html#value--\">value</a>=\"m\") java.lang." + - "String> l)</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "BoundWithValue.html", - "<pre><a href=\"../typeannos/MyList.html\" title=\"class in " + - "typeannos\">MyList</a><? extends <a href=\"../typeannos/WldB." + - "html\" title=\"annotation in typeannos\">@WldB</a>(<a href=\"../" + - "typeannos/WldB.html#value--\">value</a>=\"m\") java.lang.String" + - "> returnWcExtends()</pre>" - }, + checkOutput("typeannos/BoundTest.html", true, + "<pre>void wcExtends(<a href=\"../typeannos/MyList.html\" " + + "title=\"class in typeannos\">MyList</a><? extends <a href=\"" + + "../typeannos/WldA.html\" title=\"annotation in typeannos\">@WldA" + + "</a> java.lang.String> l)</pre>", + + "<pre><a href=\"../typeannos/MyList.html\" title=\"class in " + + "typeannos\">MyList</a><? super <a href=\"../typeannos/WldA.html\" " + + "title=\"annotation in typeannos\">@WldA</a> java.lang.String>" + + " returnWcSuper()</pre>"); + + checkOutput("typeannos/BoundWithValue.html", true, + "<pre>void wcSuper(<a href=\"../typeannos/MyList.html\" title=\"" + + "class in typeannos\">MyList</a><? super <a href=\"../typeannos/" + + "WldB.html\" title=\"annotation in typeannos\">@WldB</a>(<a href=\"" + + "../typeannos/WldB.html#value--\">value</a>=\"m\") java.lang." + + "String> l)</pre>", + + "<pre><a href=\"../typeannos/MyList.html\" title=\"class in " + + "typeannos\">MyList</a><? extends <a href=\"../typeannos/WldB." + + "html\" title=\"annotation in typeannos\">@WldB</a>(<a href=\"../" + + "typeannos/WldB.html#value--\">value</a>=\"m\") java.lang.String" + + "> returnWcExtends()</pre>"); // Test for receiver annotations (Receivers.java). - {BUG_ID + FS + "typeannos" + FS + "DefaultUnmodified.html", - "<pre>void withException(<a href=\"../typeannos/RcvrA.html\" " + - "title=\"annotation in typeannos\">@RcvrA</a> " + - "DefaultUnmodified this)" + NL + " throws java." + - "lang.Exception</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "DefaultUnmodified.html", - "<pre>java.lang.String nonVoid(<a href=\"../typeannos/RcvrA." + - "html\" title=\"annotation in typeannos\">@RcvrA</a> <a href=\"../" + - "typeannos/RcvrB.html\" title=\"annotation in typeannos\">@RcvrB" + - "</a>(<a href=\"../typeannos/RcvrB.html#value--\">value</a>=\"m\")" + - " DefaultUnmodified this)</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "DefaultUnmodified.html", - "<pre><T extends java.lang.Runnable> void accept(" + - "<a href=\"../typeannos/RcvrA.html\" title=\"annotation in " + - "typeannos\">@RcvrA</a> DefaultUnmodified this," + NL + - " T r)" + NL + - " throws java.lang.Exception</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "PublicModified.html", - "<pre>public final java.lang.String nonVoid(<a href=\"" + - "../typeannos/RcvrA.html\" title=\"annotation in typeannos\">" + - "@RcvrA</a> PublicModified this)</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "PublicModified.html", - "<pre>public final <T extends java.lang.Runnable> " + - "void accept(<a href=\"../typeannos/RcvrA.html\" title=\"" + - "annotation in typeannos\">@RcvrA</a> PublicModified this," + NL + - " T r)" + NL + - " throws java.lang.Exception</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "WithValue.html", - "<pre><T extends java.lang.Runnable> void accept(" + - "<a href=\"../typeannos/RcvrB.html\" title=\"annotation in " + - "typeannos\">@RcvrB</a>(<a href=\"../typeannos/RcvrB.html#value--\">" + - "value</a>=\"m\") WithValue this," + NL + - " T r)" + NL + - " throws java.lang.Exception</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "WithFinal.html", - "<pre>java.lang.String nonVoid(<a href=\"../typeannos/RcvrB." + - "html\" title=\"annotation in typeannos\">@RcvrB</a>(<a href=\"../" + - "typeannos/RcvrB.html#value--\">value</a>=\"m\") WithFinal" + - " this)</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "WithBody.html", - "<pre>void field(<a href=\"../typeannos/RcvrA.html\" title=\"" + - "annotation in typeannos\">@RcvrA</a> WithBody this)</pre>" - }, - {BUG_ID + FS + "typeannos" + FS + "Generic2.html", - "<pre>void test2(<a href=\"../typeannos/RcvrA.html\" title=\"" + - "annotation in typeannos\">@RcvrA</a> Generic2<X> this)</pre>" - } - }; + checkOutput("typeannos/DefaultUnmodified.html", true, + "<pre>void withException(<a href=\"../typeannos/RcvrA.html\" " + + "title=\"annotation in typeannos\">@RcvrA</a> " + + "DefaultUnmodified this)\n" + + " throws java." + + "lang.Exception</pre>", + + "<pre>java.lang.String nonVoid(<a href=\"../typeannos/RcvrA." + + "html\" title=\"annotation in typeannos\">@RcvrA</a> <a href=\"../" + + "typeannos/RcvrB.html\" title=\"annotation in typeannos\">@RcvrB" + + "</a>(<a href=\"../typeannos/RcvrB.html#value--\">value</a>=\"m\")" + + " DefaultUnmodified this)</pre>", + + "<pre><T extends java.lang.Runnable> void accept(" + + "<a href=\"../typeannos/RcvrA.html\" title=\"annotation in " + + "typeannos\">@RcvrA</a> DefaultUnmodified this,\n" + + " T r)\n" + + " throws java.lang.Exception</pre>"); + + checkOutput("typeannos/PublicModified.html", true, + "<pre>public final java.lang.String nonVoid(<a href=\"" + + "../typeannos/RcvrA.html\" title=\"annotation in typeannos\">" + + "@RcvrA</a> PublicModified this)</pre>", - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestTypeAnnotations tester = new TestTypeAnnotations(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); - } + "<pre>public final <T extends java.lang.Runnable> " + + "void accept(<a href=\"../typeannos/RcvrA.html\" title=\"" + + "annotation in typeannos\">@RcvrA</a> PublicModified this,\n" + + " T r)\n" + + " throws java.lang.Exception</pre>"); + + checkOutput("typeannos/WithValue.html", true, + "<pre><T extends java.lang.Runnable> void accept(" + + "<a href=\"../typeannos/RcvrB.html\" title=\"annotation in " + + "typeannos\">@RcvrB</a>(<a href=\"../typeannos/RcvrB.html#value--\">" + + "value</a>=\"m\") WithValue this,\n" + + " T r)\n" + + " throws java.lang.Exception</pre>"); - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + checkOutput("typeannos/WithFinal.html", true, + "<pre>java.lang.String nonVoid(<a href=\"../typeannos/RcvrB." + + "html\" title=\"annotation in typeannos\">@RcvrB</a>(<a href=\"../" + + "typeannos/RcvrB.html#value--\">value</a>=\"m\") WithFinal" + + " this)</pre>"); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("typeannos/WithBody.html", true, + "<pre>void field(<a href=\"../typeannos/RcvrA.html\" title=\"" + + "annotation in typeannos\">@RcvrA</a> WithBody this)</pre>"); + + checkOutput("typeannos/Generic2.html", true, + "<pre>void test2(<a href=\"../typeannos/RcvrA.html\" title=\"" + + "annotation in typeannos\">@RcvrA</a> Generic2<X> this)</pre>"); } }
--- a/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,84 +30,61 @@ * class-use pages. The class/annotation pages should check for type * parameter links in the class/annotation signature section when -linksource is set. * @author jamieh - * @library ../lib/ - * @build JavadocTester TestTypeParameters + * @library ../lib + * @build JavadocTester * @run main TestTypeParameters */ public class TestTypeParameters extends JavadocTester { - //Test information. - private static final String BUG_ID = "4927167-4974929-7010344"; + public static void main(String... args) throws Exception { + TestTypeParameters tester = new TestTypeParameters(); + tester.runTests(); + } - //Javadoc arguments. - private static final String[] ARGS1 = new String[]{ - "-d", BUG_ID, "-use", "-source", "1.5", "-sourcepath", SRC_DIR, - "pkg" - }; - private static final String[] ARGS2 = new String[]{ - "-d", BUG_ID, "-linksource", "-source", "1.5", "-sourcepath", SRC_DIR, - "pkg" - }; + @Test + void test1() { + javadoc("-d", "out-1", + "-use", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); + + checkOutput("pkg/C.html", true, + "<td class=\"colFirst\"><code><W extends java.lang.String,V extends " + + "java.util.List><br>java.lang.Object</code></td>", + "<code><T> java.lang.Object</code>"); + + checkOutput("pkg/package-summary.html", true, + "C</a><E extends <a href=\"../pkg/Parent.html\" " + + "title=\"class in pkg\">Parent</a>>"); - //Input for string search tests. - private static final String[][] TEST1 = { - {BUG_ID + FS + "pkg" + FS + "C.html", - "<td class=\"colFirst\"><code><W extends java.lang.String,V extends " + - "java.util.List><br>java.lang.Object</code></td>" - }, - {BUG_ID + FS + "pkg" + FS + "C.html", - "<code><T> java.lang.Object</code>" - }, - {BUG_ID + FS + "pkg" + FS + "package-summary.html", - "C</a><E extends <a href=\"../pkg/Parent.html\" " + - "title=\"class in pkg\">Parent</a>>" - }, - {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "Foo4.html", - "<a href=\"../../pkg/ClassUseTest3.html\" title=\"class in pkg\">" + - "ClassUseTest3</a><T extends <a href=\"../../pkg/ParamTest2.html\" " + - "title=\"class in pkg\">ParamTest2</a><java.util.List<? extends " + - "<a href=\"../../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>>>>" - }, - //Nested type parameters - {BUG_ID + FS + "pkg" + FS + "C.html", - "<a name=\"formatDetails-java.util.Collection-java.util.Collection-\">" + NL + - "<!-- -->" + NL + - "</a>" - }, - }; - private static final String[][] TEST2 = { - {BUG_ID + FS + "pkg" + FS + "ClassUseTest3.html", + checkOutput("pkg/class-use/Foo4.html", true, + "<a href=\"../../pkg/ClassUseTest3.html\" title=\"class in pkg\">" + + "ClassUseTest3</a><T extends <a href=\"../../pkg/ParamTest2.html\" " + + "title=\"class in pkg\">ParamTest2</a><java.util.List<? extends " + + "<a href=\"../../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>>>>"); + + // Nested type parameters + checkOutput("pkg/C.html", true, + "<a name=\"formatDetails-java.util.Collection-java.util.Collection-\">\n" + + "<!-- -->\n" + + "</a>"); + } + + + @Test + void test2() { + javadoc("-d", "out-2", + "-linksource", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); + + checkOutput("pkg/ClassUseTest3.html", true, "public class <a href=\"../src-html/pkg/ClassUseTest3.html#line.28\">" + "ClassUseTest3</a><T extends <a href=\"../pkg/ParamTest2.html\" " + "title=\"class in pkg\">ParamTest2</a><java.util.List<? extends " + - "<a href=\"../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>>>>" - } - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestTypeParameters tester = new TestTypeParameters(); - run(tester, ARGS1, TEST1, NEGATED_TEST); - run(tester, ARGS2, TEST2, NEGATED_TEST); - tester.printSummary(); - } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + "<a href=\"../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>>>>"); } }
--- a/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,66 +27,40 @@ * @summary Reference unnamed package as "Unnamed", not empty string. * Generate a package summary for the unnamed package. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestUnnamedPackage * @run main TestUnnamedPackage */ public class TestUnnamedPackage extends JavadocTester { - //Test information. - private static final String BUG_ID = "4904075-4774450-5015144"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, SRC_DIR + FS + "C.java" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "package-summary.html", - "<h1 title=\"Package\" class=\"title\">Package <Unnamed></h1>" - }, - {BUG_ID + FS + "package-summary.html", - "This is a package comment for the unnamed package." - }, - {BUG_ID + FS + "package-summary.html", - "This is a class in the unnamed package." - }, - {BUG_ID + FS + "package-tree.html", - "<h1 class=\"title\">Hierarchy For Package <Unnamed></h1>" - }, - {BUG_ID + FS + "index-all.html", - "title=\"class in <Unnamed>\"" - }, - {BUG_ID + FS + "C.html", "<a href=\"package-summary.html\">"} - }; - private static final String[][] NEGATED_TEST = { - {ERROR_OUTPUT, "BadSource"}, - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestUnnamedPackage tester = new TestUnnamedPackage(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-d", "out", + "-sourcepath", testSrc, + testSrc("C.java")); + checkExit(Exit.OK); + + checkOutput("package-summary.html", true, + "<h1 title=\"Package\" class=\"title\">Package <Unnamed></h1>", + "This is a package comment for the unnamed package.", + "This is a class in the unnamed package."); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("package-tree.html", true, + "<h1 class=\"title\">Hierarchy For Package <Unnamed></h1>"); + + checkOutput("index-all.html", true, + "title=\"class in <Unnamed>\""); + + checkOutput("C.html", true, + "<a href=\"package-summary.html\">"); + + checkOutput(Output.ERROR, false, + "BadSource"); } }
--- a/test/com/sun/javadoc/testUseOption/TestUseOption.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testUseOption/TestUseOption.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,114 +26,76 @@ * @bug 4496290 4985072 7006178 7068595 8016328 * @summary A simple test to determine if -use works. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestUseOption * @run main TestUseOption */ public class TestUseOption extends JavadocTester { - private static final String BUG_ID = "4496290-4985072-7006178-7068595"; - - //Input for string search tests. - private static final String[] TEST2 = { - "Field in C1.", - "Field in C2.", - "Field in C4.", - "Field in C5.", - "Field in C6.", - "Field in C7.", - "Field in C8.", - "Method in C1.", - "Method in C2.", - "Method in C4.", - "Method in C5.", - "Method in C6.", - "Method in C7.", - "Method in C8.", - }; - - private static final String[][] TEST3 = { - {BUG_ID + "-3" + FS + "class-use" + FS + "UsedInC.html", "Uses of <a href=" + - "\"../UsedInC.html\" title=\"class in <Unnamed>\">" + - "UsedInC</a> in <a href=\"../package-summary.html\"><Unnamed></a>" - }, - {BUG_ID + "-3" + FS + "package-use.html", "<td class=\"colOne\">" + - "<a href=\"class-use/UsedInC.html#%3CUnnamed%3E\">UsedInC</a> </td>" - } - }; - - private static final String[][] TEST4 = { - {BUG_ID + "-4" + FS + "pkg2" + FS + "class-use" + FS + "C3.html", "<a href=" + - "\"../../index.html?pkg2/class-use/C3.html\" target=\"_top\">" + - "Frames</a></li>" - } - }; - - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2" - }; - - private static final String[] ARGS2 = new String[] { - "-d", BUG_ID+"-2", "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2" - }; - - private static final String[] ARGS3 = new String[] { - "-d", BUG_ID + "-3", "-sourcepath", SRC_DIR, "-use", SRC_DIR + FS + "C.java", SRC_DIR + FS + "UsedInC.java" - }; - - private static final String[] ARGS4 = new String[] { - "-d", BUG_ID + "-4", "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) throws Exception { - String[][] tests = new String[11][2]; - //Eight tests for class use. - for (int i = 0; i < 8; i++) { - tests[i][0] = BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html"; - tests[i][1] = "Test " + (i + 1) + " passes"; - } - //Three more tests for package use. - for (int i = 8, j = 1; i < tests.length; i++, j++) { - tests[i][0] = BUG_ID + FS + "pkg1" + FS + "package-use.html"; - tests[i][1] = "Test " + j + " passes"; - } + public static void main(String... args) throws Exception { TestUseOption tester = new TestUseOption(); - run(tester, ARGS, tests, NO_TEST); - tester.printSummary(); - run(tester, ARGS2, NO_TEST, NO_TEST); - String usePageContents = tester.readFileToString(BUG_ID +"-2" + FS + "pkg1" + FS + "class-use" + FS + "UsedClass.html"); - int prevIndex = -1; - int currentIndex = -1; - for (int i = 0; i < TEST2.length; i++) { - currentIndex = usePageContents.indexOf(TEST2[i]); - System.err.println(TEST2[i] + " at index " + currentIndex); - if (currentIndex < prevIndex) - throw new Exception(TEST2[i] + " is in the wrong order."); - prevIndex = currentIndex; - } - tester.printSummary(); - run(tester, ARGS3, TEST3, NO_TEST); - run(tester, ARGS4, TEST4, NO_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void test1() { + javadoc("-d", "out-1", + "-sourcepath", testSrc, + "-use", + "pkg1", "pkg2"); + checkExit(Exit.OK); + + // Eight tests for class use. + for (int i = 1; i <= 8; i++) { + checkOutput("pkg1/class-use/C1.html", true, + "Test " + i + " passes"); + } + + // Three more tests for package use. + for (int i = 1; i <= 3; i++) { + checkOutput("pkg1/package-use.html", true, + "Test " + i + " passes"); + } + + checkOrder("pkg1/class-use/UsedClass.html", + "Field in C1.", + "Field in C2.", + "Field in C4.", + "Field in C5.", + "Field in C6.", + "Field in C7.", + "Field in C8.", + "Method in C1.", + "Method in C2.", + "Method in C4.", + "Method in C5.", + "Method in C6.", + "Method in C7.", + "Method in C8." + ); + + checkOutput("pkg2/class-use/C3.html", true, + "<a href=\"../../index.html?pkg2/class-use/C3.html\" target=\"_top\">" + + "Frames</a></li>" + ); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void test2() { + javadoc("-d", "out-2", + "-sourcepath", testSrc, + "-use", + testSrc("C.java"), testSrc("UsedInC.java")); + checkExit(Exit.OK); + + checkOutput("class-use/UsedInC.html", true, + "Uses of <a href=\"../UsedInC.html\" title=\"class in <Unnamed>\">" + + "UsedInC</a> in <a href=\"../package-summary.html\"><Unnamed></a>" + ); + checkOutput("package-use.html", true, + "<td class=\"colOne\">" + + "<a href=\"class-use/UsedInC.html#%3CUnnamed%3E\">UsedInC</a> </td>" + ); } }
--- a/test/com/sun/javadoc/testValueTag/TestValueTag.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testValueTag/TestValueTag.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,158 +27,114 @@ * @summary This test ensures that the value tag works in all * use cases. The explainations for each test case are written below. * @author jamieh - * @library ../lib/ - * @build JavadocTester TestValueTag + * @library ../lib + * @build JavadocTester * @run main TestValueTag */ public class TestValueTag extends JavadocTester { - //Test information. - private static final String BUG_ID = "4764045"; - - //Javadoc arguments. - private static final String[] ARGS = - new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-tag", - "todo", "pkg1", "pkg2" - }; - - private static final String[] ARGS1 = - new String[] { - "-Xdoclint:none", - "-d", BUG_ID + "-1", "-sourcepath", SRC_DIR, "-tag", - "todo", "pkg1", "pkg2" - }; - - //Input for string search tests. - private static final String[][] TEST = { - //Base case: using @value on a constant. - {BUG_ID + FS + "pkg1" + FS + "Class1.html", - "Result: \"Test 1 passes\""}, - //Retrieve value of constant in same class. - {BUG_ID + FS + "pkg1" + FS + "Class1.html", - "Result: <a href=\"../pkg1/Class1.html#TEST_2_PASSES\">\"Test 2 passes\"</a>"}, - {BUG_ID + FS + "pkg1" + FS + "Class1.html", - "Result: <a href=\"../pkg1/Class1.html#TEST_3_PASSES\">\"Test 3 passes\"</a>"}, - {BUG_ID + FS + "pkg1" + FS + "Class1.html", - "Result: <a href=\"../pkg1/Class1.html#TEST_4_PASSES\">\"Test 4 passes\"</a>"}, - {BUG_ID + FS + "pkg1" + FS + "Class1.html", - "Result: <a href=\"../pkg1/Class1.html#TEST_5_PASSES\">\"Test 5 passes\"</a>"}, - {BUG_ID + FS + "pkg1" + FS + "Class1.html", - "Result: <a href=\"../pkg1/Class1.html#TEST_6_PASSES\">\"Test 6 passes\"</a>"}, - //Retrieve value of constant in different class. - {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: <a href=\"../pkg1/Class1.html#TEST_7_PASSES\">\"Test 7 passes\"</a>"}, - {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: <a href=\"../pkg1/Class1.html#TEST_8_PASSES\">\"Test 8 passes\"</a>"}, - {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: <a href=\"../pkg1/Class1.html#TEST_9_PASSES\">\"Test 9 passes\"</a>"}, - {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: <a href=\"../pkg1/Class1.html#TEST_10_PASSES\">\"Test 10 passes\"</a>"}, - {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: <a href=\"../pkg1/Class1.html#TEST_11_PASSES\">\"Test 11 passes\"</a>"}, - //Retrieve value of constant in different package - {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: <a href=\"../pkg2/Class3.html#TEST_12_PASSES\">\"Test 12 passes\"</a>"}, - {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: <a href=\"../pkg2/Class3.html#TEST_13_PASSES\">\"Test 13 passes\"</a>"}, - {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: <a href=\"../pkg2/Class3.html#TEST_14_PASSES\">\"Test 14 passes\"</a>"}, - {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: <a href=\"../pkg2/Class3.html#TEST_15_PASSES\">\"Test 15 passes\"</a>"}, - {BUG_ID + FS + "pkg1" + FS + "Class2.html", - "Result: <a href=\"../pkg2/Class3.html#TEST_16_PASSES\">\"Test 16 passes\"</a>"}, - //Retrieve value of constant from a package page - {BUG_ID + FS + "pkg2" + FS + "package-summary.html", - "Result: <a href=\"../pkg2/Class3.html#TEST_17_PASSES\">\"Test 17 passes\"</a>"}, - //Test @value tag used with custom tag. - {BUG_ID + FS + "pkg1" + FS + "CustomTagUsage.html", - "<dt><span class=\"simpleTagLabel\">Todo:</span></dt>" + NL + - "<dd>the value of this constant is 55.</dd>"}, - //Test @value errors printed dues to invalid use or when used with - //non-constant or with bad references. - {ERROR_OUTPUT,"error: value does not refer to a constant" + NL + - " * Result: {@value TEST_12_ERROR}" - }, - {ERROR_OUTPUT,"error: {@value} not allowed here" + NL + - " * Result: {@value}" - }, - {ERROR_OUTPUT,"error: value does not refer to a constant" + NL + - " * Result: {@value NULL}" - }, - {ERROR_OUTPUT,"error: {@value} not allowed here" + NL + - " * Invalid (null): {@value}" - }, - {ERROR_OUTPUT,"error: {@value} not allowed here" + NL + - " * Invalid (non-constant field): {@value}" - }, - {ERROR_OUTPUT,"error: value does not refer to a constant" + NL + - " * Here is a bad value reference: {@value UnknownClass#unknownConstant}" - }, - {ERROR_OUTPUT,"error: reference not found" + NL + - " * Here is a bad value reference: {@value UnknownClass#unknownConstant}" - }, - {ERROR_OUTPUT,"error: {@value} not allowed here" + NL + - " * @todo the value of this constant is {@value}" - } - }; - private static final String[][] TEST1 = { - //Test @value warning printed when used with non-constant. - {WARNING_OUTPUT,"warning - @value tag (which references nonConstant) " + - "can only be used in constants." - }, - {WARNING_OUTPUT,"warning - @value tag (which references NULL) " + - "can only be used in constants." - }, - {WARNING_OUTPUT,"warning - @value tag (which references TEST_12_ERROR) " + - "can only be used in constants." - }, - //Test warning printed for bad reference. - {WARNING_OUTPUT,"warning - UnknownClass#unknownConstant (referenced by " + - "@value tag) is an unknown reference." - }, - //Test warning printed for invalid use of @value. - {WARNING_OUTPUT,"warning - @value tag cannot be used here." - } - }; - private static final String[][] NEGATED_TEST = { - //Base case: using @value on a constant. - {BUG_ID + FS + "pkg1" + FS + "Class1.html", - "Result: <a href=\"../pkg1/Class1.html#TEST_12_ERROR\">\"Test 12 " + - "generates an error message\"</a>"}, - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestValueTag tester = new TestValueTag(); - run(tester, ARGS, TEST, NEGATED_TEST); - checkForException(tester); - run(tester, ARGS1, TEST1, NO_TEST); - checkForException(tester); - tester.printSummary(); + tester.runTests(); } - public static void checkForException(TestValueTag tester) { - if (tester.getErrorOutput().contains("DocletAbortException")) { - throw new AssertionError("javadoc threw DocletAbortException"); - } + @Test + void test1() { + javadoc("-d", "out1", + "-sourcepath", testSrc, + "-tag", "todo", + "pkg1", "pkg2"); + checkExit(Exit.FAILED); + + checkOutput("pkg1/Class1.html", true, + // Base case: using @value on a constant. + "Result: \"Test 1 passes\"", + // Retrieve value of constant in same class. + "Result: <a href=\"../pkg1/Class1.html#TEST_2_PASSES\">\"Test 2 passes\"</a>", + "Result: <a href=\"../pkg1/Class1.html#TEST_3_PASSES\">\"Test 3 passes\"</a>", + "Result: <a href=\"../pkg1/Class1.html#TEST_4_PASSES\">\"Test 4 passes\"</a>", + "Result: <a href=\"../pkg1/Class1.html#TEST_5_PASSES\">\"Test 5 passes\"</a>", + "Result: <a href=\"../pkg1/Class1.html#TEST_6_PASSES\">\"Test 6 passes\"</a>"); + + checkOutput("pkg1/Class2.html", true, + // Retrieve value of constant in different class. + "Result: <a href=\"../pkg1/Class1.html#TEST_7_PASSES\">\"Test 7 passes\"</a>", + "Result: <a href=\"../pkg1/Class1.html#TEST_8_PASSES\">\"Test 8 passes\"</a>", + "Result: <a href=\"../pkg1/Class1.html#TEST_9_PASSES\">\"Test 9 passes\"</a>", + "Result: <a href=\"../pkg1/Class1.html#TEST_10_PASSES\">\"Test 10 passes\"</a>", + "Result: <a href=\"../pkg1/Class1.html#TEST_11_PASSES\">\"Test 11 passes\"</a>", + // Retrieve value of constant in different package + "Result: <a href=\"../pkg2/Class3.html#TEST_12_PASSES\">\"Test 12 passes\"</a>", + "Result: <a href=\"../pkg2/Class3.html#TEST_13_PASSES\">\"Test 13 passes\"</a>", + "Result: <a href=\"../pkg2/Class3.html#TEST_14_PASSES\">\"Test 14 passes\"</a>", + "Result: <a href=\"../pkg2/Class3.html#TEST_15_PASSES\">\"Test 15 passes\"</a>", + "Result: <a href=\"../pkg2/Class3.html#TEST_16_PASSES\">\"Test 16 passes\"</a>"); + + checkOutput("pkg2/package-summary.html", true, + // Retrieve value of constant from a package page + "Result: <a href=\"../pkg2/Class3.html#TEST_17_PASSES\">\"Test 17 passes\"</a>"); + + checkOutput("pkg1/CustomTagUsage.html", true, + // Test @value tag used with custom tag. + "<dt><span class=\"simpleTagLabel\">Todo:</span></dt>\n" + + "<dd>the value of this constant is 55.</dd>"); + + checkOutput(Output.ERROR, true, + // Test @value errors printed due to invalid use or when used with + // non-constant or with bad references. + "error: value does not refer to a constant\n" + + " * Result: {@value TEST_12_ERROR}", + "error: {@value} not allowed here\n" + + " * Result: {@value}", + "error: value does not refer to a constant\n" + + " * Result: {@value NULL}", + "error: {@value} not allowed here\n" + + " * Invalid (null): {@value}", + "error: {@value} not allowed here\n" + + " * Invalid (non-constant field): {@value}", + "error: value does not refer to a constant\n" + + " * Here is a bad value reference: {@value UnknownClass#unknownConstant}", + "error: reference not found\n" + + " * Here is a bad value reference: {@value UnknownClass#unknownConstant}", + "error: {@value} not allowed here\n" + + " * @todo the value of this constant is {@value}" + ); + + checkOutput("pkg1/Class1.html", false, + //Base case: using @value on a constant. + "Result: <a href=\"../pkg1/Class1.html#TEST_12_ERROR\">\"Test 12 " + + "generates an error message\"</a>"); + + checkForException(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test() + void test2() { + javadoc("-Xdoclint:none", + "-d", "out2", + "-sourcepath", testSrc, + "-tag", "todo", + "pkg1", "pkg2"); + checkExit(Exit.OK); + checkOutput(Output.WARNING, true, + //Test @value warning printed when used with non-constant. + "warning - @value tag (which references nonConstant) " + + "can only be used in constants.", + "warning - @value tag (which references NULL) " + + "can only be used in constants.", + "warning - @value tag (which references TEST_12_ERROR) " + + "can only be used in constants.", + //Test warning printed for bad reference. + "warning - UnknownClass#unknownConstant (referenced by " + + "@value tag) is an unknown reference.", + //Test warning printed for invalid use of @value. + "warning - @value tag cannot be used here." + ); + checkForException(); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + void checkForException() { + checkOutput(Output.STDERR, false, "DocletAbortException"); } }
--- a/test/com/sun/javadoc/testWarnBadParamNames/TestWarnBadParamNames.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testWarnBadParamNames/TestWarnBadParamNames.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,49 +24,31 @@ /* * @test * @bug 4693440 - * @summary Test to make sure that warning is printed when bad paramenter + * @summary Test to make sure that warning is printed when bad parameter * name is used with param. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestWarnBadParamNames * @run main TestWarnBadParamNames */ public class TestWarnBadParamNames extends JavadocTester { - private static final String BUG_ID = "4693440"; - private static final String[][] TEST = { - {WARNING_OUTPUT, "warning - @param argument \"int\" is not a parameter name."}, - {WARNING_OUTPUT, "warning - @param argument \"IDontExist\" is not a parameter name."}, - {WARNING_OUTPUT, "warning - Parameter \"arg\" is documented more than once."}, - }; - private static final String[][] NEGATED_TEST = NO_TEST; - private static final String[] ARGS = new String[] { - "-Xdoclint:none", "-d", BUG_ID, SRC_DIR + FS + "C.java" - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestWarnBadParamNames tester = new TestWarnBadParamNames(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } + @Test + void test() { + javadoc("-Xdoclint:none", + "-d", "out", + testSrc("C.java")); + checkExit(Exit.OK); - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput(Output.WARNING, true, + "warning - @param argument \"int\" is not a parameter name.", + "warning - @param argument \"IDontExist\" is not a parameter name.", + "warning - Parameter \"arg\" is documented more than once."); } }
--- a/test/com/sun/javadoc/testWarnings/TestWarnings.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testWarnings/TestWarnings.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,71 +30,50 @@ * a "link unresolved" warning. * Make sure error message starts with "error -". * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestWarnings * @run main TestWarnings */ public class TestWarnings extends JavadocTester { - - //Test information. - private static final String BUG_ID = "4515705-4804296-4702454-4697036"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-Xdoclint:none", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" - }; - - private static final String[] ARGS2 = new String[] { - "-Xdoclint:none", "-d", BUG_ID, "-private", "-sourcepath", SRC_DIR, "pkg" - }; - - //Input for string search tests. - private static final String[][] TEST = { - {WARNING_OUTPUT, - "X.java:11: warning - Missing closing '}' character for inline tag"}, - {ERROR_OUTPUT, - "package.html: error - Body tag missing from HTML"}, - - }; - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg" + FS + "X.html", "can't find m()"}, - {BUG_ID + FS + "pkg" + FS + "X.html", "can't find X()"}, - {BUG_ID + FS + "pkg" + FS + "X.html", "can't find f"}, - }; - - private static final String[][] TEST2 = { - {BUG_ID + FS + "pkg" + FS + "X.html", "<a href=\"../pkg/X.html#m--\"><code>m()</code></a><br/>"}, - {BUG_ID + FS + "pkg" + FS + "X.html", "<a href=\"../pkg/X.html#X--\"><code>X()</code></a><br/>"}, - {BUG_ID + FS + "pkg" + FS + "X.html", "<a href=\"../pkg/X.html#f\"><code>f</code></a><br/>"}, - }; - - private static final String[][] NEGATED_TEST2 = NO_TEST; - - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestWarnings tester = new TestWarnings(); - run(tester, ARGS, TEST, NEGATED_TEST); - run(tester, ARGS2, TEST2, NEGATED_TEST2); - tester.printSummary(); + tester.runTests(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void testDefault() { + javadoc("-Xdoclint:none", + "-d", "out-default", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.FAILED); // TODO: investigate; suspect bad input HTML + + checkOutput(Output.WARNING, true, + "X.java:11: warning - Missing closing '}' character for inline tag"); + checkOutput(Output.ERROR, true, + "package.html: error - Body tag missing from HTML"); + + checkOutput("pkg/X.html", false, + "can't find m()"); + checkOutput("pkg/X.html", false, + "can't find X()"); + checkOutput("pkg/X.html", false, + "can't find f"); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void testPrivate() { + javadoc("-Xdoclint:none", + "-d", "out-private", + "-private", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.FAILED); // TODO: investigate; suspect bad input HTML + + checkOutput("pkg/X.html", true, + "<a href=\"../pkg/X.html#m--\"><code>m()</code></a><br/>", + "<a href=\"../pkg/X.html#X--\"><code>X()</code></a><br/>", + "<a href=\"../pkg/X.html#f\"><code>f</code></a><br/>"); } }
--- a/test/com/sun/javadoc/testWindowTitle/TestWindowTitle.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testWindowTitle/TestWindowTitle.java Tue Nov 10 02:47:05 2020 +0000 @@ -26,191 +26,192 @@ * @bug 8016675 8026736 * @summary Test for window title. * @author Bhavesh Patel - * @library ../lib/ - * @build JavadocTester TestWindowTitle + * @library ../lib + * @build JavadocTester * @run main TestWindowTitle */ - public class TestWindowTitle extends JavadocTester { - private static final String BUG_ID = "8016675"; - //Window title with JavaScript special characters. - private static final String TITLE_JS_CHARS = - "Testing \"Window 'Title'\" with a \\ backslash and a / " + - "forward slash and a \u00e8 unicode char also a tab and also a " + - "\t special character another \u0002 unicode)"; - private static final String[] ARGS_JS_CHARS = new String[]{ - "-d", BUG_ID + "-1", "-windowtitle", TITLE_JS_CHARS, "-sourcepath", SRC_DIR, "p1", "p2" - }; - private static final String[][] TEST_JS_CHARS = { - {BUG_ID + "-1" + FS + "overview-summary.html", - "parent.document.title=\"Overview (Testing \\\"Window \\\'Title\\\'\\\" " + - "with a \\\\ backslash and a / forward slash and a \\u00E8 unicode char " + - "also a tab and also a \\t special character another \\u0002 unicode))\";" - }, - }; - private static final String[][] NEG_TEST_JS_CHARS = { - {BUG_ID + "-1" + FS + "overview-summary.html", - "parent.document.title=\"Overview (Testing \"Window \'Title\'\" " + - "with a \\ backslash and a / forward slash and a \u00E8 unicode char " + - "also a tab and also a \t special character another \u0002 unicode))\";" - } - }; - - //Window title with a script tag. - private static final String TITLE_SCRIPT_TAG = - "Testing script tag in title </title><script>alert(\"Should not pop up\")</script>."; - private static final String[] ARGS_SCRIPT_TAG = new String[]{ - "-d", BUG_ID + "-2", "-windowtitle", TITLE_SCRIPT_TAG, "-sourcepath", SRC_DIR, "p1", "p2" - }; - private static final String[][] TEST_SCRIPT_TAG = { - {BUG_ID + "-2" + FS + "overview-summary.html", - "parent.document.title=\"Overview (Testing script tag in title alert" + - "(\\\"Should not pop up\\\").)\";" - }, - {BUG_ID + "-2" + FS + "p2" + FS + "C2.html", - "parent.document.title=\"C2 (Testing script tag in title alert" + - "(\\\"Should not pop up\\\").)\";" - } - }; - private static final String[][] NEG_TEST_SCRIPT_TAG = { - {BUG_ID + "-2" + FS + "overview-summary.html", - "parent.document.title=\"Overview (Testing script tag in title </title><script>" + - "alert(\\\"Should not pop up\\\")</script>.)\";" - }, - {BUG_ID + "-2" + FS + "p2" + FS + "C2.html", - "parent.document.title=\"C2 (Testing script tag in title </title><script>" + - "alert(\\\"Should not pop up\\\")</script>.)\";" - } - }; - - //Window title with other HTML tags. - private static final String TITLE_HTML_TAGS = - "Testing another <p>HTML</p> tag. Another <h1>tag</h1>. A " + - "<span id=\"testTag\">tag with attributes</span>. <script and </p are not tags."; - private static final String[] ARGS_HTML_TAGS = new String[]{ - "-d", BUG_ID + "-3", "-windowtitle", TITLE_HTML_TAGS, "-sourcepath", SRC_DIR, "p1", "p2" - }; - private static final String[][] TEST_HTML_TAGS = { - {BUG_ID + "-3" + FS + "overview-summary.html", - "parent.document.title=\"Overview (Testing another HTML tag. Another tag. A " + - "tag with attributes. <script and </p are not tags.)\";" - } - }; - private static final String[][] NEG_TEST_HTML_TAGS = { - {BUG_ID + "-3" + FS + "overview-summary.html", - "parent.document.title=\"Overview (Testing another <p>HTML</p> tag. Another " + - "<h1>tag</h1>. A <span id=\"testTag\">tag with attributes</span>. <script and " + - "</p are not tags.)\";" - } - }; - - //Window title using entities. - private static final String TITLE_HTML_ENTITIES = - "Testing entities <script>alert(\"Should not pop up\")</script>."; - private static final String[] ARGS_HTML_ENTITIES = new String[]{ - "-d", BUG_ID + "-4", "-windowtitle", TITLE_HTML_ENTITIES, "-sourcepath", SRC_DIR, "p1", "p2" - }; - private static final String[][] TEST_HTML_ENTITIES = { - {BUG_ID + "-4" + FS + "overview-summary.html", - "parent.document.title=\"Overview (Testing entities <script>alert(\\\"Should " + - "not pop up\\\")</script>.)\";" - } - }; - private static final String[][] NEG_TEST_HTML_ENTITIES = { - {BUG_ID + "-4" + FS + "overview-summary.html", - "parent.document.title=\"Overview (Testing entities alert(\\\"Should not pop up\\\").)\";" - } - }; - - //Window title with just empty HTML tags. - private static final String TITLE_EMPTY_TAGS = - "</title><script></script>"; - private static final String[] ARGS_EMPTY_TAGS = new String[]{ - "-d", BUG_ID + "-5", "-windowtitle", TITLE_EMPTY_TAGS, "-sourcepath", SRC_DIR, "p1", "p2" - }; - private static final String[][] TEST_EMPTY_TAGS = { - {BUG_ID + "-5" + FS + "overview-summary.html", - "parent.document.title=\"Overview\";" - } - }; - private static final String[][] NEG_TEST_EMPTY_TAGS = { - {BUG_ID + "-5" + FS + "overview-summary.html", - "parent.document.title=\"Overview (</title><script></script>)\";" - } - }; - - //Window title with unicode characters. - private static final String TITLE_UNICODE_CHARS = - "Testing unicode \u003cscript\u003ealert(\"Should not pop up\")\u003c/script\u003e."; - private static final String[] ARGS_UNICODE_CHARS = new String[]{ - "-d", BUG_ID + "-6", "-windowtitle", TITLE_UNICODE_CHARS, "-sourcepath", SRC_DIR, "p1", "p2" - }; - private static final String[][] TEST_UNICODE_CHARS = { - {BUG_ID + "-6" + FS + "overview-summary.html", - "parent.document.title=\"Overview (Testing unicode alert(\\\"Should " + - "not pop up\\\").)\";" - } - }; - private static final String[][] NEG_TEST_UNICODE_CHARS = { - {BUG_ID + "-6" + FS + "overview-summary.html", - "parent.document.title=\"Overview (Testing unicode <script>alert(\\\"Should not pop up\\\")" + - "</script>.)\";" - } - }; - - //An empty window title. - private static final String TITLE_EMPTY = - ""; - private static final String[] ARGS_EMPTY_TITLE = new String[]{ - "-d", BUG_ID + "-7", "-windowtitle", TITLE_EMPTY, "-sourcepath", SRC_DIR, "p1", "p2" - }; - private static final String[][] TEST_EMPTY = { - {BUG_ID + "-7" + FS + "overview-summary.html", - "parent.document.title=\"Overview\";" - } - }; - - //Test doctitle. - private static final String[] ARGS_DOCTITLE = new String[]{ - "-d", BUG_ID + "-8", "-doctitle", TITLE_JS_CHARS, "-sourcepath", SRC_DIR, "p1", "p2" - }; - private static final String[][] NEG_TEST_DOCTITLE = { - {BUG_ID + "-8" + FS + "overview-summary.html", - "parent.document.title=\"Overview (Testing \\\"Window \\\'Title\\\'\\\" " + - "with a \\\\ backslash and a / forward slash and a \\u00E8 unicode char " + - "also a tab and also a \\t special character another \\u0002 unicode)\";" - }, - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { + public static void main(String... args) throws Exception { TestWindowTitle tester = new TestWindowTitle(); - run(tester, ARGS_JS_CHARS, TEST_JS_CHARS, NEG_TEST_JS_CHARS); - run(tester, ARGS_SCRIPT_TAG, TEST_SCRIPT_TAG, NEG_TEST_SCRIPT_TAG); - run(tester, ARGS_HTML_TAGS, TEST_HTML_TAGS, NEG_TEST_HTML_TAGS); - run(tester, ARGS_HTML_ENTITIES, TEST_HTML_ENTITIES, NEG_TEST_HTML_ENTITIES); - run(tester, ARGS_EMPTY_TAGS, TEST_EMPTY_TAGS, NEG_TEST_EMPTY_TAGS); - run(tester, ARGS_UNICODE_CHARS, TEST_UNICODE_CHARS, NEG_TEST_UNICODE_CHARS); - run(tester, ARGS_EMPTY_TITLE, TEST_EMPTY, NO_TEST); - run(tester, ARGS_DOCTITLE, NO_TEST, NEG_TEST_DOCTITLE); + tester.runTests(); tester.printSummary(); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void testJavaScriptChars() { + // Window title with JavaScript special characters. + String title = "Testing \"Window 'Title'\" with a \\ backslash and a / " + + "forward slash and a \u00e8 unicode char also a tab and also a " + + "\t special character another \u0002 unicode)"; + + javadoc("-d", "out-js-chars", + "-windowtitle", title, + "-sourcepath", testSrc, + "p1", "p2"); + checkExit(Exit.OK); + + checkOutput("overview-summary.html", true, + "parent.document.title=\"Overview (Testing \\\"Window \\\'Title\\\'\\\" " + + "with a \\\\ backslash and a / forward slash and a \\u00E8 unicode char " + + "also a tab and also a \\t special character another \\u0002 unicode))\";" + ); + + checkOutput("overview-summary.html", false, + "parent.document.title=\"Overview (Testing \"Window \'Title\'\" " + + "with a \\ backslash and a / forward slash and a \u00E8 unicode char " + + "also a tab and also a \t special character another \u0002 unicode))\";" + ); + } + + @Test + void testScriptTag() { + // Window title with a script tag. + String title = "Testing script tag in title </title><script>alert(\"Should not pop up\")</script>."; + + javadoc("-d", "out-script", + "-windowtitle", title, + "-sourcepath", testSrc, + "p1", "p2"); + checkExit(Exit.OK); + + checkOutput("overview-summary.html", true, + "parent.document.title=\"Overview (Testing script tag in title alert" + + "(\\\"Should not pop up\\\").)\";" + ); + + checkOutput("p2/C2.html", true, + "parent.document.title=\"C2 (Testing script tag in title alert" + + "(\\\"Should not pop up\\\").)\";" + ); + + checkOutput("overview-summary.html", false, + "parent.document.title=\"Overview (Testing script tag in title </title><script>" + + "alert(\\\"Should not pop up\\\")</script>.)\";" + ); + + checkOutput("p2/C2.html", false, + "parent.document.title=\"C2 (Testing script tag in title </title><script>" + + "alert(\\\"Should not pop up\\\")</script>.)\";" + ); + } + + @Test + void testHtmlTags() { + // Window title with other HTML tags. + String title = "Testing another <p>HTML</p> tag. Another <h1>tag</h1>. A " + + "<span id=\"testTag\">tag with attributes</span>. <script and </p are not tags."; + + javadoc("-d", "out-html-tags", + "-windowtitle", title, + "-sourcepath", testSrc, + "p1", "p2"); + checkExit(Exit.OK); + + checkOutput("overview-summary.html", true, + "parent.document.title=\"Overview (Testing another HTML tag. Another tag. A " + + "tag with attributes. <script and </p are not tags.)\";" + ); + + checkOutput("overview-summary.html", false, + "parent.document.title=\"Overview (Testing another <p>HTML</p> tag. Another " + + "<h1>tag</h1>. A <span id=\"testTag\">tag with attributes</span>. <script and " + + "</p are not tags.)\";" + ); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + @Test + void testHtmlEntities() { + // Window title using entities. + String title = "Testing entities <script>alert(\"Should not pop up\")</script>."; + + javadoc("-d", "out-html-entities", + "-windowtitle", title, + "-sourcepath", testSrc, + "p1", "p2"); + + checkOutput("overview-summary.html", true, + "parent.document.title=\"Overview (Testing entities <script>alert(\\\"Should " + + "not pop up\\\")</script>.)\";" + ); + + checkOutput("overview-summary.html", false, + "parent.document.title=\"Overview (Testing entities alert(\\\"Should not pop up\\\").)\";" + ); + } + + @Test + void testEmptyTags() { + // Window title with just empty HTML tags. + String title = "</title><script></script>"; + + javadoc("-d", "out-empty-tags", + "-windowtitle", title, + "-sourcepath", testSrc, + "p1", "p2"); + + checkOutput("overview-summary.html", true, + "parent.document.title=\"Overview\";" + ); + + checkOutput("overview-summary.html", false, + "parent.document.title=\"Overview (</title><script></script>)\";" + ); + } + + @Test + void testUnicode() { + //Window title with unicode characters. + String title = "Testing unicode \u003cscript\u003ealert(\"Should not pop up\")\u003c/script\u003e."; + + javadoc("-d", "out-unicode", + "-windowtitle", title, + "-sourcepath", testSrc, + "p1", "p2"); + checkExit(Exit.OK); + + checkOutput("overview-summary.html", true, + "parent.document.title=\"Overview (Testing unicode alert(\\\"Should " + + "not pop up\\\").)\";" + ); + + checkOutput("overview-summary.html", false, + "parent.document.title=\"Overview (Testing unicode <script>alert(\\\"Should not pop up\\\")" + + "</script>.)\";" + ); + } + + @Test + void testEmpty() { + // An empty window title. + String title = ""; + javadoc("-d", "out-empty", + "-windowtitle", title, + "-sourcepath", testSrc, "p1", "p2"); + checkExit(Exit.OK); + + checkOutput("overview-summary.html", true, + "parent.document.title=\"Overview\";" + ); + } + + @Test + void testDocTitle() { + // Window title with JavaScript special characters, specified with -doctitle + String title = "Testing \"Window 'Title'\" with a \\ backslash and a / " + + "forward slash and a \u00e8 unicode char also a tab and also a " + + "\t special character another \u0002 unicode)"; + + javadoc("-d", "out-doctitle", + "-doctitle", title, + "-sourcepath", testSrc, + "p1", "p2"); + checkExit(Exit.OK); + + checkOutput("overview-summary.html", false, + "parent.document.title=\"Overview (Testing \\\"Window \\\'Title\\\'\\\" " + + "with a \\\\ backslash and a / forward slash and a \\u00E8 unicode char " + + "also a tab and also a \\t special character another \\u0002 unicode)\";" + ); } }
--- a/test/com/sun/javadoc/testXOption/TestXOption.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/testXOption/TestXOption.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,61 +25,48 @@ * @test * @bug 8007687 * @summary Make sure that the -X option works properly. - * @library ../lib/ - * @build JavadocTester TestXOption + * @library ../lib + * @build JavadocTester * @run main TestXOption */ public class TestXOption extends JavadocTester { - //Test information. - private static final String BUG_ID = "8007687"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-X", - SRC_DIR + FS + "TestXOption.java" - }; - - private static final String[] ARGS2 = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, - SRC_DIR + FS + "TestXOption.java" - }; + public static void main(String... args) throws Exception { + TestXOption tester = new TestXOption(); + tester.runTests(); + } - private static final String[][] TEST = { - {NOTICE_OUTPUT, "-Xmaxerrs "}, - {NOTICE_OUTPUT, "-Xmaxwarns "}, - {STANDARD_OUTPUT, "-Xdocrootparent "}, - {STANDARD_OUTPUT, "-Xdoclint "}, - {STANDARD_OUTPUT, "-Xdoclint:"}, - }; - private static final String[][] NEGATED_TEST = NO_TEST; - - //The help option should not crash the doclet. - private static final int EXPECTED_EXIT_CODE = 0; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestXOption tester = new TestXOption(); - int actualExitCode = run(tester, ARGS, TEST, NEGATED_TEST); - tester.checkExitCode(EXPECTED_EXIT_CODE, actualExitCode); - tester.printSummary(); + @Test + void testWithOption() { + javadoc("-d", "out1", + "-sourcepath", testSrc, + "-X", + testSrc("TestXOption.java")); + checkExit(Exit.OK); + checkOutput(true); } - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; + @Test + void testWithoutOption() { + javadoc("-d", "out2", + "-sourcepath", testSrc, + testSrc("TestXOption.java")); + checkExit(Exit.OK); + checkOutput(false); } - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + private void checkOutput(boolean expectFound) { + // TODO: It's an ugly hidden side-effect of the current doclet API + // that the -X output from the tool and the -X output from the doclet + // come out on different streams! + // When we clean up the doclet API, this should be rationalized. + checkOutput(Output.NOTICE, expectFound, + "-Xmaxerrs ", + "-Xmaxwarns "); + checkOutput(Output.STDOUT, expectFound, + "-Xdocrootparent ", + "-Xdoclint ", + "-Xdoclint:"); } }
--- a/test/com/sun/javadoc/typeAnnotations/smoke/TestSmoke.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/com/sun/javadoc/typeAnnotations/smoke/TestSmoke.java Tue Nov 10 02:47:05 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,108 +27,84 @@ * @summary Smoke test for ensuring that annotations are emitted to javadoc * * @author Mahmood Ali <mali> - * @library ../../lib/ + * @library ../../lib * @ignore * @build JavadocTester - * @build TestSmoke * @run main TestSmoke */ public class TestSmoke extends JavadocTester { - //Test information. - private static final String BUG_ID = "8006735"; - - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-private", "-sourcepath", SRC_DIR, "pkg" - }; + public static void main(String... args) throws Exception { + TestSmoke tester = new TestSmoke(); + tester.runTests(); + } - //Input for string search tests. - private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "T0x1C.html", "@DA"}, - {BUG_ID + FS + "pkg" + FS + "T0x1D.html", "@DA"}, - {BUG_ID + FS + "pkg" + FS + "T0x0D.html", "@DA"}, - {BUG_ID + FS + "pkg" + FS + "T0x06.html", "@DA"}, - {BUG_ID + FS + "pkg" + FS + "T0x0B.html", "@DA"}, - {BUG_ID + FS + "pkg" + FS + "T0x0F.html", "@DA"}, + @Test + void test() { + javadoc("-d", "out", + "-private", + "-sourcepath", testSrc, + "pkg"); + checkExit(Exit.OK); + + checkOutput("pkg/T0x1C.html", true, "@DA"); + checkOutput("pkg/T0x1D.html", true, "@DA"); + checkOutput("pkg/T0x0D.html", true, "@DA"); + checkOutput("pkg/T0x06.html", true, "@DA"); + checkOutput("pkg/T0x0B.html", true, "@DA"); + checkOutput("pkg/T0x0F.html", true, "@DA"); /* @ignore 8013406: Test cases fail in javadoc test TestSmoke.java - {BUG_ID + FS + "pkg" + FS + "T0x20.html", "@DA"}, + checkOutput("pkg/T0x20.html", true, "@DA"); */ /* @ignore 8013406: Test cases fail in javadoc test TestSmoke.java - {BUG_ID + FS + "pkg" + FS + "T0x20A.html", "@DTPA"}, + checkOutput("pkg/T0x20A.html", true, "@DTPA"); */ /* @ignore 8013406: Test cases fail in javadoc test TestSmoke.java - {BUG_ID + FS + "pkg" + FS + "T0x20B.html", "@DA"}, + checkOutput("pkg/T0x20B.html", true, "@DA"); */ /* @ignore 8013406: Test cases fail in javadoc test TestSmoke.java - {BUG_ID + FS + "pkg" + FS + "T0x22.html", "@DA"}, + checkOutput("pkg/T0x22.html", true, "@DA"); */ /* @ignore 8013406: Test cases fail in javadoc test TestSmoke.java - {BUG_ID + FS + "pkg" + FS + "T0x22A.html", "@DTPA"}, + checkOutput("pkg/T0x22A.html", true, "@DTPA"); */ /* @ignore 8013406: Test cases fail in javadoc test TestSmoke.java - {BUG_ID + FS + "pkg" + FS + "T0x22B.html", "@DA"}, + checkOutput("pkg/T0x22B.html", true, "@DA"); */ - {BUG_ID + FS + "pkg" + FS + "T0x10.html", "@DA"}, - {BUG_ID + FS + "pkg" + FS + "T0x10A.html", "@DA"}, - {BUG_ID + FS + "pkg" + FS + "T0x12.html", "@DA"}, - {BUG_ID + FS + "pkg" + FS + "T0x11.html", "@DA"}, - {BUG_ID + FS + "pkg" + FS + "T0x13.html", "@DA"}, - {BUG_ID + FS + "pkg" + FS + "T0x15.html", "@DA"}, - {BUG_ID + FS + "pkg" + FS + "T0x14.html", "@DA"}, - {BUG_ID + FS + "pkg" + FS + "T0x16.html", "@DA"} - }; + checkOutput("pkg/T0x10.html", true, "@DA"); + checkOutput("pkg/T0x10A.html", true, "@DA"); + checkOutput("pkg/T0x12.html", true, "@DA"); + checkOutput("pkg/T0x11.html", true, "@DA"); + checkOutput("pkg/T0x13.html", true, "@DA"); + checkOutput("pkg/T0x15.html", true, "@DA"); + checkOutput("pkg/T0x14.html", true, "@DA"); + checkOutput("pkg/T0x16.html", true, "@DA"); - private static final String[][] NEGATED_TEST = { - {BUG_ID + FS + "pkg" + FS + "T0x1C.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x1D.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x00.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x01.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x02.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x04.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x08.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x0D.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x06.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x0B.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x0F.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x20.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x20A.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x20B.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x22.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x22A.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x22B.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x10.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x10A.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x12.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x11.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x13.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x15.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x14.html", "@A"}, - {BUG_ID + FS + "pkg" + FS + "T0x16.html", "@A"} - }; - - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestSmoke tester = new TestSmoke(); - run(tester, ARGS, TEST, NEGATED_TEST); - tester.printSummary(); - } - - /** - * {@inheritDoc} - */ - public String getBugId() { - return BUG_ID; - } - - /** - * {@inheritDoc} - */ - public String getBugName() { - return getClass().getName(); + checkOutput("pkg/T0x1C.html", false, "@A"); + checkOutput("pkg/T0x1D.html", false, "@A"); + checkOutput("pkg/T0x00.html", false, "@A"); + checkOutput("pkg/T0x01.html", false, "@A"); + checkOutput("pkg/T0x02.html", false, "@A"); + checkOutput("pkg/T0x04.html", false, "@A"); + checkOutput("pkg/T0x08.html", false, "@A"); + checkOutput("pkg/T0x0D.html", false, "@A"); + checkOutput("pkg/T0x06.html", false, "@A"); + checkOutput("pkg/T0x0B.html", false, "@A"); + checkOutput("pkg/T0x0F.html", false, "@A"); + checkOutput("pkg/T0x20.html", false, "@A"); + checkOutput("pkg/T0x20A.html", false, "@A"); + checkOutput("pkg/T0x20B.html", false, "@A"); + checkOutput("pkg/T0x22.html", false, "@A"); + checkOutput("pkg/T0x22A.html", false, "@A"); + checkOutput("pkg/T0x22B.html", false, "@A"); + checkOutput("pkg/T0x10.html", false, "@A"); + checkOutput("pkg/T0x10A.html", false, "@A"); + checkOutput("pkg/T0x12.html", false, "@A"); + checkOutput("pkg/T0x11.html", false, "@A"); + checkOutput("pkg/T0x13.html", false, "@A"); + checkOutput("pkg/T0x15.html", false, "@A"); + checkOutput("pkg/T0x14.html", false, "@A"); + checkOutput("pkg/T0x16.html", false, "@A"); } }
--- a/test/tools/javadoc/6964914/JavacWarning.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/tools/javadoc/6964914/JavacWarning.java Tue Nov 10 02:47:05 2020 +0000 @@ -22,5 +22,5 @@ */ public class JavacWarning { - int enum; // warning in source 1.4 + String _ = null; // this will cause a warning. It may be deprecated in JDK8 }
--- a/test/tools/javadoc/6964914/Test.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/tools/javadoc/6964914/Test.java Tue Nov 10 02:47:05 2020 +0000 @@ -46,7 +46,6 @@ File testSrc = new File(System.getProperty("test.src")); String[] args = { "-Xdoclint:none", - "-source", "1.4", // enables certain Parser warnings "-bootclasspath", System.getProperty("sun.boot.class.path"), "-classpath", ".", "-package",
--- a/test/tools/javadoc/LangVers.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/tools/javadoc/LangVers.java Tue Nov 10 02:47:05 2020 +0000 @@ -42,7 +42,7 @@ "javadoc", "LangVers", LangVers.class.getClassLoader(), - new String[] {"-source", "1.5", thisFile}) != 0) + new String[] {thisFile}) != 0) throw new Error("Javadoc encountered warnings or errors."); }
--- a/test/tools/javadoc/sourceOption/SourceOption.java Thu Nov 05 05:11:09 2020 +0000 +++ b/test/tools/javadoc/sourceOption/SourceOption.java Tue Nov 10 02:47:05 2020 +0000 @@ -26,6 +26,31 @@ * @bug 6507179 * @summary Ensure that "-source" option isn't ignored. * @author Scott Seligman + * @run main/fail SourceOption 7 + * @run main SourceOption 9 + * @run main SourceOption + */ + +/* + * TEST NOTE + * With JDK9, this test has been transformed into a NEGATIVE test. + * + * Generally speaking, this test should check a feature not in at least + * one of the currently supported previous versions. In this manner, + * a failure of the -source option to be honored would mean a pass of + * the test, and therefore a failure of the -source option. + * + * For JDK9 and JDK10, both support 1.7, which did not support javac's + * lambda construct. So we set "-source 1.7" to compile a .java file + * containing the lambda construct. javac should fail, thus showing + * -source to be working. Thus the test passes. + * + * The second jtreg @run command checks to make sure that the source + * provided is valid for the current release of the JDK. + * + * fixVersion: JDK11 + * replace ./p/LambdaConstructTest.java with a missing from + * JDK8, JDK9, or JDK10. Set -source below appropriately. */ import com.sun.javadoc.*; @@ -33,12 +58,22 @@ public class SourceOption extends Doclet { public static void main(String[] args) { + String[] params; + if ((args == null) || (args.length==0)) { + params = new String[]{"p"}; + System.out.println("NOTE : -source not provided, default taken"); + } else { + params = new String[]{"-source", args[0], "p"}; + System.out.println("NOTE : -source will be: " + args[0]); + } + if (com.sun.tools.javadoc.Main.execute( "javadoc", "SourceOption", SourceOption.class.getClassLoader(), - new String[] {"-source", "1.3", "p"}) != 0) - throw new Error("Javadoc encountered warnings or errors."); + params) != 0) + throw new Error("Javadoc encountered warnings or errors."); + } public static boolean start(RootDoc root) {
--- a/test/tools/javadoc/sourceOption/p/A.java Thu Nov 05 05:11:09 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package p; - -public class A { - boolean assert; // illegal since 1.4 - boolean enum; // illegal since 5 -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javadoc/sourceOption/p/LambdaConstructTest.java Tue Nov 10 02:47:05 2020 +0000 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class LambdaConstructTest { + public static void main(String[] args) { + + System.out.println("=== LambdaConstructTest ==="); + + // Lambda Runnable + Runnable lambda = () -> System.out.println("it's a Lambda world!"); + + // Run it! + lambda.run(); + + } +} +