1 /*
   2  * Copyright 2002-2005 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  20  * CA 95054 USA or visit www.sun.com if you need additional information or
  21  * have any questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug     4496223 4496270 4618686 4720974 4812240 6253614 6253604
  27  * @summary <DESC>
  28  * @author  jamieh
  29  * @library ../lib/
  30  * @build JavadocTester
  31  * @build TestTagInheritence
  32  * @run main TestTagInheritence
  33  */
  34 
  35 public class TestTagInheritence extends JavadocTester {
  36 
  37     private static final String BUG_ID = "4496223-4496270-4618686-4720974-4812240-6253614-6253604";
  38     private static final String[] ARGS = new String[] {
  39         "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "firstSentence", "firstSentence2"
  40     };
  41 
  42     /**
  43      * The entry point of the test.
  44      * @param args the array of command line arguments.
  45      */
  46     public static void main(String[] args) {
  47         String[][] tests = new String[42][2];
  48         //Test bad inheritDoc tag warning.
  49         tests[0][0]= WARNING_OUTPUT;
  50         tests[0][1] = "warning - @inheritDoc used but testBadInheritDocTag() " +
  51             "does not override or implement any method.";
  52 
  53         //Test valid usage of inheritDoc tag.
  54         for (int i = 1; i < tests.length-2; i++) {
  55             tests[i][0] = BUG_ID + FS + "pkg" + FS + "TestTagInheritence.html";
  56             tests[i][1] = "Test " + i + " passes";
  57         }
  58 
  59         //First sentence test (6253614)
  60         tests[tests.length - 2][0] =BUG_ID + FS + "firstSentence" + FS +
  61             "B.html";
  62         tests[tests.length - 2][1] =  "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;First sentence.</TD>";
  63 
  64         //Another first sentence test (6253604)
  65         tests[tests.length - 1][0] =BUG_ID + FS + "firstSentence2" + FS +
  66             "C.html";
  67         tests[tests.length - 1][1] =  "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;First sentence.</TD>";
  68 
  69         TestTagInheritence tester = new TestTagInheritence();
  70         run(tester, ARGS, tests, NO_TEST);
  71         tester.printSummary();
  72     }
  73 
  74     /**
  75      * {@inheritDoc}
  76      */
  77     public String getBugId() {
  78         return BUG_ID;
  79     }
  80 
  81     /**
  82      * {@inheritDoc}
  83      */
  84     public String getBugName() {
  85         return getClass().getName();
  86     }
  87 }