langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java
changeset 9170 56670ec8e643
parent 8841 b4422fa4f2e6
child 14060 ae69cea86e83
equal deleted inserted replaced
9169:644cd4523a01 9170:56670ec8e643
     1 /*
     1 /*
     2  * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 4496290 4985072
    26  * @bug 4496290 4985072 7006178
    27  * @summary A simple test to determine if -use works.
    27  * @summary A simple test to determine if -use works.
    28  * @author jamieh
    28  * @author jamieh
    29  * @library ../lib/
    29  * @library ../lib/
    30  * @build JavadocTester
    30  * @build JavadocTester
    31  * @build TestUseOption
    31  * @build TestUseOption
    32  * @run main TestUseOption
    32  * @run main TestUseOption
    33  */
    33  */
    34 
    34 
    35 public class TestUseOption extends JavadocTester {
    35 public class TestUseOption extends JavadocTester {
    36 
    36 
    37     private static final String BUG_ID = "4496290-4985072";
    37     private static final String BUG_ID = "4496290-4985072-7006178";
    38 
    38 
    39     //Input for string search tests.
    39     //Input for string search tests.
    40     private static final String[] TEST2 = {
    40     private static final String[] TEST2 = {
    41         "Field in C1.",
    41         "Field in C1.",
    42         "Field in C2.",
    42         "Field in C2.",
    52         "Method in C6.",
    52         "Method in C6.",
    53         "Method in C7.",
    53         "Method in C7.",
    54         "Method in C8.",
    54         "Method in C8.",
    55     };
    55     };
    56 
    56 
       
    57     private static final String[][] TEST3 = {
       
    58         {BUG_ID + "-3" + FS + "class-use" + FS + "UsedInC.html", "Uses of <a href=" +
       
    59                  "\"../UsedInC.html\" title=\"class in &lt;Unnamed&gt;\">" +
       
    60                  "UsedInC</a> in <a href=\"../package-summary.html\">&lt;Unnamed&gt;</a>"
       
    61         },
       
    62         {BUG_ID + "-3" + FS + "package-use.html", "<td class=\"colOne\">" +
       
    63                  "<a href=\"class-use/UsedInC.html#&lt;Unnamed&gt;\">UsedInC</a>&nbsp;</td>"
       
    64         }
       
    65     };
       
    66 
    57     private static final String[] ARGS = new String[] {
    67     private static final String[] ARGS = new String[] {
    58         "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
    68         "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
    59     };
    69     };
    60 
    70 
    61     private static final String[] ARGS2 = new String[] {
    71     private static final String[] ARGS2 = new String[] {
    62         "-d", BUG_ID+"-2", "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
    72         "-d", BUG_ID+"-2", "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
       
    73     };
       
    74 
       
    75     private static final String[] ARGS3 = new String[] {
       
    76         "-d", BUG_ID + "-3", "-sourcepath", SRC_DIR, "-use", SRC_DIR + FS + "C.java", SRC_DIR + FS + "UsedInC.java"
    63     };
    77     };
    64 
    78 
    65     /**
    79     /**
    66      * The entry point of the test.
    80      * The entry point of the test.
    67      * @param args the array of command line arguments.
    81      * @param args the array of command line arguments.
    91             if (currentIndex < prevIndex)
   105             if (currentIndex < prevIndex)
    92                 throw new Exception(TEST2[i] + " is in the wrong order.");
   106                 throw new Exception(TEST2[i] + " is in the wrong order.");
    93             prevIndex = currentIndex;
   107             prevIndex = currentIndex;
    94         }
   108         }
    95         tester.printSummary();
   109         tester.printSummary();
       
   110         run(tester, ARGS3, TEST3, NO_TEST);
       
   111         tester.printSummary();
    96     }
   112     }
    97 
   113 
    98     /**
   114     /**
    99      * {@inheritDoc}
   115      * {@inheritDoc}
   100      */
   116      */