2015-11-28 18:52:17 -08:00
/ *
2024-01-18 19:06:26 +00:00
* Copyright ( c ) 2015 , 2024 , Oracle and / or its affiliates . All rights reserved .
2015-11-28 18:52:17 -08:00
* 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
2017-10-10 17:02:52 -07:00
* @bug 8141492 8071982 8141636 8147890 8166175 8168965 8176794 8175218 8147881
2018-05-29 11:20:04 -07:00
* 8181622 8182263 8074407 8187521 8198522 8182765 8199278 8196201 8196202
2021-03-25 08:56:49 +00:00
* 8184205 8214468 8222548 8223378 8234746 8241219 8254627 8247994 8263528
2023-10-23 09:24:51 +00:00
* 8266808 8248863 8305710 8318082
2015-11-28 18:52:17 -08:00
* @summary Test the search feature of javadoc .
2018-12-21 10:38:33 -08:00
* @library . . / . . / lib
8142968: Module System implementation
Initial integration of JEP 200, JEP 260, JEP 261, and JEP 282
Co-authored-by: Alex Buckley <alex.buckley@oracle.com>
Co-authored-by: Jonathan Gibbons <jonathan.gibbons@oracle.com>
Co-authored-by: Karen Kinnear <karen.kinnear@oracle.com>
Co-authored-by: Mandy Chung <mandy.chung@oracle.com>
Co-authored-by: Mark Reinhold <mark.reinhold@oracle.com>
Co-authored-by: Jan Lahoda <jan.lahoda@oracle.com>
Co-authored-by: Vicente Romero <vicente.romero@oracle.com>
Co-authored-by: Andreas Lundblad <andreas.lundblad@oracle.com>
Co-authored-by: Andrey Nazarov <andrey.x.nazarov@oracle.com>
Co-authored-by: Chris Hegarty <chris.hegarty@oracle.com>
Co-authored-by: Erik Joelsson <erik.joelsson@oracle.com>
Co-authored-by: Kumar Srinivasan <kumar.x.srinivasan@oracle.com>
Co-authored-by: Sundararajan Athijegannathan <sundararajan.athijegannathan@oracle.com>
Reviewed-by: jjg, jlahoda, vromero, mcimadamore, bpatel, ksrini, darcy, anazarov, dfuchs
2016-03-17 19:04:28 +00:00
* @modules jdk . javadoc / jdk . javadoc . internal . tool
2018-12-21 10:38:33 -08:00
* @build javadoc . tester . *
2015-11-28 18:52:17 -08:00
* @run main TestSearch
* /
2020-02-07 17:00:23 -08:00
import java.util.Locale ;
2020-03-23 14:11:52 -07:00
import java.util.Set ;
import java.util.TreeSet ;
import java.util.regex.Matcher ;
import java.util.regex.Pattern ;
2020-02-07 17:00:23 -08:00
2018-12-21 10:38:33 -08:00
import javadoc.tester.JavadocTester ;
2015-11-28 18:52:17 -08:00
public class TestSearch extends JavadocTester {
public static void main ( String . . . args ) throws Exception {
2022-12-22 21:20:43 +00:00
var tester = new TestSearch ( ) ;
2015-11-28 18:52:17 -08:00
tester . runTests ( ) ;
}
@Test
2018-12-21 10:38:33 -08:00
public void test1 ( ) {
2018-03-06 10:45:47 -08:00
javadoc ( " -d " , " out-1 " ,
" -sourcepath " ,
" -use " ,
testSrc ( " UnnamedPkgClass.java " ) ) ;
2015-11-28 18:52:17 -08:00
checkExit ( Exit . OK ) ;
2023-05-25 07:40:44 +00:00
checkSearchOutput ( " UnnamedPkgClass.html " , true ) ;
2015-11-28 18:52:17 -08:00
checkJqueryAndImageFiles ( true ) ;
2016-10-13 10:48:09 -07:00
checkSearchJS ( ) ;
2015-11-28 18:52:17 -08:00
checkFiles ( true ,
2017-01-26 13:01:12 -08:00
" member-search-index.js " ,
2020-07-13 11:33:50 +02:00
" module-search-index.js " ,
" package-search-index.js " ,
" tag-search-index.js " ,
2022-05-06 08:56:42 +00:00
" type-search-index.js " ,
" search.html " ) ;
2015-11-28 18:52:17 -08:00
}
@Test
2018-12-21 10:38:33 -08:00
public void test2 ( ) {
2018-03-06 10:45:47 -08:00
javadoc ( " -d " , " out-2 " ,
" -Xdoclint:none " ,
" -sourcepath " , testSrc ,
" -use " ,
" pkg " , " pkg1 " , " pkg2 " , " pkg3 " ) ;
2015-11-28 18:52:17 -08:00
checkExit ( Exit . OK ) ;
checkInvalidUsageIndexTag ( ) ;
checkSearchOutput ( true ) ;
2023-05-25 07:40:44 +00:00
checkSingleIndex ( ) ;
2017-07-15 14:51:42 -07:00
checkSingleIndexSearchTagDuplication ( ) ;
2023-05-25 07:40:44 +00:00
checkSearchTagIndex ( ) ;
2015-11-28 18:52:17 -08:00
checkJqueryAndImageFiles ( true ) ;
2016-10-13 10:48:09 -07:00
checkSearchJS ( ) ;
2018-05-17 12:59:53 -07:00
checkAllPkgsAllClasses ( ) ;
2015-11-28 18:52:17 -08:00
checkFiles ( true ,
2017-01-26 13:01:12 -08:00
" member-search-index.js " ,
2020-07-13 11:33:50 +02:00
" module-search-index.js " ,
2017-01-26 13:01:12 -08:00
" package-search-index.js " ,
" tag-search-index.js " ,
2022-05-06 08:56:42 +00:00
" type-search-index.js " ,
" search.html " ) ;
2015-11-28 18:52:17 -08:00
}
@Test
2018-12-21 10:38:33 -08:00
public void test2a ( ) {
2018-03-06 10:45:47 -08:00
javadoc ( " -d " , " out-2a " ,
" -Xdoclint:all " ,
" -sourcepath " , testSrc ,
" -use " ,
" pkg " , " pkg1 " , " pkg2 " , " pkg3 " ) ;
2016-10-10 06:47:47 -07:00
checkExit ( Exit . ERROR ) ;
2015-11-28 18:52:17 -08:00
checkDocLintErrors ( ) ;
checkSearchOutput ( true ) ;
2023-05-25 07:40:44 +00:00
checkSingleIndex ( ) ;
2017-07-15 14:51:42 -07:00
checkSingleIndexSearchTagDuplication ( ) ;
2023-05-25 07:40:44 +00:00
checkSearchTagIndex ( ) ;
2015-11-28 18:52:17 -08:00
checkJqueryAndImageFiles ( true ) ;
2016-10-13 10:48:09 -07:00
checkSearchJS ( ) ;
2015-11-28 18:52:17 -08:00
checkFiles ( true ,
2017-01-26 13:01:12 -08:00
" member-search-index.js " ,
" package-search-index.js " ,
" tag-search-index.js " ,
2022-05-06 08:56:42 +00:00
" type-search-index.js " ,
" search.html " ) ;
2015-11-28 18:52:17 -08:00
}
@Test
2018-12-21 10:38:33 -08:00
public void test3 ( ) {
2018-03-06 10:45:47 -08:00
javadoc ( " -d " , " out-3 " ,
" -noindex " ,
" -Xdoclint:none " ,
2015-11-28 18:52:17 -08:00
" -sourcepath " , testSrc ,
2018-03-06 10:45:47 -08:00
" -use " ,
" pkg " , " pkg1 " , " pkg2 " , " pkg3 " ) ;
2015-11-28 18:52:17 -08:00
checkExit ( Exit . OK ) ;
checkSearchOutput ( false ) ;
checkJqueryAndImageFiles ( false ) ;
checkFiles ( false ,
2017-01-26 13:01:12 -08:00
" member-search-index.js " ,
" package-search-index.js " ,
" tag-search-index.js " ,
" type-search-index.js " ,
2018-05-17 12:59:53 -07:00
" index-all.html " ,
" allpackages-index.html " ,
2022-05-06 08:56:42 +00:00
" allclasses-index.html " ,
2023-08-09 07:01:15 +00:00
" script-files/search-page.js " ,
2022-05-06 08:56:42 +00:00
" search.html " ) ;
2015-11-28 18:52:17 -08:00
}
@Test
2018-12-21 10:38:33 -08:00
public void test4 ( ) {
2018-03-06 10:45:47 -08:00
javadoc ( " -d " , " out-4 " ,
" -html5 " ,
" -Xdoclint:none " ,
2015-11-28 18:52:17 -08:00
" -sourcepath " , testSrc ,
2018-03-06 10:45:47 -08:00
" -use " ,
" pkg " , " pkg1 " , " pkg2 " , " pkg3 " ) ;
2015-11-28 18:52:17 -08:00
checkExit ( Exit . OK ) ;
checkSearchOutput ( true ) ;
2023-05-25 07:40:44 +00:00
checkSingleIndex ( ) ;
2017-07-15 14:51:42 -07:00
checkSingleIndexSearchTagDuplication ( ) ;
2015-11-28 18:52:17 -08:00
checkJqueryAndImageFiles ( true ) ;
2016-10-13 10:48:09 -07:00
checkSearchJS ( ) ;
2015-11-28 18:52:17 -08:00
checkFiles ( true ,
2017-01-26 13:01:12 -08:00
" member-search-index.js " ,
" package-search-index.js " ,
" tag-search-index.js " ,
2022-05-06 08:56:42 +00:00
" type-search-index.js " ,
" search.html " ) ;
2015-11-28 18:52:17 -08:00
}
@Test
2018-12-21 10:38:33 -08:00
public void test5 ( ) {
2018-03-06 10:45:47 -08:00
javadoc ( " -d " , " out-5 " ,
" -html5 " ,
" -noindex " ,
" -Xdoclint:none " ,
2015-11-28 18:52:17 -08:00
" -sourcepath " , testSrc ,
2018-03-06 10:45:47 -08:00
" -use " ,
" pkg " , " pkg1 " , " pkg2 " , " pkg3 " ) ;
2015-11-28 18:52:17 -08:00
checkExit ( Exit . OK ) ;
checkSearchOutput ( false ) ;
checkJqueryAndImageFiles ( false ) ;
checkFiles ( false ,
2017-01-26 13:01:12 -08:00
" member-search-index.js " ,
" package-search-index.js " ,
" tag-search-index.js " ,
" type-search-index.js " ,
2022-05-06 08:56:42 +00:00
" index-all.html " ,
2023-08-09 07:01:15 +00:00
" script-files/search-page.js " ,
2022-05-06 08:56:42 +00:00
" search.html " ) ;
2015-11-28 18:52:17 -08:00
}
@Test
2018-12-21 10:38:33 -08:00
public void test6 ( ) {
2018-03-06 10:45:47 -08:00
javadoc ( " -d " , " out-6 " ,
" -nocomment " ,
" -Xdoclint:none " ,
2015-11-28 18:52:17 -08:00
" -sourcepath " , testSrc ,
2018-03-06 10:45:47 -08:00
" -use " ,
" pkg " , " pkg1 " , " pkg2 " , " pkg3 " ) ;
2015-11-28 18:52:17 -08:00
checkExit ( Exit . OK ) ;
checkSearchOutput ( true ) ;
checkIndexNoComment ( ) ;
checkJqueryAndImageFiles ( true ) ;
2016-10-13 10:48:09 -07:00
checkSearchJS ( ) ;
2015-11-28 18:52:17 -08:00
checkFiles ( true ,
2017-01-26 13:01:12 -08:00
" member-search-index.js " ,
" package-search-index.js " ,
" tag-search-index.js " ,
2022-05-06 08:56:42 +00:00
" type-search-index.js " ,
" search.html " ) ;
2015-11-28 18:52:17 -08:00
}
@Test
2018-12-21 10:38:33 -08:00
public void test7 ( ) {
2018-03-06 10:45:47 -08:00
javadoc ( " -d " , " out-7 " ,
" -nodeprecated " ,
" -Xdoclint:none " ,
2015-11-28 18:52:17 -08:00
" -sourcepath " , testSrc ,
2018-03-06 10:45:47 -08:00
" -use " ,
" pkg " , " pkg1 " , " pkg2 " , " pkg3 " ) ;
2018-06-03 19:21:18 +05:30
2015-11-28 18:52:17 -08:00
checkExit ( Exit . OK ) ;
checkSearchOutput ( true ) ;
checkIndexNoDeprecated ( ) ;
checkJqueryAndImageFiles ( true ) ;
2016-10-13 10:48:09 -07:00
checkSearchJS ( ) ;
2015-11-28 18:52:17 -08:00
checkFiles ( true ,
2017-01-26 13:01:12 -08:00
" member-search-index.js " ,
" package-search-index.js " ,
" tag-search-index.js " ,
2022-05-06 08:56:42 +00:00
" type-search-index.js " ,
" search.html " ) ;
2015-11-28 18:52:17 -08:00
}
@Test
2018-12-21 10:38:33 -08:00
public void test8 ( ) {
2018-03-06 10:45:47 -08:00
javadoc ( " -d " , " out-8 " ,
" -splitindex " ,
" -Xdoclint:none " ,
" -sourcepath " , testSrc ,
" -use " ,
" pkg " , " pkg1 " , " pkg2 " , " pkg3 " ) ;
2015-11-28 18:52:17 -08:00
checkExit ( Exit . OK ) ;
checkInvalidUsageIndexTag ( ) ;
checkSearchOutput ( true ) ;
checkSplitIndex ( ) ;
2017-07-15 14:51:42 -07:00
checkSplitIndexSearchTagDuplication ( ) ;
2015-11-28 18:52:17 -08:00
checkJqueryAndImageFiles ( true ) ;
2016-10-13 10:48:09 -07:00
checkSearchJS ( ) ;
2015-11-28 18:52:17 -08:00
checkFiles ( true ,
2017-01-26 13:01:12 -08:00
" member-search-index.js " ,
" package-search-index.js " ,
" tag-search-index.js " ,
2022-05-06 08:56:42 +00:00
" type-search-index.js " ,
" search.html " ) ;
2015-11-28 18:52:17 -08:00
}
@Test
2018-12-21 10:38:33 -08:00
public void test9 ( ) {
2018-03-06 10:45:47 -08:00
javadoc ( " -d " , " out-9 " ,
" -sourcepath " , testSrc ,
" -javafx " ,
2018-04-24 11:54:03 -07:00
" --disable-javafx-strict-checks " ,
2018-03-06 10:45:47 -08:00
" -package " ,
" -use " ,
" pkgfx " , " pkg3 " ) ;
2015-11-28 18:52:17 -08:00
checkExit ( Exit . OK ) ;
checkSearchOutput ( true ) ;
checkJavaFXOutput ( ) ;
checkJqueryAndImageFiles ( true ) ;
2016-10-13 10:48:09 -07:00
checkSearchJS ( ) ;
2015-11-28 18:52:17 -08:00
checkFiles ( true ,
2017-01-26 13:01:12 -08:00
" member-search-index.js " ,
2020-07-13 11:33:50 +02:00
" module-search-index.js " ,
2017-01-26 13:01:12 -08:00
" package-search-index.js " ,
2020-07-13 11:33:50 +02:00
" tag-search-index.js " ,
2022-05-06 08:56:42 +00:00
" type-search-index.js " ,
" search.html " ) ;
2015-11-28 18:52:17 -08:00
}
2018-03-26 18:07:24 -07:00
@Test
2018-12-21 10:38:33 -08:00
public void testURLEncoding ( ) {
2018-03-26 18:07:24 -07:00
javadoc ( " -d " , " out-encode-html5 " ,
" -Xdoclint:none " ,
" -sourcepath " , testSrc ,
" -use " ,
" pkg " , " pkg1 " , " pkg2 " , " pkg3 " ) ;
checkExit ( Exit . OK ) ;
checkSearchJS ( ) ;
2023-05-25 07:40:44 +00:00
checkSearchIndex ( ) ;
2018-03-26 18:07:24 -07:00
}
2018-11-27 13:02:28 +01:00
@Test
2020-02-07 17:00:23 -08:00
public void testDefaultJapaneseLocale ( ) {
Locale prev = Locale . getDefault ( ) ;
Locale . setDefault ( Locale . forLanguageTag ( " ja-JP " ) ) ;
try {
javadoc ( " -d " , " out-jp-default " ,
" -Xdoclint:none " ,
" -sourcepath " , testSrc ,
" -use " ,
" pkg " , " pkg1 " , " pkg2 " , " pkg3 " ) ;
checkExit ( Exit . OK ) ;
checkOutput ( Output . OUT , true ,
" \ u30d1 \ u30c3 \ u30b1 \ u30fc \ u30b8pkg \ u306e \ u30bd \ u30fc \ u30b9 \ u30fb \ u30d5 \ u30a1 " +
" \ u30a4 \ u30eb \ u3092 \ u8aad \ u307f \ u8fbc \ u3093 \ u3067 \ u3044 \ u307e \ u3059... \ n " ,
" \ u30d1 \ u30c3 \ u30b1 \ u30fc \ u30b8pkg1 \ u306e \ u30bd \ u30fc \ u30b9 \ u30fb \ u30d5 \ u30a1 " +
" \ u30a4 \ u30eb \ u3092 \ u8aad \ u307f \ u8fbc \ u3093 \ u3067 \ u3044 \ u307e \ u3059... \ n " ) ;
checkSearchJS ( ) ;
2023-05-25 07:40:44 +00:00
checkSearchIndex ( ) ;
2020-02-07 17:00:23 -08:00
} finally {
Locale . setDefault ( prev ) ;
}
}
@Test
public void testJapaneseLocaleOption ( ) {
2018-11-27 13:02:28 +01:00
javadoc ( " -locale " , " ja_JP " ,
2020-02-07 17:00:23 -08:00
" -d " , " out-jp-option " ,
2018-11-27 13:02:28 +01:00
" -Xdoclint:none " ,
" -sourcepath " , testSrc ,
" -use " ,
" pkg " , " pkg1 " , " pkg2 " , " pkg3 " ) ;
checkExit ( Exit . OK ) ;
checkOutput ( Output . OUT , true ,
2020-05-05 13:02:30 -07:00
"""
Loading source files for package pkg...
" " " ,
"""
Loading source files for package pkg1...
" " " );
2020-02-07 17:00:23 -08:00
checkOutput ( " index.html " , true ,
" <span> \ u30d1 \ u30c3 \ u30b1 \ u30fc \ u30b8</span> " ) ;
2018-11-27 13:02:28 +01:00
checkSearchJS ( ) ;
2023-05-25 07:40:44 +00:00
checkSearchIndex ( ) ;
2018-11-27 13:02:28 +01:00
}
@Test
2020-02-07 17:00:23 -08:00
public void testDefaultChineseLocale ( ) {
Locale prev = Locale . getDefault ( ) ;
Locale . setDefault ( Locale . forLanguageTag ( " zh-CN " ) ) ;
try {
javadoc ( " -d " , " out-cn-default " ,
" -Xdoclint:none " ,
" -sourcepath " , testSrc ,
" -use " ,
" pkg " , " pkg1 " , " pkg2 " , " pkg3 " ) ;
checkExit ( Exit . OK ) ;
checkOutput ( Output . OUT , true ,
" \ u6b63 \ u5728 \ u52a0 \ u8f7d \ u7a0b \ u5e8f \ u5305pkg \ u7684 \ u6e90 \ u6587 \ u4ef6... \ n " ,
" \ u6b63 \ u5728 \ u52a0 \ u8f7d \ u7a0b \ u5e8f \ u5305pkg1 \ u7684 \ u6e90 \ u6587 \ u4ef6... \ n " ,
" \ u6b63 \ u5728 \ u52a0 \ u8f7d \ u7a0b \ u5e8f \ u5305pkg2 \ u7684 \ u6e90 \ u6587 \ u4ef6... \ n " ,
" \ u6b63 \ u5728 \ u52a0 \ u8f7d \ u7a0b \ u5e8f \ u5305pkg3 \ u7684 \ u6e90 \ u6587 \ u4ef6... \ n " ) ;
checkSearchJS ( ) ;
2023-05-25 07:40:44 +00:00
checkSearchIndex ( ) ;
2020-02-07 17:00:23 -08:00
} finally {
Locale . setDefault ( prev ) ;
}
}
@Test
public void testChineseLocaleOption ( ) {
2018-11-27 13:02:28 +01:00
javadoc ( " -locale " , " zh_CN " ,
2020-02-07 17:00:23 -08:00
" -d " , " out-cn-option " ,
2018-11-27 13:02:28 +01:00
" -Xdoclint:none " ,
" -sourcepath " , testSrc ,
" -use " ,
" pkg " , " pkg1 " , " pkg2 " , " pkg3 " ) ;
checkExit ( Exit . OK ) ;
checkOutput ( Output . OUT , true ,
2020-05-05 13:02:30 -07:00
"""
Loading source files for package pkg...
" " " ,
"""
Loading source files for package pkg1...
" " " ,
"""
Loading source files for package pkg2...
" " " ,
"""
Loading source files for package pkg3...
" " " );
2020-02-07 17:00:23 -08:00
checkOutput ( " index.html " , true ,
" <span> \ u7a0b \ u5e8f \ u5305</span> " ) ;
2018-11-27 13:02:28 +01:00
checkSearchJS ( ) ;
2023-05-25 07:40:44 +00:00
checkSearchIndex ( ) ;
2018-11-27 13:02:28 +01:00
}
2015-11-28 18:52:17 -08:00
void checkDocLintErrors ( ) {
checkOutput ( Output . OUT , true ,
2020-05-05 13:02:30 -07:00
"""
A sample method . Testing search tag for { @index " unclosed quote}. " " " ,
2015-11-28 18:52:17 -08:00
" Another test class. Testing empty {@index }. " ,
" Constant field. Testing no text in index tag {@index}. " ,
" A test field. Testing only white-spaces in index tag text {@index }. " ) ;
}
2023-05-25 07:40:44 +00:00
void checkSearchIndex ( ) {
checkOutput ( " member-search-index.js " , true ,
2020-05-05 13:02:30 -07:00
"""
{ " p " : " pkg " , " c " : " AnotherClass " , " l " : " AnotherClass() " , " u " : " %3Cinit%3E() " } " " " ,
"""
{ " p " : " pkg1 " , " c " : " RegClass " , " l " : " RegClass() " , " u " : " %3Cinit%3E() " } " " " ,
"""
{ " p " : " pkg2 " , " c " : " TestError " , " l " : " TestError() " , " u " : " %3Cinit%3E() " } " " " ,
"""
{ " p " : " pkg " , " c " : " AnotherClass " , " l " : " method(byte[], int, String) " , " u " : " method(byte[],int,java.lang.String) " } " " " );
2023-05-25 07:40:44 +00:00
checkOutput ( " member-search-index.js " , false ,
2020-05-05 13:02:30 -07:00
"""
{ " p " : " pkg " , " c " : " AnotherClass " , " l " : " method(RegClass) " , " u " : " method-pkg1.RegClass- " } " " " ,
"""
{ " p " : " pkg2 " , " c " : " TestClass " , " l " : " TestClass() " , " u " : " TestClass-- " } " " " ,
"""
{ " p " : " pkg " , " c " : " TestError " , " l " : " TestError() " , " u " : " TestError-- " } " " " ,
"""
{ " p " : " pkg " , " c " : " AnotherClass " , " l " : " method(byte[], int, String) " , " u " : " method-byte:A-int-java.lang.String- " } " " " );
2018-03-26 18:07:24 -07:00
}
2023-05-25 07:40:44 +00:00
void checkSearchOutput ( boolean expectedOutput ) {
checkSearchOutput ( " index.html " , expectedOutput ) ;
2018-02-26 17:18:15 -08:00
}
2023-05-25 07:40:44 +00:00
void checkSearchOutput ( String fileName , boolean expectedOutput ) {
2015-11-28 18:52:17 -08:00
// Test for search related markup
checkOutput ( fileName , expectedOutput ,
2020-05-05 13:02:30 -07:00
"""
2023-08-09 07:01:15 +00:00
< link rel = " stylesheet " type = " text/css " href = " resource-files/jquery-ui.min.css " title = " Style " >
2020-05-05 13:02:30 -07:00
" " " ,
"""
2024-04-19 10:03:59 +00:00
< script type = " text/javascript " src = " script-files/jquery-3.7.1.min.js " > < / script >
2020-05-05 13:02:30 -07:00
" " " ,
"""
2023-08-09 07:01:15 +00:00
< script type = " text/javascript " src = " script-files/jquery-ui.min.js " > < / script > " " " ,
2020-05-05 13:02:30 -07:00
"""
2024-01-18 19:06:26 +00:00
const pathtoroot = " ./ " ;
2020-05-05 13:02:30 -07:00
loadScripts ( document , ' script ' ) ; " " " ,
2020-03-13 10:57:41 -07:00
" <div class= \" nav-list-search \" > " ,
2020-05-05 13:02:30 -07:00
"""
2024-01-18 19:06:26 +00:00
< li > < a href = " search.html " > Search < / a > < / li > " " " ,
"""
< div class = " nav - list - search " >
< input type = " text " id = " search-input " disabled placeholder = " Search " aria - label = " S \
2024-02-28 18:13:16 +00:00
earch in documentation " autocomplete= " off " >
2024-01-18 19:06:26 +00:00
< input type = " reset " id = " reset-search " disabled value = " Reset " >
< / div > " " " );
2015-11-28 18:52:17 -08:00
}
2023-05-25 07:40:44 +00:00
void checkSingleIndex ( ) {
2015-11-28 18:52:17 -08:00
// Test for search tags markup in index file.
2023-05-25 07:40:44 +00:00
checkOutput ( " index-all.html " , true ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg/package-summary.html#phrasewithspaces " class = " search - tag - link " > \
phrase with spaces < / a > - Search tag in package pkg < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg/package-summary.html#pkg " class = " search - tag - link " >pkg</a> - Sea \
rch tag in package pkg < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg/package-summary.html#pkg2.5 " class = " search - tag - link " >pkg2.5</a> \
- Search tag in package pkg < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg/package-summary.html#r " class = " search - tag - link " >r</a> - Search \
tag in package pkg < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg1/RegClass.html#searchphrase " class = " search - tag - link " >search phr \
ase < / a > - Search tag in class pkg1 . RegClass < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg1/RegClass.html#SearchWordWithDescription " class = " search - tag - lin \
k " >SearchWordWithDescription</a> - Search tag in pkg1.RegClass.CONSTANT_FIELD_1< \
/ dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestAnnotationType.html#searchph \
rasewithdescdeprecated " class= " search - tag - link " >search phrase with desc deprecat \
ed < / a > - Search tag in annotation interface pkg2 . TestAnnotationType < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestClass.html#SearchTagDeprecatedClass " class = " search - tag - lin \
k " >SearchTagDeprecatedClass</a> - Search tag in class pkg2.TestClass</dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestEnum.html#searchphrasedeprecated " class = " search - tag - link " > \
search phrase deprecated < / a > - Search tag in pkg2 . TestEnum . ONE < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestEnum.html#searchphrasedeprecated " class = " search - tag - link " > \
search phrase deprecated < / a > - Search tag in pkg2 . TestEnum . ONE < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestError.html#SearchTagDeprecatedMethod " class = " search - tag - li \
nk " >SearchTagDeprecatedMethod</a> - Search tag in pkg2.TestError.TestError()</dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestError.html#SearchTagDeprecatedMethod " class = " search - tag - li \
nk " >SearchTagDeprecatedMethod</a> - Search tag in pkg2.TestError.TestError()</dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg/package-summary.html#SingleWord " class = " search - tag - link " >Single \
Word < / a > - Search tag in package pkg < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg/AnotherClass.ModalExclusionType.html#nested%7B@indexnested_tag_ \
test % 7D " class= " search - tag - link " >nested {@index nested_tag_test}</a> - Search ta \
g in pkg . AnotherClass . ModalExclusionType . NO_EXCLUDE < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2023-05-25 07:40:44 +00:00
< dt > < a href = " pkg/AnotherClass.ModalExclusionType.html#html%3Cspan%3Esee%3C/span%3E \
2021-02-12 08:32:47 +00:00
" class= " search - tag - link " >html <span> see </span></a> - Search tag i \
n pkg . AnotherClass . ModalExclusionType . APPLICATION_EXCLUDE < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg/AnotherClass.html#quoted " class = " search - tag - link " >quoted</a> - \
Search tag in pkg . AnotherClass . CONSTANT1 < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestEnum.html#ONE " class = " member - name - link " >ONE</a> - Enum con \
stant in enum class pkg2 . < a href = " pkg2/TestEnum.html " title = " enum class in pkg2 " \
> TestEnum < / a > < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestEnum.html#THREE " class = " member - name - link " >THREE</a> - Enum \
constant in enum class pkg2 . < a href = " pkg2/TestEnum.html " title = " enum class in p \
kg2 " >TestEnum</a></dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestEnum.html#TWO " class = " member - name - link " >TWO</a> - Enum con \
stant in enum class pkg2 . < a href = " pkg2/TestEnum.html " title = " enum class in pkg2 " \
> TestEnum < / a > < / dt > " " " );
2015-11-28 18:52:17 -08:00
}
void checkSplitIndex ( ) {
// Test for search tags markup in split index file.
2016-11-16 17:22:08 -08:00
checkOutput ( " index-files/index-13.html " , true ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg1/RegClass.html#searchphrase " class = " search - tag - link " >search \
phrase < / a > - Search tag in class pkg1 . RegClass < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg1/RegClass.html#SearchWordWithDescription " class = " search - tag - \
link " >SearchWordWithDescription</a> - Search tag in pkg1.RegClass.CONSTANT_FIELD \
_1 < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg2/TestAnnotationType.html#searchphrasewithdescdeprecated " cla \
ss = " search-tag-link " > search phrase with desc deprecated < / a > - Search tag in anno \
tation interface pkg2 . TestAnnotationType < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg2/TestClass.html#SearchTagDeprecatedClass " class = " search - tag - \
link " >SearchTagDeprecatedClass</a> - Search tag in class pkg2.TestClass</dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg2/TestEnum.html#searchphrasedeprecated " class = " search - tag - lin \
k " >search phrase deprecated</a> - Search tag in pkg2.TestEnum.ONE</dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg2/TestEnum.html#searchphrasedeprecated " class = " search - tag - lin \
k " >search phrase deprecated</a> - Search tag in pkg2.TestEnum.ONE</dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg2/TestError.html#SearchTagDeprecatedMethod " class = " search - tag \
- link " >SearchTagDeprecatedMethod</a> - Search tag in pkg2.TestError.TestError()</dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg2/TestError.html#SearchTagDeprecatedMethod " class = " search - tag \
- link " >SearchTagDeprecatedMethod</a> - Search tag in pkg2.TestError.TestError()</dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg/package-summary.html#SingleWord " class = " search - tag - link " >Sin \
gleWord < / a > - Search tag in package pkg < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-06-08 18:49:31 +00:00
< br > < a href = " ../allclasses-index.html " > All & nbsp ; Classes & nbsp ; and & nbsp ; Interfaces \
< / a > < span class = " vertical - separator " >|</span><a href= " . . / allpackages - index . html " \
> All & nbsp ; Packages < / a > " " " );
2016-11-16 17:22:08 -08:00
checkOutput ( " index-files/index-10.html " , true ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg/package-summary.html#phrasewithspaces " class = " search - tag - lin \
k " >phrase with spaces</a> - Search tag in package pkg</dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg/package-summary.html#pkg " class = " search - tag - link " >pkg</a> - \
Search tag in package pkg < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg/package-summary.html#pkg2.5 " class = " search - tag - link " >pkg2.5< \
/ a > - Search tag in package pkg < / dt > " " " );
2016-11-16 17:22:08 -08:00
checkOutput ( " index-files/index-12.html " , true ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg/package-summary.html#r " class = " search - tag - link " >r</a> - Sear \
ch tag in package pkg < / dt > " " " );
2015-11-28 18:52:17 -08:00
checkOutput ( " index-files/index-8.html " , true ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg/AnotherClass.ModalExclusionType.html#nested%7B@indexnested_t \
ag_test % 7D " class= " search - tag - link " >nested {@index nested_tag_test}</a> - Search \
tag in pkg . AnotherClass . ModalExclusionType . NO_EXCLUDE < / dt > " " " );
2015-11-28 18:52:17 -08:00
checkOutput ( " index-files/index-5.html " , true ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg/AnotherClass.ModalExclusionType.html#html%3Cspan%3Esee%3C/sp \
an % 3E " class= " search - tag - link " >html <span> see </span></a> - Search \
tag in pkg . AnotherClass . ModalExclusionType . APPLICATION_EXCLUDE < / dt > " " " );
2016-11-16 17:22:08 -08:00
checkOutput ( " index-files/index-11.html " , true ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg/AnotherClass.html#quoted " class = " search - tag - link " >quoted</a> \
- Search tag in pkg . AnotherClass . CONSTANT1 < / dt > " " " );
2016-11-16 17:22:08 -08:00
checkOutput ( " index-files/index-9.html " , true ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg2/TestEnum.html#ONE " class = " member - name - link " >ONE</a> - Enum \
constant in enum class pkg2 . < a href = " ../pkg2/TestEnum.html " title = " enum class in \
pkg2 " >TestEnum</a></dt> " " " ) ;
2016-11-16 17:22:08 -08:00
checkOutput ( " index-files/index-14.html " , true ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg2/TestEnum.html#THREE " class = " member - name - link " >THREE</a> - E \
num constant in enum class pkg2 . < a href = " ../pkg2/TestEnum.html " title = " enum clas \
s in pkg2 " >TestEnum</a></dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg2/TestEnum.html#TWO " class = " member - name - link " >TWO</a> - Enum \
constant in enum class pkg2 . < a href = " ../pkg2/TestEnum.html " title = " enum class in \
pkg2 " >TestEnum</a></dt> " " " ) ;
2015-11-28 18:52:17 -08:00
}
void checkIndexNoComment ( ) {
// Test for search tags markup in index file when javadoc is executed with -nocomment.
checkOutput ( " index-all.html " , false ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg/package-summary.html#phrasewithspaces " class = " search - tag - link " > \
phrase with spaces < / a > - Search tag in package pkg < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg/package-summary.html#pkg " class = " search - tag - link " >pkg</a> - Search tag in package pkg</dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg/package-summary.html#pkg2.5 " class = " search - tag - link " >pkg2.5</a> \
- Search tag in package pkg < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg/package-summary.html#r " class = " search - tag - link " >r</a> - Search tag in package pkg</dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg1/RegClass.html#searchphrase " class = " search - tag - link " >search phr \
ase < / a > - Search tag in class pkg1 . RegClass < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg1/RegClass.html#SearchWordWithDescription " class = " search - tag - lin \
k " >SearchWordWithDescription</a> - Search tag in pkg1.RegClass.CONSTANT_FIELD_1</dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestAnnotationType.html#searchphrasewithdescdeprecated " class = \
" search-tag-link " > search phrase with desc deprecated < / a > - Search tag in annotat \
ion interface pkg2 . TestAnnotationType < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestClass.html#SearchTagDeprecatedClass " class = " search - tag - lin \
k " >SearchTagDeprecatedClass</a> - Search tag in class pkg2.TestClass</dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg/package-summary.html#SingleWord " class = " search - tag - link " >Single \
2023-10-23 09:24:51 +00:00
Word < / a > - Search tag in package pkg < / dt > " " " );
2015-11-28 18:52:17 -08:00
checkOutput ( " index-all.html " , true ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestEnum.html#searchphrasedeprecated " class = " search - tag - link " > \
search phrase deprecated < / a > - Search tag in pkg2 . TestEnum . ONE < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestError.html#SearchTagDeprecatedMethod " class = " search - tag - li \
nk " >SearchTagDeprecatedMethod</a> - Search tag in pkg2.TestError.TestError()</dt> " " " ) ;
2015-11-28 18:52:17 -08:00
}
void checkIndexNoDeprecated ( ) {
// Test for search tags markup in index file when javadoc is executed using -nodeprecated.
checkOutput ( " index-all.html " , true ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg/package-summary.html#phrasewithspaces " class = " search - tag - link " > \
phrase with spaces < / a > - Search tag in package pkg < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg1/RegClass.html#searchphrase " class = " search - tag - link " >search phr \
ase < / a > - Search tag in class pkg1 . RegClass < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg1/RegClass.html#SearchWordWithDescription " class = " search - tag - lin \
k " >SearchWordWithDescription</a> - Search tag in pkg1.RegClass.CONSTANT_FIELD_1</dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg/package-summary.html#SingleWord " class = " search - tag - link " >Single \
Word < / a > - Search tag in package pkg < / dt > " " " );
2015-11-28 18:52:17 -08:00
checkOutput ( " index-all.html " , false ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestAnnotationType.html#searchphrasewithdescdeprecated " class = \
" search-tag-link " > search phrase with desc deprecated < / a > - Search tag in annotat \
ion interface pkg2 . TestAnnotationType < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestClass.html#SearchTagDeprecatedClass " class = " search - tag - lin \
k " >SearchTagDeprecatedClass</a> - Search tag in class pkg2.TestClass</dt> " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestEnum.html#searchphrasedeprecated " class = " search - tag - link " > \
search phrase deprecated < / a > - Search tag in pkg2 . TestEnum . ONE < / dt > " " " ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestError.html#SearchTagDeprecatedMethod " class = " search - tag - li \
2023-10-23 09:24:51 +00:00
nk " >SearchTagDeprecatedMethod</a> - Search tag in pkg2.TestError.TestError()</dt> " " " ) ;
2015-11-28 18:52:17 -08:00
}
void checkJavaFXOutput ( ) {
checkOutput ( " index-all.html " , false , " test treat as private " ) ;
}
void checkInvalidUsageIndexTag ( ) {
checkOutput ( Output . OUT , true ,
2021-05-25 01:33:13 +00:00
" AnotherClass.java:29: warning: invalid usage of tag {@index " ,
" AnotherClass.java:39: warning: invalid usage of tag {@index " ,
" AnotherClass.java:34: warning: invalid usage of tag {@index " ,
" AnotherClass.java:68: warning: invalid usage of tag {@index " ) ;
2015-11-28 18:52:17 -08:00
}
void checkJqueryAndImageFiles ( boolean expectedOutput ) {
checkFiles ( expectedOutput ,
2023-08-09 07:01:15 +00:00
" script-files/search.js " ,
2024-04-19 10:03:59 +00:00
" script-files/jquery-3.7.1.min.js " ,
2023-08-09 07:01:15 +00:00
" script-files/jquery-ui.min.js " ,
" resource-files/jquery-ui.min.css " ,
" resource-files/x.png " ,
" resource-files/glass.png " ) ;
2015-11-28 18:52:17 -08:00
}
2016-10-13 10:48:09 -07:00
void checkSearchJS ( ) {
2020-12-17 18:34:27 +00:00
// ensure all resource keys were resolved
2023-08-09 07:01:15 +00:00
checkOutput ( " script-files/search.js " , false ,
2020-12-17 18:34:27 +00:00
" ##REPLACE: " ) ;
2023-08-09 07:01:15 +00:00
checkOutput ( " script-files/search.js " , true ,
2022-05-05 14:46:43 +00:00
" function searchIndex(indexArray, category) { " ,
" function getURLPrefix(item, category) { " ,
" url += item.l; " ) ;
2020-03-23 14:11:52 -07:00
2023-08-09 07:01:15 +00:00
checkOutput ( " script-files/search-page.js " , true ,
2022-05-06 08:56:42 +00:00
" function renderResults(result) { " ,
" function selectTab(category) { " ) ;
2023-08-09 07:01:15 +00:00
checkCssClasses ( " script-files/search.js " , " resource-files/stylesheet.css " ) ;
2020-03-23 14:11:52 -07:00
}
void checkCssClasses ( String jsFile , String cssFile ) {
// Check that all CSS class names mentioned in the JavaScript file
// are also defined as class selectors somewhere in the stylesheet file.
String js = readOutputFile ( jsFile ) ;
Set < String > cssClasses = new TreeSet < > ( ) ;
addMatches ( js , Pattern . compile ( " class= \\ \\ * \" ([^ \\ \\ \" ]+) \\ \\ * \" " ) , cssClasses ) ;
addMatches ( js , Pattern . compile ( " attr \\ ( \" class \" , \" ([^ \" ]+) \" \\ ) " ) , cssClasses ) ;
// verify that the regex did find use of CSS class names
checking ( " Checking CSS classes found " ) ;
if ( cssClasses . isEmpty ( ) ) {
failed ( " no CSS classes found " ) ;
} else {
passed ( cssClasses . size ( ) + " found: " + cssClasses ) ;
}
checkOutput ( cssFile , true , cssClasses . toArray ( new String [ 0 ] ) ) ;
}
void addMatches ( String js , Pattern p , Set < String > cssClasses ) {
Matcher m = p . matcher ( js ) ;
while ( m . find ( ) ) {
cssClasses . add ( " . " + m . group ( 1 ) ) ;
}
2016-10-13 10:48:09 -07:00
}
2017-07-15 14:51:42 -07:00
void checkSingleIndexSearchTagDuplication ( ) {
// Test for search tags duplication in index file.
checkOutput ( " index-all.html " , true ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestError.html#SearchTagDeprecatedMethod " class = " search - tag - li \
nk " >SearchTagDeprecatedMethod</a> - Search tag in pkg2.TestError.TestError()</dt>
2020-05-05 13:02:30 -07:00
< dd > with description < / dd > " " " );
2017-07-15 14:51:42 -07:00
checkOutput ( " index-all.html " , false ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestError.html#SearchTagDeprecatedMethod " class = " search - tag - li \
nk " >SearchTagDeprecatedMethod</a> - Search tag in pkg2.TestError.TestError()</dt>
2020-05-05 13:02:30 -07:00
< dd > with description < / dd >
2021-02-12 08:32:47 +00:00
< dt > < a href = " pkg2/TestError.html#SearchTagDeprecatedMethod " class = " search - tag - li \
nk " >SearchTagDeprecatedMethod</a> - Search tag in pkg2.TestError.TestError()</dt>
2020-05-05 13:02:30 -07:00
< dd > with description < / dd > " " " );
2017-07-15 14:51:42 -07:00
}
void checkSplitIndexSearchTagDuplication ( ) {
// Test for search tags duplication in index file.
checkOutput ( " index-files/index-13.html " , true ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg2/TestError.html#SearchTagDeprecatedMethod " class = " search - tag \
- link " >SearchTagDeprecatedMethod</a> - Search tag in pkg2.TestError.TestError()</dt>
2020-05-05 13:02:30 -07:00
< dd > with description < / dd > " " " );
2017-07-15 14:51:42 -07:00
checkOutput ( " index-files/index-13.html " , false ,
2020-05-05 13:02:30 -07:00
"""
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg2/TestError.html#SearchTagDeprecatedMethod " class = " search - tag \
- link " >SearchTagDeprecatedMethod</a> - Search tag in pkg2.TestError.TestError()</dt>
2020-05-05 13:02:30 -07:00
< dd > with description < / dd >
2021-02-12 08:32:47 +00:00
< dt > < a href = " ../pkg2/TestError.html#SearchTagDeprecatedMethod " class = " search - tag \
- link " >SearchTagDeprecatedMethod</a> - Search tag in pkg2.TestError.TestError()</dt>
2020-05-05 13:02:30 -07:00
< dd > with description < / dd > " " " );
2017-07-15 14:51:42 -07:00
}
2018-05-17 12:59:53 -07:00
void checkAllPkgsAllClasses ( ) {
checkOutput ( " allclasses-index.html " , true ,
2020-05-05 13:02:30 -07:00
"""
2020-10-12 09:36:43 +00:00
< div id = " all-classes-table " >
< div class = " table - tabs " role= " tablist " aria-orientation= " horizontal " > \
< button id = " all-classes-table-tab0 " role = " tab " aria - selected = " true " aria - control \
s = " all-classes-table.tabpanel " tabindex = " 0 " onkeydown = " switchTab(event) " onclick \
= " show('all-classes-table', 'all-classes-table', 2) " class = " active - table - tab " >Al \
2021-05-07 10:44:02 +00:00
l Classes and Interfaces < / button > \
2020-10-12 09:36:43 +00:00
< button id = " all-classes-table-tab1 " role = " tab " aria - selected = " false " aria - contro \
ls = " all-classes-table.tabpanel " tabindex = " -1 " onkeydown = " switchTab(event) " oncli \
ck = " show('all-classes-table', 'all-classes-table-tab1', 2) " class = " table - tab " >In \
2021-05-07 10:44:02 +00:00
terfaces < / button > \
2020-10-12 09:36:43 +00:00
< button id = " all-classes-table-tab2 " role = " tab " aria - selected = " false " aria - contro \
ls = " all-classes-table.tabpanel " tabindex = " -1 " onkeydown = " switchTab(event) " oncli \
ck = " show('all-classes-table', 'all-classes-table-tab2', 2) " class = " table - tab " >Cl \
2021-05-07 10:44:02 +00:00
asses < / button > \
2020-10-12 09:36:43 +00:00
< button id = " all-classes-table-tab3 " role = " tab " aria - selected = " false " aria - contro \
ls = " all-classes-table.tabpanel " tabindex = " -1 " onkeydown = " switchTab(event) " oncli \
ck = " show('all-classes-table', 'all-classes-table-tab3', 2) " class = " table - tab " >En \
2021-05-07 10:44:02 +00:00
um Classes < / button > \
2020-10-12 09:36:43 +00:00
< button id = " all-classes-table-tab5 " role = " tab " aria - selected = " false " aria - contro \
ls = " all-classes-table.tabpanel " tabindex = " -1 " onkeydown = " switchTab(event) " oncli \
2021-05-07 10:44:02 +00:00
ck = " show('all-classes-table', 'all-classes-table-tab5', 2) " class = " table - tab " >Ex \
2021-10-28 10:41:49 +00:00
ception Classes < / button > \
2020-10-12 09:36:43 +00:00
< button id = " all-classes-table-tab6 " role = " tab " aria - selected = " false " aria - contro \
ls = " all-classes-table.tabpanel " tabindex = " -1 " onkeydown = " switchTab(event) " oncli \
2021-10-28 10:41:49 +00:00
ck = " show('all-classes-table', 'all-classes-table-tab6', 2) " class = " table - tab " >An \
2021-05-07 10:44:02 +00:00
notation Interfaces < / button > \
2020-10-12 09:36:43 +00:00
< / div >
2024-02-02 09:01:45 +00:00
< div id = " all-classes-table.tabpanel " role = " tabpanel " aria - labelledby = " all-classes-table-tab0 " >
< div class = " summary - table two - column - summary " >
2020-10-12 09:36:43 +00:00
< div class = " table - header col - first " >Class</div>
< div class = " table - header col - last " >Description</div> " " " ) ;
2018-05-17 12:59:53 -07:00
checkOutput ( " allpackages-index.html " , true ,
2020-05-05 13:02:30 -07:00
"""
2020-10-12 09:36:43 +00:00
< div class = " caption " ><span>Package Summary</span></div>
< div class = " summary - table two - column - summary " >
< div class = " table - header col - first " >Package</div>
< div class = " table - header col - last " >Description</div>
2020-05-05 13:02:30 -07:00
" " " );
2018-05-17 12:59:53 -07:00
checkOutput ( " type-search-index.js " , true ,
2020-05-05 13:02:30 -07:00
"""
2021-06-08 18:49:31 +00:00
{ " l " : " All Classes and Interfaces " , " u " : " allclasses-index.html " } " " " );
2018-05-17 12:59:53 -07:00
checkOutput ( " package-search-index.js " , true ,
2020-05-05 13:02:30 -07:00
"""
{ " l " : " All Packages " , " u " : " allpackages-index.html " } " " " );
2018-05-17 12:59:53 -07:00
checkOutput ( " index-all.html " , true ,
2021-06-08 18:49:31 +00:00
"""
< br > < a href = " allclasses-index.html " > All & nbsp ; Classes & nbsp ; and & nbsp ; Interface \
s < / a > < span class = " vertical - separator " >|</span><a href= " allpackages - index . htm \
l " >All Packages</a> " " " ) ;
2019-12-12 13:06:59 +00:00
}
2023-05-25 07:40:44 +00:00
void checkSearchTagIndex ( ) {
checkOutput ( " tag-search-index.js " , true ,
"""
{ " l " : " html <span> see </span> " , " h " : " pkg.AnotherClass.ModalExclusionType.APPLICATION_EXCLUDE " , " u " : " pkg/AnotherClass.ModalExclusionType.html#html<span>see</span> " } " " " ,
"""
{ " l " : " nested {@index nested_tag_test} " , " h " : " pkg.AnotherClass.ModalExclusionType.NO_EXCLUDE " , " u " : " pkg/AnotherClass.ModalExclusionType.html#nested{@indexnested_tag_test} " } " " " ,
"""
{ " l " : " phrase with spaces " , " h " : " package pkg " , " u " : " pkg/package-summary.html#phrasewithspaces " } , { " l " : " pkg " , " h " : " package pkg " , " u " : " pkg/package-summary.html#pkg " } " " " ,
"""
{ " l " : " quoted " , " h " : " pkg.AnotherClass.CONSTANT1 " , " d " : " no-space " , " u " : " pkg/AnotherClass.html#quoted " } " " " ,
"""
{ " l " : " r " , " h " : " package pkg " , " u " : " pkg/package-summary.html#r " } " " " ,
"""
{ " l " : " search phrase " , " h " : " class pkg1.RegClass " , " d " : " with description " , " u " : " pkg1/RegClass.html#searchphrase " } " " " ,
"""
{ " l " : " search phrase deprecated " , " h " : " pkg2.TestEnum.ONE " , " u " : " pkg2/TestEnum.html#searchphrasedeprecated " } " " " ,
"""
{ " l " : " search phrase with desc deprecated " , " h " : " annotation interface pkg2.TestAnnotationType " , " d " : " description for phrase deprecated " , " u " : " pkg2/TestAnnotationType.html#searchphrasewithdescdeprecated " } " " " ,
"""
{ " l " : " SearchTagDeprecatedClass " , " h " : " class pkg2.TestClass " , " u " : " pkg2/TestClass.html#SearchTagDeprecatedClass " } " " " ,
"""
{ " l " : " SearchTagDeprecatedMethod " , " h " : " pkg2.TestError.TestError() " , " d " : " with description " , " u " : " pkg2/TestError.html#SearchTagDeprecatedMethod " } " " " ,
"""
{ " l " : " search term with spaces " , " h " : " interface pkg.TestInterface " , " d " : " description " , " u " : " pkg/TestInterface.html#searchtermwithspaces " } " " " ,
"""
{ " l " : " SearchWordWithDescription " , " h " : " pkg1.RegClass.CONSTANT_FIELD_1 " , " d " : " search word with desc " , " u " : " pkg1/RegClass.html#SearchWordWithDescription " } " " " ,
"""
{ " l " : " Serialized Form " , " h " : " " , " u " : " serialized-form.html " } , { " l " : " SingleWord " , " h " : " package pkg " , " u " : " pkg/package-summary.html#SingleWord " } " " " ,
"""
{ " l " : " trailing " , " h " : " pkg.AnotherClass.method(byte[], int, String) " , " d " : " backslash \\ \\ " , " u " : " pkg/AnotherClass.html#trailing " } ] " " " );
}
2015-11-28 18:52:17 -08:00
}