WindowTitles.java revision 2416:94aca852a4d0
1/* 2 * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24/* 25 * @test 26 * @bug 4530730 27 * @summary stddoclet: With frames off, window titles have "()" appended 28 * @author dkramer 29 * @library ../lib 30 * @build JavadocTester 31 * @run main WindowTitles 32 */ 33 34/** 35 * Runs javadoc and runs regression tests on the resulting HTML. 36 */ 37public class WindowTitles extends JavadocTester { 38 39 public static void main(String... args) throws Exception { 40 WindowTitles tester = new WindowTitles(); 41 tester.runTests(); 42 } 43 44 @Test 45 void test() { 46 // Test for all cases except the split index page 47 javadoc("-d", "out-1", 48 "-use", 49 "-sourcepath", testSrc, 50 "p1", "p2"); 51 checkExit(Exit.OK); 52 53 checkTitle("overview-summary.html", "Overview"); 54 checkTitle("overview-tree.html", "Class Hierarchy"); 55 checkTitle("overview-frame.html", "Overview List"); 56 checkTitle("p1/package-summary.html", "p1"); 57 checkTitle("p1/package-frame.html", "p1"); 58 checkTitle("p1/package-tree.html", "p1 Class Hierarchy"); 59 checkTitle("p1/package-use.html", "Uses of Package p1"); 60 checkTitle("p1/C1.html", "C1"); 61 checkTitle("allclasses-frame.html", "All Classes"); 62 checkTitle("allclasses-noframe.html", "All Classes"); 63 checkTitle("constant-values.html", "Constant Field Values"); 64 checkTitle("deprecated-list.html", "Deprecated List"); 65 checkTitle("serialized-form.html", "Serialized Form"); 66 checkTitle("help-doc.html", "API Help"); 67 checkTitle("index-all.html", "Index"); 68 checkTitle("p1/class-use/C1.html", "Uses of Class p1.C1"); 69 } 70 71 @Test 72 void test2() { 73 // Test only for the split-index case (and run on only one package) 74 javadoc("-d", "out-2", 75 "-splitindex", 76 "-sourcepath", testSrc, 77 "p1"); 78 checkExit(Exit.OK); 79 80 checkTitle("index-files/index-1.html", "C-Index"); 81 } 82 83 void checkTitle(String file, String title) { 84 checkOutput(file, true, "<title>" + title + "</title>"); 85 } 86 87} 88