TestSubTitle.java revision 2365:6207608205b8
150479Speter/* 2327Sjkh * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. 3327Sjkh * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4327Sjkh * 5327Sjkh * This code is free software; you can redistribute it and/or modify it 6327Sjkh * under the terms of the GNU General Public License version 2 only, as 7327Sjkh * published by the Free Software Foundation. 8327Sjkh * 9327Sjkh * This code is distributed in the hope that it will be useful, but WITHOUT 10327Sjkh * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11327Sjkh * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12327Sjkh * version 2 for more details (a copy is included in the LICENSE file that 13327Sjkh * accompanied this code). 14327Sjkh * 15327Sjkh * You should have received a copy of the GNU General Public License version 16327Sjkh * 2 along with this work; if not, write to the Free Software Foundation, 17327Sjkh * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18327Sjkh * 19327Sjkh * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20327Sjkh * or visit www.oracle.com if you need additional information or have any 21327Sjkh * questions. 22327Sjkh */ 23327Sjkh 24327Sjkh/* 25327Sjkh * @test 26382Sjkh * @bug 7010342 27382Sjkh * @summary Test for correct sub title generation. 28327Sjkh * @author Bhavesh Patel 29152329Skrion * @library ../lib/ 30327Sjkh * @build JavadocTester 31327Sjkh * @build TestSubTitle 32154145Sflz * @run main TestSubTitle 33327Sjkh */ 34327Sjkh 35327Sjkhpublic class TestSubTitle extends JavadocTester { 36327Sjkh 37327Sjkh private static final String BUG_ID = "7010342"; 38131285Seik private static final String[][] TEST = { 3911780Sjkh {BUG_ID + "/pkg/package-summary.html", 40382Sjkh "<div class=\"block\">This is the description of package pkg.</div>" 41327Sjkh }, 42327Sjkh {BUG_ID + "/pkg/C.html", 4384745Ssobomax "<div class=\"subTitle\">pkg</div>" 4484745Ssobomax } 45327Sjkh }; 46327Sjkh private static final String[][] NEG_TEST = { 47 {BUG_ID + "/pkg/package-summary.html", 48 "<p class=\"subTitle\">\n" + 49 "<div class=\"block\">This is the " + 50 "description of package pkg.</div>\n" + 51 "</p>" 52 }, 53 {BUG_ID + "/pkg/C.html", 54 "<p class=\"subTitle\">pkg</p>" 55 } 56 }; 57 private static final String[] ARGS = new String[]{ 58 "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" 59 }; 60 61 /** 62 * The entry point of the test. 63 * @param args the array of command line arguments. 64 */ 65 public static void main(String[] args) { 66 TestSubTitle tester = new TestSubTitle(); 67 run(tester, ARGS, TEST, NEG_TEST); 68 tester.printSummary(); 69 } 70 71 /** 72 * {@inheritDoc} 73 */ 74 public String getBugId() { 75 return BUG_ID; 76 } 77 78 /** 79 * {@inheritDoc} 80 */ 81 public String getBugName() { 82 return getClass().getName(); 83 } 84} 85