langtools/test/jdk/javadoc/doclet/testOrdering/TestOrdering.java
changeset 42000 8b7412f7eecd
parent 40511 1b3c502e0bdc
child 43570 c7b68caf3ab4
equal deleted inserted replaced
41999:dbf796210eff 42000:8b7412f7eecd
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 8039410 8042601 8042829 8049393 8050031 8155061 8155995
    26  * @bug 8039410 8042601 8042829 8049393 8050031 8155061 8155995 8167967
    27  * @summary test to determine if members are ordered correctly
    27  * @summary test to determine if members are ordered correctly
    28  * @author ksrini
       
    29  * @library ../lib/
    28  * @library ../lib/
    30  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    29  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    31  * @build JavadocTester
    30  * @build JavadocTester
    32  * @run main TestOrdering
    31  * @run main TestOrdering
    33  */
    32  */
    49         tester.runTests();
    48         tester.runTests();
    50     }
    49     }
    51 
    50 
    52     @Test
    51     @Test
    53     void testUnnamedPackagesForClassUse() {
    52     void testUnnamedPackagesForClassUse() {
    54         javadoc("-d", "out",
    53         new UnnamedPackageForClassUseTest(this).run();
    55                 "-sourcepath", testSrc,
       
    56                 "-use",
       
    57                 testSrc("C.java"), testSrc("UsedInC.java"));
       
    58         checkExit(Exit.OK);
       
    59         checkExecutableMemberOrdering("class-use/UsedInC.html");
       
    60     }
    54     }
    61 
    55 
    62     @Test
    56     @Test
    63     void testNamedPackagesForClassUse() {
    57     void testNamedPackagesForClassUse() {
    64         javadoc("-d", "out-1",
    58         new NamedPackagesForClassUseTest(this).run();
    65                 "-sourcepath", testSrc,
    59     }
    66                 "-use",
    60 
    67                 "pkg1");
       
    68         checkExit(Exit.OK);
       
    69         checkClassUseOrdering("pkg1/class-use/UsedClass.html");
       
    70         checkOrder("pkg1/class-use/UsedClass.html", expectedClassUseMethodOrdering);
       
    71         checkOrder("pkg1/class-use/UsedClass.html", expectedClassUseWithTypeParams);
       
    72         checkOrder("pkg1/class-use/UsedClass.html", expectedInnerClassContructors);
       
    73         checkOrder("pkg1/ImplementsOrdering.html", expectedImplementsOrdering);
       
    74         checkOrder("pkg1/OverrideOrdering.html", expectedOverrideOrdering);
       
    75         checkOrder("allclasses-noframe.html", expectedAllClasses);
       
    76         checkOrder("allclasses-frame.html", expectedAllClasses);
       
    77     }
       
    78 
       
    79     enum ListOrder { NONE, REVERSE, SHUFFLE };
       
    80     /*
       
    81      * By default we do not shuffle the input list, in order to keep the list deterministic,
       
    82      * and the test predictable. However, we can turn on the stress mode, by setting the following
       
    83      * property if required.
       
    84      */
       
    85     static final ListOrder STRESS_MODE = Boolean.getBoolean("TestOrder.STRESS")
       
    86             ? ListOrder.SHUFFLE
       
    87             : ListOrder.REVERSE;
       
    88 
       
    89     /*
       
    90      * Controls the number of sibling packages,  pkg0, pkg1, pkg2, .....
       
    91      */
       
    92     static final int MAX_PACKAGES = 4;
       
    93 
       
    94     /*
       
    95      * Controls the number of children packages, pkg0, pkg0.pkg, pkg0.pkg.pkg, .....
       
    96      * Note: having too long a depth (> 256 chars on Windows), will likely lead to
       
    97      * cause problems with automated build and test systems.
       
    98      */
       
    99     static final int MAX_SUBPACKAGES_DEPTH = 4;
       
   100     @Test
    61     @Test
   101     void testIndexOrdering() throws IOException {
    62     void testIndexOrdering() throws IOException {
   102         final String clsname = "Add";
    63         new IndexOrderingTest(this).run();
   103         List<String> cmdArgs = new ArrayList();
       
   104         cmdArgs.add("-d");
       
   105         cmdArgs.add("out-2");
       
   106         cmdArgs.add("-sourcepath");
       
   107         cmdArgs.add("src");
       
   108         cmdArgs.add("-package");
       
   109         System.out.println("STRESS_MODE: " + STRESS_MODE);
       
   110         emitFile(null, clsname, STRESS_MODE);
       
   111         for (int width = 0 ; width < MAX_PACKAGES ; width++) {
       
   112             String wpkgname = "add" + width;
       
   113             String dpkgname = wpkgname;
       
   114             emitFile(wpkgname, clsname, ListOrder.NONE); // list as-is
       
   115             cmdArgs.add(wpkgname);
       
   116             for (int depth = 1 ; depth < MAX_SUBPACKAGES_DEPTH ; depth++) {
       
   117                 dpkgname = dpkgname + ".add";
       
   118                 emitFile(dpkgname, clsname, STRESS_MODE);
       
   119                 cmdArgs.add(dpkgname);
       
   120             }
       
   121         }
       
   122         File srcDir = new File(new File("."), "src");
       
   123         cmdArgs.add(new File(srcDir, clsname + ".java").getPath());
       
   124         javadoc(cmdArgs.toArray(new String[cmdArgs.size()]));
       
   125         checkExit(Exit.OK);
       
   126         checkOrder("index-all.html", composeTestVectors());
       
   127         checkOrder("add0/add/package-tree.html", expectedPackageTreeOrdering);
       
   128         checkOrder("overview-tree.html", expectedOverviewOrdering);
       
   129         checkOrder("overview-frame.html", expectedOverviewFrameOrdering);
       
   130     }
    64     }
   131 
    65 
   132     @Test
    66     @Test
   133     void testIndexTypeClustering() {
    67     void testIndexTypeClustering() {
   134         javadoc("-d", "out-3",
    68         new IndexTypeClusteringTest(this).run();
   135                 "-sourcepath", testSrc("src-2"),
       
   136                 "-use",
       
   137                 "a",
       
   138                 "b",
       
   139                 "e",
       
   140                 "something");
       
   141         checkOrder("index-all.html", typeTestVectors);
       
   142         checkExit(Exit.OK);
       
   143     }
    69     }
   144 
    70 
   145     @Test
    71     @Test
   146     void testMethodDetailOrdering() {
    72     void testTypeElementMemberOrdering() {
   147         javadoc("-d", "out-4",
    73         new TypeElementMemberOrderingTest(this).run();
   148                 "-sourcepath", testSrc(new File(".").getPath()),
    74     }
   149                 "order"
    75 
   150         );
    76     static class UnnamedPackageForClassUseTest {
   151         checkOrder("order/MethodOrder.html", methodSourceOrderVectors);
    77         final JavadocTester tester;
   152         checkExit(Exit.OK);
    78 
   153     }
    79         UnnamedPackageForClassUseTest(JavadocTester tester) {
   154 
    80             this.tester = tester;
   155     String[] methodSourceOrderVectors = {
    81         }
   156         "<pre>public&nbsp;void&nbsp;d()</pre>\n" +
    82 
   157         "<div class=\"block\">Method d.\n" +
    83         void run() {
   158         " Second line.</div>",
    84             tester.javadoc("-d", "out",
   159         "<pre>public&nbsp;void&nbsp;b()</pre>\n" +
    85                     "-sourcepath", testSrc,
   160         "<div class=\"block\">Method b.\n" +
    86                     "-use",
   161         " Second line.</div>",
    87                     tester.testSrc("C.java"), tester.testSrc("UsedInC.java"));
   162         "<pre>public&nbsp;void&nbsp;c()</pre>\n" +
    88             tester.checkExit(Exit.OK);
   163         "<div class=\"block\">Method c.\n" +
    89             checkExecutableMemberOrdering("class-use/UsedInC.html");
   164         " Second line.</div>",
    90         }
   165         "<pre>public&nbsp;void&nbsp;a()</pre>\n" +
    91 
   166         "<div class=\"block\">Method a.\n" +
    92         void checkExecutableMemberOrdering(String usePage) {
   167         " Second line.</div>"
    93             String contents = tester.readFile(usePage);
   168     };
    94             // check constructors
   169 
    95             tester.checking("constructors");
   170     String[] typeTestVectors = {
    96             int idx1 = contents.indexOf("C.html#C-UsedInC");
   171         "something</a> - package something</dt>",
    97             int idx2 = contents.indexOf("C.html#C-UsedInC-int");
   172         "something</span></a> - Class in",
    98             int idx3 = contents.indexOf("C.html#C-UsedInC-java.lang.String");
   173         "something</span></a> - Enum in",
    99             if (idx1 == -1 || idx2 == -1 || idx3 == -1) {
   174         "something</span></a> - Interface in",
   100                 tester.failed("ctor strings not found");
   175         "something</span></a> - Annotation Type in",
   101             } else if (idx1 > idx2 || idx2 > idx3 || idx1 > idx3) {
   176         "something</a></span> - Variable in class",
   102                 tester.failed("ctor strings are out of order");
   177         "something()</a></span> - Constructor",
   103             } else {
   178         "something()</a></span> - Method in class a.<a href=\"a/A.html\"",
   104                 tester.passed("ctor strings are in order");
   179         "something()</a></span> - Method in class a.<a href=\"a/something.html\"",
   105             }
   180         "something()</a></span> - Method in class something.<a href=\"something/J.html\""
   106 
   181     };
   107             // check methods
   182 
   108             tester.checking("methods");
   183     String[] composeTestVectors() {
   109             idx1 = contents.indexOf("C.html#ymethod-int");
   184         List<String> testList = new ArrayList<>();
   110             idx2 = contents.indexOf("C.html#ymethod-java.lang.String");
   185 
   111             if (idx1 == -1 || idx2 == -1) {
   186         testList.addAll(Arrays.asList(expectedPackageOrdering));
   112                 tester.failed("#ymethod strings not found");
   187         for (String x : expectedEnumOrdering) {
   113             } else if (idx1 > idx2) {
   188             testList.add(x.replace("REPLACE_ME", "&lt;Unnamed&gt;"));
   114                 tester.failed("#ymethod strings are out of order");
   189             for (int i = 0; i < MAX_PACKAGES; i++) {
   115             } else {
   190                 String wpkg = "add" + i;
   116                 tester.passed("Executable Member Ordering: OK");
   191                 testList.add(wpkg + "/" + x.replace("REPLACE_ME",
   117             }
   192                         wpkg));
   118         }
   193                 String dpkg = wpkg;
   119     }
   194                 for (int j = 1; j < MAX_SUBPACKAGES_DEPTH; j++) {
   120 
   195                     dpkg = dpkg + "/" + "add";
   121     static class NamedPackagesForClassUseTest {
   196                     testList.add(dpkg + "/" + x.replace("REPLACE_ME",
   122         final JavadocTester tester;
   197                             pathToPackage(dpkg)));
   123 
       
   124         NamedPackagesForClassUseTest(JavadocTester tester) {
       
   125             this.tester = tester;
       
   126         }
       
   127 
       
   128         public void run() {
       
   129             tester.javadoc("-d", "out-1",
       
   130                     "-sourcepath", tester.testSrc,
       
   131                     "-use",
       
   132                     "pkg1");
       
   133             tester.checkExit(Exit.OK);
       
   134 
       
   135             checkClassUseOrdering("pkg1/class-use/UsedClass.html");
       
   136 
       
   137             tester.checkOrder("pkg1/class-use/UsedClass.html",
       
   138                     "../../pkg1/MethodOrder.html#m--",
       
   139                     "../../pkg1/MethodOrder.html#m-byte:A-",
       
   140                     "../../pkg1/MethodOrder.html#m-double-",
       
   141                     "../../pkg1/MethodOrder.html#m-double-double-",
       
   142                     "../../pkg1/MethodOrder.html#m-double-java.lang.Double-",
       
   143                     "../../pkg1/MethodOrder.html#m-int-",
       
   144                     "../../pkg1/MethodOrder.html#m-int-int-",
       
   145                     "../../pkg1/MethodOrder.html#m-int-java.lang.Integer-",
       
   146                     "../../pkg1/MethodOrder.html#m-long-",
       
   147                     "../../pkg1/MethodOrder.html#m-long-long-",
       
   148                     "../../pkg1/MethodOrder.html#m-long-java.lang.Long-",
       
   149                     "../../pkg1/MethodOrder.html#m-long-java.lang.Long...-",
       
   150                     "../../pkg1/MethodOrder.html#m-java.lang.Double-",
       
   151                     "../../pkg1/MethodOrder.html#m-java.lang.Double-double-",
       
   152                     "../../pkg1/MethodOrder.html#m-java.lang.Double-java.lang.Double-",
       
   153                     "../../pkg1/MethodOrder.html#m-java.lang.Integer-",
       
   154                     "../../pkg1/MethodOrder.html#m-java.lang.Integer-int-",
       
   155                     "../../pkg1/MethodOrder.html#m-java.lang.Integer-java.lang.Integer-",
       
   156                     "../../pkg1/MethodOrder.html#m-java.lang.Object:A-",
       
   157                     "../../pkg1/MethodOrder.html#m-java.util.ArrayList-",
       
   158                     "../../pkg1/MethodOrder.html#m-java.util.Collection-",
       
   159                     "../../pkg1/MethodOrder.html#m-java.util.List-");
       
   160 
       
   161             tester.checkOrder("pkg1/class-use/UsedClass.html",
       
   162                     "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-",
       
   163                     "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-pkg1.UsedClass-",
       
   164                     "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-pkg1.UsedClass:A-",
       
   165                     "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-java.lang.String-");
       
   166 
       
   167             tester.checkOrder("pkg1/class-use/UsedClass.html",
       
   168                     "../../pkg1/A.html#A-pkg1.UsedClass-",
       
   169                     "../../pkg1/B.A.html#A-pkg1.UsedClass-",
       
   170                     "../../pkg1/B.html#B-pkg1.UsedClass-",
       
   171                     "../../pkg1/A.C.html#C-pkg1.UsedClass-java.lang.Object:A-",
       
   172                     "../../pkg1/A.C.html#C-pkg1.UsedClass-java.util.Collection-",
       
   173                     "../../pkg1/A.C.html#C-pkg1.UsedClass-java.util.List-");
       
   174 
       
   175             tester.checkOrder("pkg1/ImplementsOrdering.html",
       
   176                     "<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.lang.AutoCloseable</code></dd>",
       
   177                     "<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.nio.channels.Channel</code></dd>",
       
   178                     "<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.io.Closeable</code></dd>");
       
   179 
       
   180             tester.checkOrder("pkg1/OverrideOrdering.html",
       
   181                     "<dd><code>iterator</code>&nbsp;in interface&nbsp;<code>java.util.Collection&lt;",
       
   182                     "<dd><code>iterator</code>&nbsp;in interface&nbsp;<code>java.lang.Iterable&lt;");
       
   183 
       
   184             tester.checkOrder("allclasses-noframe.html",
       
   185                     "pkg1/A.html\" title=\"class in pkg1",
       
   186                     "pkg1/A.C.html\" title=\"class in pkg1",
       
   187                     "pkg1/B.html\" title=\"class in pkg1",
       
   188                     "pkg1/B.A.html\" title=\"class in pkg1",
       
   189                     "pkg1/C1.html\" title=\"class in pkg1",
       
   190                     "pkg1/C2.html\" title=\"class in pkg1",
       
   191                     "pkg1/C3.html\" title=\"class in pkg1",
       
   192                     "pkg1/C4.html\" title=\"class in pkg1",
       
   193                     "pkg1/ImplementsOrdering.html\" title=\"interface in pkg1",
       
   194                     "pkg1/MethodOrder.html\" title=\"class in pkg1",
       
   195                     "pkg1/OverrideOrdering.html\" title=\"class in pkg1",
       
   196                     "pkg1/UsedClass.html\" title=\"class in pkg1");
       
   197 
       
   198             tester.checkOrder("allclasses-frame.html",
       
   199                     "pkg1/A.html\" title=\"class in pkg1",
       
   200                     "pkg1/A.C.html\" title=\"class in pkg1",
       
   201                     "pkg1/B.html\" title=\"class in pkg1",
       
   202                     "pkg1/B.A.html\" title=\"class in pkg1",
       
   203                     "pkg1/C1.html\" title=\"class in pkg1",
       
   204                     "pkg1/C2.html\" title=\"class in pkg1",
       
   205                     "pkg1/C3.html\" title=\"class in pkg1",
       
   206                     "pkg1/C4.html\" title=\"class in pkg1",
       
   207                     "pkg1/ImplementsOrdering.html\" title=\"interface in pkg1",
       
   208                     "pkg1/MethodOrder.html\" title=\"class in pkg1",
       
   209                     "pkg1/OverrideOrdering.html\" title=\"class in pkg1",
       
   210                     "pkg1/UsedClass.html\" title=\"class in pkg1");
       
   211         }
       
   212 
       
   213         void checkClassUseOrdering(String usePage) {
       
   214             checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#zfield");
       
   215             checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#fieldInC#ITERATION#");
       
   216             checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#zmethod-pkg1.UsedClass");
       
   217             checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#methodInC#ITERATION#");
       
   218         }
       
   219 
       
   220         void checkClassUseOrdering(String usePage, String searchString) {
       
   221             String contents = tester.readFile(usePage);
       
   222             int lastidx = 0;
       
   223             System.out.println("testing for " + searchString);
       
   224             for (int i = 1; i < 5; i++) {
       
   225                 String s = searchString.replaceAll("#ITERATION#", Integer.toString(i));
       
   226                 tester.checking(s);
       
   227                 int idx = contents.indexOf(s);
       
   228                 if (idx < lastidx) {
       
   229                     tester.failed(s + ", member ordering error, last:" + lastidx + ", got:" + idx);
       
   230                 } else {
       
   231                     tester.passed("\tlast: " + lastidx + " got:" + idx);
   198                 }
   232                 }
   199             }
   233                 lastidx = idx;
   200         }
   234             }
   201 
   235         }
   202         testList.addAll(Arrays.asList(expectedFieldOrdering));
   236     }
   203 
   237 
   204         for (String x : expectedMethodOrdering) {
   238     static class IndexOrderingTest {
   205             testList.add(x);
   239         private final JavadocTester tester;
   206             for (int i = 0; i < MAX_PACKAGES; i++) {
   240 
   207                 String wpkg = "add" + i;
   241         IndexOrderingTest(JavadocTester tester) {
   208                 testList.add(wpkg + "/" + x);
   242             this.tester = tester;
   209                 String dpkg = wpkg;
   243         }
   210                 for (int j = 1; j < MAX_SUBPACKAGES_DEPTH; j++) {
   244 
   211                     dpkg = dpkg + "/" + "add";
   245         enum ListOrder {
   212                     testList.add(dpkg + "/" + x);
   246             NONE, REVERSE, SHUFFLE
       
   247         };
       
   248 
       
   249         /*
       
   250          * By default we do not shuffle the input list, in order to keep the list deterministic,
       
   251          * and the test predictable. However, we can turn on the stress mode, by setting the following
       
   252          * property if required.
       
   253          */
       
   254         static final ListOrder STRESS_MODE = Boolean.getBoolean("TestOrder.STRESS")
       
   255                 ? ListOrder.SHUFFLE
       
   256                 : ListOrder.REVERSE;
       
   257 
       
   258         /*
       
   259          * Controls the number of children packages, pkg0, pkg0.pkg, pkg0.pkg.pkg, .....
       
   260          * Note: having too long a depth (> 256 chars on Windows), will likely lead to
       
   261          * cause problems with automated build and test systems.
       
   262          */
       
   263         static final int MAX_SUBPACKAGES_DEPTH = 4;
       
   264 
       
   265         /*
       
   266          * Controls the number of sibling packages,  pkg0, pkg1, pkg2, .....
       
   267          */
       
   268         static final int MAX_PACKAGES = 4;
       
   269 
       
   270         static String[] contents = {
       
   271             "public add ADDADD;",
       
   272             "public add AddAdd;",
       
   273             "public add addadd;",
       
   274             "public enum add {add, ADD, addd, ADDD};",
       
   275             "public enum ADD {ADD, add, addd, ADDD};",
       
   276             "public void   add(){}",
       
   277             "public void   add(double d){}",
       
   278             "public void   add(int i, float f){}",
       
   279             "public void   add(float f, int i){}",
       
   280             "public void   add(double d, byte b){}",
       
   281             "public Double add(Double d) {return (double) 22/7;}",
       
   282             "public double add(double d1, double d2) {return d1 + d2;}",
       
   283             "public double add(double d1, Double  d2) {return d1 + d2;}",
       
   284             "public Float  add(float f) {return (float) 22/7;}",
       
   285             "public void   add(int i){}",
       
   286             "public int    add(Integer i) {return 0;}"
       
   287         };
       
   288 
       
   289         static String expectedEnumOrdering[] = {
       
   290             "Add.add.html\" title=\"enum in REPLACE_ME\"",
       
   291             "Add.ADD.html\" title=\"enum in REPLACE_ME\""
       
   292         };
       
   293 
       
   294         static String expectedFieldOrdering[] = {
       
   295             "Add.html#addadd\"",
       
   296             "add0/add/add/add/Add.html#addadd\"",
       
   297             "add0/add/add/Add.html#addadd\"",
       
   298             "add0/add/Add.html#addadd\"",
       
   299             "add0/Add.html#addadd\"",
       
   300             "add1/add/add/add/Add.html#addadd\"",
       
   301             "add1/add/add/Add.html#addadd\"",
       
   302             "add1/add/Add.html#addadd\"",
       
   303             "add1/Add.html#addadd\"",
       
   304             "add2/add/add/add/Add.html#addadd\"",
       
   305             "add2/add/add/Add.html#addadd\"",
       
   306             "add2/add/Add.html#addadd\"",
       
   307             "add2/Add.html#addadd\"",
       
   308             "add3/add/add/add/Add.html#addadd\"",
       
   309             "add3/add/add/Add.html#addadd\"",
       
   310             "add3/add/Add.html#addadd\"",
       
   311             "add3/Add.html#addadd\"",
       
   312             "Add.html#AddAdd\"",
       
   313             "add0/add/add/add/Add.html#AddAdd\"",
       
   314             "add0/add/add/Add.html#AddAdd\"",
       
   315             "add0/add/Add.html#AddAdd\"",
       
   316             "add0/Add.html#AddAdd\"",
       
   317             "add1/add/add/add/Add.html#AddAdd\"",
       
   318             "add1/add/add/Add.html#AddAdd\"",
       
   319             "add1/add/Add.html#AddAdd\"",
       
   320             "add1/Add.html#AddAdd\"",
       
   321             "add2/add/add/add/Add.html#AddAdd\"",
       
   322             "add2/add/add/Add.html#AddAdd\"",
       
   323             "add2/add/Add.html#AddAdd\"",
       
   324             "add2/Add.html#AddAdd\"",
       
   325             "add3/add/add/add/Add.html#AddAdd\"",
       
   326             "add3/add/add/Add.html#AddAdd\"",
       
   327             "add3/add/Add.html#AddAdd\"",
       
   328             "add3/Add.html#AddAdd\"",
       
   329             "Add.html#ADDADD\"",
       
   330             "add0/add/add/add/Add.html#ADDADD\"",
       
   331             "add0/add/add/Add.html#ADDADD\"",
       
   332             "add0/add/Add.html#ADDADD\"",
       
   333             "add0/Add.html#ADDADD\"",
       
   334             "add1/add/add/add/Add.html#ADDADD\"",
       
   335             "add1/add/add/Add.html#ADDADD\"",
       
   336             "add1/add/Add.html#ADDADD\"",
       
   337             "add1/Add.html#ADDADD\"",
       
   338             "add2/add/add/add/Add.html#ADDADD\"",
       
   339             "add2/add/add/Add.html#ADDADD\"",
       
   340             "add2/add/Add.html#ADDADD\"",
       
   341             "add2/Add.html#ADDADD\"",
       
   342             "add3/add/add/add/Add.html#ADDADD\"",
       
   343             "add3/add/add/Add.html#ADDADD\"",
       
   344             "add3/add/Add.html#ADDADD\"",
       
   345             "add3/Add.html#ADDADD\""
       
   346         };
       
   347 
       
   348         static String expectedMethodOrdering[] = {
       
   349             "Add.html#add--",
       
   350             "Add.html#add-double-",
       
   351             "Add.html#add-double-byte-",
       
   352             "Add.html#add-double-double-",
       
   353             "Add.html#add-double-java.lang.Double-",
       
   354             "Add.html#add-float-",
       
   355             "Add.html#add-float-int-",
       
   356             "Add.html#add-int-",
       
   357             "Add.html#add-int-float-",
       
   358             "Add.html#add-java.lang.Double-",
       
   359             "Add.html#add-java.lang.Integer-"
       
   360         };
       
   361 
       
   362         static String expectedPackageOrdering[] = {
       
   363             "\"add0/package-summary.html\">add0</a> - package add0",
       
   364             "\"add0/add/package-summary.html\">add0.add</a> - package add0.add",
       
   365             "\"add0/add/add/package-summary.html\">add0.add.add</a> - package add0.add.add",
       
   366             "\"add0/add/add/add/package-summary.html\">add0.add.add.add</a> - package add0.add.add.add",
       
   367             "\"add1/package-summary.html\">add1</a> - package add1",
       
   368             "\"add1/add/package-summary.html\">add1.add</a> - package add1.add",
       
   369             "\"add1/add/add/package-summary.html\">add1.add.add</a> - package add1.add.add",
       
   370             "\"add1/add/add/add/package-summary.html\">add1.add.add.add</a> - package add1.add.add.add",
       
   371             "\"add2/package-summary.html\">add2</a> - package add2",
       
   372             "\"add2/add/package-summary.html\">add2.add</a> - package add2.add",
       
   373             "\"add2/add/add/package-summary.html\">add2.add.add</a> - package add2.add.add",
       
   374             "\"add2/add/add/add/package-summary.html\">add2.add.add.add</a> - package add2.add.add.add",
       
   375             "\"add3/package-summary.html\">add3</a> - package add3",
       
   376             "\"add3/add/package-summary.html\">add3.add</a> - package add3.add",
       
   377             "\"add3/add/add/package-summary.html\">add3.add.add</a> - package add3.add.add",
       
   378             "\"add3/add/add/add/package-summary.html\">add3.add.add.add</a> - package add3.add.add.add"
       
   379         };
       
   380 
       
   381         void run() throws IOException {
       
   382             final String clsname = "Add";
       
   383             List<String> cmdArgs = new ArrayList();
       
   384             cmdArgs.add("-d");
       
   385             cmdArgs.add("out-2");
       
   386             cmdArgs.add("-sourcepath");
       
   387             cmdArgs.add("src");
       
   388             cmdArgs.add("-package");
       
   389             System.out.println("STRESS_MODE: " + STRESS_MODE);
       
   390             emitFile(null, clsname, STRESS_MODE);
       
   391             for (int width = 0; width < MAX_PACKAGES; width++) {
       
   392                 String wpkgname = "add" + width;
       
   393                 String dpkgname = wpkgname;
       
   394                 emitFile(wpkgname, clsname, ListOrder.NONE); // list as-is
       
   395                 cmdArgs.add(wpkgname);
       
   396                 for (int depth = 1; depth < MAX_SUBPACKAGES_DEPTH; depth++) {
       
   397                     dpkgname = dpkgname + ".add";
       
   398                     emitFile(dpkgname, clsname, STRESS_MODE);
       
   399                     cmdArgs.add(dpkgname);
   213                 }
   400                 }
   214             }
   401             }
   215         }
   402             File srcDir = new File(new File("."), "src");
   216 
   403             cmdArgs.add(new File(srcDir, clsname + ".java").getPath());
   217         return testList.toArray(new String[testList.size()]);
   404             tester.javadoc(cmdArgs.toArray(new String[cmdArgs.size()]));
   218     }
   405             tester.checkExit(Exit.OK);
   219 
   406             tester.checkOrder("index-all.html", composeTestVectors());
   220     void checkExecutableMemberOrdering(String usePage) {
   407             tester.checkOrder("add0/add/package-tree.html",
   221         String contents = readFile(usePage);
   408                     "<a href=\"../../add0/add/Add.add.html\" title=\"enum in add0.add\">",
   222         // check constructors
   409                     "<a href=\"../../add0/add/Add.ADD.html\" title=\"enum in add0.add\">");
   223         checking("constructors");
   410             tester.checkOrder("overview-tree.html",
   224         int idx1 = contents.indexOf("C.html#C-UsedInC");
   411                     "<a href=\"Add.add.html\" title=\"enum in &lt;Unnamed&gt;\">",
   225         int idx2 = contents.indexOf("C.html#C-UsedInC-int");
   412                     "<a href=\"add0/Add.add.html\" title=\"enum in add0\">",
   226         int idx3 = contents.indexOf("C.html#C-UsedInC-java.lang.String");
   413                     "<a href=\"add0/add/Add.add.html\" title=\"enum in add0.add\">",
   227         if (idx1 == -1 || idx2 == -1 || idx3 == -1) {
   414                     "<a href=\"add0/add/add/Add.add.html\" title=\"enum in add0.add.add\">",
   228             failed("ctor strings not found");
   415                     "<a href=\"add0/add/add/add/Add.add.html\" title=\"enum in add0.add.add.add\">",
   229         } else if (idx1 > idx2 || idx2 > idx3 || idx1 > idx3) {
   416                     "<a href=\"add1/Add.add.html\" title=\"enum in add1\">",
   230             failed("ctor strings are out of order");
   417                     "<a href=\"add1/add/Add.add.html\" title=\"enum in add1.add\">",
   231         } else
   418                     "<a href=\"add1/add/add/Add.add.html\" title=\"enum in add1.add.add\">",
   232             passed("ctor strings are in order");
   419                     "<a href=\"add1/add/add/add/Add.add.html\" title=\"enum in add1.add.add.add\">",
   233 
   420                     "<a href=\"add2/Add.add.html\" title=\"enum in add2\">",
   234         // check methods
   421                     "<a href=\"add2/add/Add.add.html\" title=\"enum in add2.add\">",
   235         checking("methods");
   422                     "<a href=\"add2/add/add/Add.add.html\" title=\"enum in add2.add.add\">",
   236         idx1 = contents.indexOf("C.html#ymethod-int");
   423                     "<a href=\"add2/add/add/add/Add.add.html\" title=\"enum in add2.add.add.add\">",
   237         idx2 = contents.indexOf("C.html#ymethod-java.lang.String");
   424                     "<a href=\"add3/Add.add.html\" title=\"enum in add3\">",
   238         if (idx1 == -1 || idx2 == -1) {
   425                     "<a href=\"add3/add/Add.add.html\" title=\"enum in add3.add\">",
   239             failed("#ymethod strings not found");
   426                     "<a href=\"add3/add/add/Add.add.html\" title=\"enum in add3.add.add\">",
   240         } else if (idx1 > idx2) {
   427                     "<a href=\"add3/add/add/add/Add.add.html\" title=\"enum in add3.add.add.add\">",
   241             failed("#ymethod strings are out of order");
   428                     "<a href=\"Add.ADD.html\" title=\"enum in &lt;Unnamed&gt;\">",
   242         } else
   429                     "<a href=\"add0/Add.ADD.html\" title=\"enum in add0\">",
   243             passed("Executable Member Ordering: OK");
   430                     "<a href=\"add0/add/Add.ADD.html\" title=\"enum in add0.add\">",
   244     }
   431                     "<a href=\"add0/add/add/Add.ADD.html\" title=\"enum in add0.add.add\">",
   245 
   432                     "<a href=\"add0/add/add/add/Add.ADD.html\" title=\"enum in add0.add.add.add\">",
   246     void checkClassUseOrdering(String usePage) {
   433                     "<a href=\"add1/Add.ADD.html\" title=\"enum in add1\">",
   247         checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#zfield");
   434                     "<a href=\"add1/add/Add.ADD.html\" title=\"enum in add1.add\">",
   248         checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#fieldInC#ITERATION#");
   435                     "<a href=\"add1/add/add/Add.ADD.html\" title=\"enum in add1.add.add\">",
   249         checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#zmethod-pkg1.UsedClass");
   436                     "<a href=\"add1/add/add/add/Add.ADD.html\" title=\"enum in add1.add.add.add\">",
   250         checkClassUseOrdering(usePage, "pkg1/C#ITERATION#.html#methodInC#ITERATION#");
   437                     "<a href=\"add2/Add.ADD.html\" title=\"enum in add2\">",
   251     }
   438                     "<a href=\"add2/add/Add.ADD.html\" title=\"enum in add2.add\">",
   252 
   439                     "<a href=\"add2/add/add/Add.ADD.html\" title=\"enum in add2.add.add\">",
   253     void checkClassUseOrdering(String usePage, String searchString) {
   440                     "<a href=\"add2/add/add/add/Add.ADD.html\" title=\"enum in add2.add.add.add\">",
   254         String contents = readFile(usePage);
   441                     "<a href=\"add3/Add.ADD.html\" title=\"enum in add3\">",
   255         int lastidx = 0;
   442                     "<a href=\"add3/add/Add.ADD.html\" title=\"enum in add3.add\">",
   256         System.out.println("testing for " + searchString);
   443                     "<a href=\"add3/add/add/Add.ADD.html\" title=\"enum in add3.add.add\">",
   257         for (int i = 1; i < 5; i++) {
   444                     "<a href=\"add3/add/add/add/Add.ADD.html\" title=\"enum in add3.add.add.add\">");
   258             String s = searchString.replaceAll("#ITERATION#", Integer.toString(i));
   445 
   259             checking(s);
   446             tester.checkOrder("overview-frame.html",
   260             int idx = contents.indexOf(s);
   447                     "<a href=\"package-frame.html\" target=\"packageFrame\">&lt;unnamed package&gt;</a>",
   261             if (idx < lastidx) {
   448                     "<a href=\"add0/package-frame.html\" target=\"packageFrame\">add0</a>",
   262                 failed(s + ", member ordering error, last:" + lastidx + ", got:" + idx);
   449                     "<a href=\"add0/add/package-frame.html\" target=\"packageFrame\">add0.add</a>",
   263             } else {
   450                     "<a href=\"add0/add/add/package-frame.html\" target=\"packageFrame\">add0.add.add</a>",
   264                 passed("\tlast: " + lastidx + " got:" + idx);
   451                     "<a href=\"add0/add/add/add/package-frame.html\" target=\"packageFrame\">add0.add.add.add</a>",
   265             }
   452                     "<a href=\"add1/package-frame.html\" target=\"packageFrame\">add1</a>",
   266             lastidx = idx;
   453                     "<a href=\"add1/add/package-frame.html\" target=\"packageFrame\">add1.add</a>",
   267         }
   454                     "<a href=\"add1/add/add/package-frame.html\" target=\"packageFrame\">add1.add.add</a>",
   268     }
   455                     "<a href=\"add1/add/add/add/package-frame.html\" target=\"packageFrame\">add1.add.add.add</a>",
   269 
   456                     "<a href=\"add2/package-frame.html\" target=\"packageFrame\">add2</a>",
   270     static String[] contents = {
   457                     "<a href=\"add2/add/package-frame.html\" target=\"packageFrame\">add2.add</a>",
   271         "public add ADDADD;",
   458                     "<a href=\"add2/add/add/package-frame.html\" target=\"packageFrame\">add2.add.add</a>",
   272         "public add AddAdd;",
   459                     "<a href=\"add2/add/add/add/package-frame.html\" target=\"packageFrame\">add2.add.add.add</a>",
   273         "public add addadd;",
   460                     "<a href=\"add3/package-frame.html\" target=\"packageFrame\">add3</a>",
   274         "public enum add {add, ADD, addd, ADDD};",
   461                     "<a href=\"add3/add/package-frame.html\" target=\"packageFrame\">add3.add</a>",
   275         "public enum ADD {ADD, add, addd, ADDD};",
   462                     "<a href=\"add3/add/add/package-frame.html\" target=\"packageFrame\">add3.add.add</a>",
   276         "public void   add(){}",
   463                     "<a href=\"add3/add/add/add/package-frame.html\" target=\"packageFrame\">add3.add.add.add</a></li>");
   277         "public void   add(double d){}",
   464         }
   278         "public void   add(int i, float f){}",
   465 
   279         "public void   add(float f, int i){}",
   466         void emitFile(String pkgname, String clsname, ListOrder order) throws IOException {
   280         "public void   add(double d, byte b){}",
   467             File srcDir = new File("src");
   281         "public Double add(Double d) {return (double) 22/7;}",
   468             File outDir = pkgname == null
   282         "public double add(double d1, double d2) {return d1 + d2;}",
   469                     ? srcDir
   283         "public double add(double d1, Double  d2) {return d1 + d2;}",
   470                     : new File(srcDir, pkgname.replace(".", File.separator));
   284         "public Float  add(float f) {return (float) 22/7;}",
   471             File outFile = new File(outDir, clsname + ".java");
   285         "public void   add(int i){}",
   472             outDir.mkdirs();
   286         "public int    add(Integer i) {return 0;}"
   473             List<String> scratch = new ArrayList<>(Arrays.asList(contents));
   287     };
   474             switch (order) {
   288 
   475                 case SHUFFLE:
   289     void emitFile(String pkgname, String clsname, ListOrder order) throws IOException {
   476                     Collections.shuffle(scratch);
   290         File srcDir = new File("src");
   477                     break;
   291         File outDir = pkgname == null
   478                 case REVERSE:
   292             ? srcDir
   479                     Collections.reverse(scratch);
   293             : new File(srcDir, pkgname.replace(".", File.separator));
   480                     break;
   294         File outFile = new File(outDir, clsname + ".java");
   481                 default:
   295         outDir.mkdirs();
       
   296         List<String> scratch = new ArrayList<>(Arrays.asList(contents));
       
   297         switch (order) {
       
   298             case SHUFFLE:
       
   299                 Collections.shuffle(scratch);
       
   300                 break;
       
   301             case REVERSE:
       
   302                 Collections.reverse(scratch);
       
   303                 break;
       
   304             default:
       
   305                 // leave list as-is
   482                 // leave list as-is
   306         }
   483             }
   307         // insert the header
   484             // insert the header
   308         scratch.add(0, "public class " + clsname + " {");
   485             scratch.add(0, "public class " + clsname + " {");
   309         if (pkgname != null) {
   486             if (pkgname != null) {
   310             scratch.add(0, "package " + pkgname + ";");
   487                 scratch.add(0, "package " + pkgname + ";");
   311         }
   488             }
   312         // append the footer
   489             // append the footer
   313         scratch.add("}");
   490             scratch.add("}");
   314         Files.write(outFile.toPath(), scratch, CREATE, TRUNCATE_EXISTING);
   491             Files.write(outFile.toPath(), scratch, CREATE, TRUNCATE_EXISTING);
   315     }
   492         }
   316 
   493 
   317     String pathToPackage(String in) {
   494         String[] composeTestVectors() {
   318         return in.replace("/", ".");
   495             List<String> testList = new ArrayList<>();
   319     }
   496 
   320 
   497             testList.addAll(Arrays.asList(expectedPackageOrdering));
   321     final String expectedAllClasses[] = {
   498             for (String x : expectedEnumOrdering) {
   322         "pkg1/A.html\" title=\"class in pkg1",
   499                 testList.add(x.replace("REPLACE_ME", "&lt;Unnamed&gt;"));
   323         "pkg1/A.C.html\" title=\"class in pkg1",
   500                 for (int i = 0; i < MAX_PACKAGES; i++) {
   324         "pkg1/B.html\" title=\"class in pkg1",
   501                     String wpkg = "add" + i;
   325         "pkg1/B.A.html\" title=\"class in pkg1",
   502                     testList.add(wpkg + "/" + x.replace("REPLACE_ME",
   326         "pkg1/C1.html\" title=\"class in pkg1",
   503                             wpkg));
   327         "pkg1/C2.html\" title=\"class in pkg1",
   504                     String dpkg = wpkg;
   328         "pkg1/C3.html\" title=\"class in pkg1",
   505                     for (int j = 1; j < MAX_SUBPACKAGES_DEPTH; j++) {
   329         "pkg1/C4.html\" title=\"class in pkg1",
   506                         dpkg = dpkg + "/" + "add";
   330         "pkg1/ImplementsOrdering.html\" title=\"interface in pkg1",
   507                         testList.add(dpkg + "/" + x.replace("REPLACE_ME", pathToPackage(dpkg)));
   331         "pkg1/MethodOrder.html\" title=\"class in pkg1",
   508                     }
   332         "pkg1/OverrideOrdering.html\" title=\"class in pkg1",
   509                 }
   333         "pkg1/UsedClass.html\" title=\"class in pkg1"
   510             }
   334 
   511 
   335     };
   512             testList.addAll(Arrays.asList(expectedFieldOrdering));
   336 
   513 
   337     final String expectedInnerClassContructors[] = {
   514             for (String x : expectedMethodOrdering) {
   338         "../../pkg1/A.html#A-pkg1.UsedClass-",
   515                 testList.add(x);
   339         "../../pkg1/B.A.html#A-pkg1.UsedClass-",
   516                 for (int i = 0; i < MAX_PACKAGES; i++) {
   340         "../../pkg1/B.html#B-pkg1.UsedClass-",
   517                     String wpkg = "add" + i;
   341         "../../pkg1/A.C.html#C-pkg1.UsedClass-java.lang.Object:A-",
   518                     testList.add(wpkg + "/" + x);
   342         "../../pkg1/A.C.html#C-pkg1.UsedClass-java.util.Collection-",
   519                     String dpkg = wpkg;
   343         "../../pkg1/A.C.html#C-pkg1.UsedClass-java.util.List-"
   520                     for (int j = 1; j < MAX_SUBPACKAGES_DEPTH; j++) {
   344     };
   521                         dpkg = dpkg + "/" + "add";
   345 
   522                         testList.add(dpkg + "/" + x);
   346     final String expectedClassUseMethodOrdering[] = {
   523                     }
   347         "../../pkg1/MethodOrder.html#m--",
   524                 }
   348         "../../pkg1/MethodOrder.html#m-byte:A-",
   525             }
   349         "../../pkg1/MethodOrder.html#m-double-",
   526 
   350         "../../pkg1/MethodOrder.html#m-double-double-",
   527             return testList.toArray(new String[testList.size()]);
   351         "../../pkg1/MethodOrder.html#m-double-java.lang.Double-",
   528         }
   352         "../../pkg1/MethodOrder.html#m-int-",
   529 
   353         "../../pkg1/MethodOrder.html#m-int-int-",
   530         String pathToPackage(String in) {
   354         "../../pkg1/MethodOrder.html#m-int-java.lang.Integer-",
   531             return in.replace("/", ".");
   355         "../../pkg1/MethodOrder.html#m-long-",
   532         }
   356         "../../pkg1/MethodOrder.html#m-long-long-",
   533     }
   357         "../../pkg1/MethodOrder.html#m-long-java.lang.Long-",
   534 
   358         "../../pkg1/MethodOrder.html#m-long-java.lang.Long...-",
   535     static class IndexTypeClusteringTest {
   359         "../../pkg1/MethodOrder.html#m-java.lang.Double-",
   536 
   360         "../../pkg1/MethodOrder.html#m-java.lang.Double-double-",
   537         private final JavadocTester tester;
   361         "../../pkg1/MethodOrder.html#m-java.lang.Double-java.lang.Double-",
   538 
   362         "../../pkg1/MethodOrder.html#m-java.lang.Integer-",
   539         IndexTypeClusteringTest(JavadocTester tester) {
   363         "../../pkg1/MethodOrder.html#m-java.lang.Integer-int-",
   540             this.tester = tester;
   364         "../../pkg1/MethodOrder.html#m-java.lang.Integer-java.lang.Integer-",
   541         }
   365         "../../pkg1/MethodOrder.html#m-java.lang.Object:A-",
   542 
   366         "../../pkg1/MethodOrder.html#m-java.util.ArrayList-",
   543         void run() {
   367         "../../pkg1/MethodOrder.html#m-java.util.Collection-",
   544             tester.javadoc("-d", "out-3",
   368         "../../pkg1/MethodOrder.html#m-java.util.List-"
   545                     "-sourcepath", tester.testSrc("src-2"),
   369     };
   546                     "-use",
   370 
   547                     "a",
   371     final String expectedClassUseWithTypeParams[] = {
   548                     "b",
   372         "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-",
   549                     "e",
   373         "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-pkg1.UsedClass-",
   550                     "something");
   374         "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-pkg1.UsedClass:A-",
   551 
   375         "../../pkg1/MethodOrder.html#tpm-pkg1.UsedClass-java.lang.String-"
   552             tester.checkExit(Exit.OK);
   376     };
   553 
   377 
   554             tester.checkOrder("index-all.html",
   378     final String expectedPackageOrdering[] = {
   555                     "something</a> - package something</dt>",
   379         "\"add0/package-summary.html\">add0</a> - package add0",
   556                     "something</span></a> - Class in",
   380         "\"add0/add/package-summary.html\">add0.add</a> - package add0.add",
   557                     "something</span></a> - Enum in",
   381         "\"add0/add/add/package-summary.html\">add0.add.add</a> - package add0.add.add",
   558                     "something</span></a> - Interface in",
   382         "\"add0/add/add/add/package-summary.html\">add0.add.add.add</a> - package add0.add.add.add",
   559                     "something</span></a> - Annotation Type in",
   383         "\"add1/package-summary.html\">add1</a> - package add1",
   560                     "something</a></span> - Variable in class",
   384         "\"add1/add/package-summary.html\">add1.add</a> - package add1.add",
   561                     "something()</a></span> - Constructor",
   385         "\"add1/add/add/package-summary.html\">add1.add.add</a> - package add1.add.add",
   562                     "something()</a></span> - Method in class a.<a href=\"a/A.html\"",
   386         "\"add1/add/add/add/package-summary.html\">add1.add.add.add</a> - package add1.add.add.add",
   563                     "something()</a></span> - Method in class a.<a href=\"a/something.html\"",
   387         "\"add2/package-summary.html\">add2</a> - package add2",
   564                     "something()</a></span> - Method in class something.<a href=\"something/J.html\"");
   388         "\"add2/add/package-summary.html\">add2.add</a> - package add2.add",
   565         }
   389         "\"add2/add/add/package-summary.html\">add2.add.add</a> - package add2.add.add",
   566     }
   390         "\"add2/add/add/add/package-summary.html\">add2.add.add.add</a> - package add2.add.add.add",
   567 
   391         "\"add3/package-summary.html\">add3</a> - package add3",
   568     static class TypeElementMemberOrderingTest {
   392         "\"add3/add/package-summary.html\">add3.add</a> - package add3.add",
   569 
   393         "\"add3/add/add/package-summary.html\">add3.add.add</a> - package add3.add.add",
   570         final JavadocTester tester;
   394         "\"add3/add/add/add/package-summary.html\">add3.add.add.add</a> - package add3.add.add.add"
   571 
   395     };
   572         TypeElementMemberOrderingTest(JavadocTester tester) {
   396 
   573             this.tester = tester;
   397     final String expectedMethodOrdering[] = {
   574         }
   398         "Add.html#add--",
   575 
   399         "Add.html#add-double-",
   576         void run() {
   400         "Add.html#add-double-byte-",
   577             tester.javadoc("-d", "out-5",
   401         "Add.html#add-double-double-",
   578                     "-javafx",
   402         "Add.html#add-double-java.lang.Double-",
   579                     "-sourcepath", tester.testSrc(new File(".").getPath()),
   403         "Add.html#add-float-",
   580                     "pkg5"
   404         "Add.html#add-float-int-",
   581             );
   405         "Add.html#add-int-",
   582 
   406         "Add.html#add-int-float-",
   583             tester.checkExit(Exit.OK);
   407         "Add.html#add-java.lang.Double-",
   584 
   408         "Add.html#add-java.lang.Integer-"
   585             tester.checkOrder("pkg5/AnnoFieldTest.html",
   409     };
   586                     "<h3>Field Detail</h3>",
   410 
   587                     "<pre>static final&nbsp;int&nbsp;one</pre>",
   411     final String expectedEnumOrdering[] = {
   588                     "<pre>static final&nbsp;int&nbsp;two</pre>",
   412         "Add.add.html\" title=\"enum in REPLACE_ME\"",
   589                     "<pre>static final&nbsp;int&nbsp;three</pre>",
   413         "Add.ADD.html\" title=\"enum in REPLACE_ME\""
   590                     "<pre>static final&nbsp;int&nbsp;four</pre>");
   414     };
   591 
   415 
   592             tester.checkOrder("pkg5/AnnoOptionalTest.html",
   416     final String expectedFieldOrdering[] = {
   593                     "<h3>Optional Element Summary</h3>",
   417         "Add.html#addadd\"",
   594                     "<a href=\"../pkg5/AnnoOptionalTest.html#four--\">four</a>",
   418         "add0/add/add/add/Add.html#addadd\"",
   595                     "<a href=\"../pkg5/AnnoOptionalTest.html#one--\">one</a>",
   419         "add0/add/add/Add.html#addadd\"",
   596                     "<a href=\"../pkg5/AnnoOptionalTest.html#three--\">three</a>",
   420         "add0/add/Add.html#addadd\"",
   597                     "<a href=\"../pkg5/AnnoOptionalTest.html#two--\">two</a>",
   421         "add0/Add.html#addadd\"",
   598                     "<h3>Element Detail</h3>",
   422         "add1/add/add/add/Add.html#addadd\"",
   599                     "<h4>one</h4>",
   423         "add1/add/add/Add.html#addadd\"",
   600                     "<h4>two</h4>",
   424         "add1/add/Add.html#addadd\"",
   601                     "<h4>three</h4>",
   425         "add1/Add.html#addadd\"",
   602                     "<h4>four</h4>");
   426         "add2/add/add/add/Add.html#addadd\"",
   603 
   427         "add2/add/add/Add.html#addadd\"",
   604             tester.checkOrder("pkg5/AnnoRequiredTest.html",
   428         "add2/add/Add.html#addadd\"",
   605                     "<h3>Required Element Summary</h3>",
   429         "add2/Add.html#addadd\"",
   606                     "<a href=\"../pkg5/AnnoRequiredTest.html#four--\">four</a>",
   430         "add3/add/add/add/Add.html#addadd\"",
   607                     "<a href=\"../pkg5/AnnoRequiredTest.html#one--\">one</a>",
   431         "add3/add/add/Add.html#addadd\"",
   608                     "<a href=\"../pkg5/AnnoRequiredTest.html#three--\">three</a>",
   432         "add3/add/Add.html#addadd\"",
   609                     "<a href=\"../pkg5/AnnoRequiredTest.html#two--\">two</a>",
   433         "add3/Add.html#addadd\"",
   610                     "<h3>Element Detail</h3>",
   434         "Add.html#AddAdd\"",
   611                     "<h4>one</h4>",
   435         "add0/add/add/add/Add.html#AddAdd\"",
   612                     "<h4>two</h4>",
   436         "add0/add/add/Add.html#AddAdd\"",
   613                     "<h4>three</h4>",
   437         "add0/add/Add.html#AddAdd\"",
   614                     "<h4>four</h4>");
   438         "add0/Add.html#AddAdd\"",
   615 
   439         "add1/add/add/add/Add.html#AddAdd\"",
   616             tester.checkOrder("pkg5/CtorTest.html",
   440         "add1/add/add/Add.html#AddAdd\"",
   617                     "<h3>Constructor Summary</h3>",
   441         "add1/add/Add.html#AddAdd\"",
   618                     "<a href=\"../pkg5/CtorTest.html#CtorTest-int-\"",
   442         "add1/Add.html#AddAdd\"",
   619                     "<a href=\"../pkg5/CtorTest.html#CtorTest-int-int-\"",
   443         "add2/add/add/add/Add.html#AddAdd\"",
   620                     "<a href=\"../pkg5/CtorTest.html#CtorTest-int-int-int-\"",
   444         "add2/add/add/Add.html#AddAdd\"",
   621                     "<a href=\"../pkg5/CtorTest.html#CtorTest-int-int-int-int-\"",
   445         "add2/add/Add.html#AddAdd\"",
   622                     "<h3>Constructor Detail</h3>",
   446         "add2/Add.html#AddAdd\"",
   623                     "<a name=\"CtorTest-int-int-int-int-\">",
   447         "add3/add/add/add/Add.html#AddAdd\"",
   624                     "<a name=\"CtorTest-int-int-int-\">",
   448         "add3/add/add/Add.html#AddAdd\"",
   625                     "<a name=\"CtorTest-int-int-\">",
   449         "add3/add/Add.html#AddAdd\"",
   626                     "<a name=\"CtorTest-int-\">");
   450         "add3/Add.html#AddAdd\"",
   627 
   451         "Add.html#ADDADD\"",
   628             tester.checkOrder("pkg5/EnumTest.html",
   452         "add0/add/add/add/Add.html#ADDADD\"",
   629                     "<h3>Enum Constant Summary</h3>",
   453         "add0/add/add/Add.html#ADDADD\"",
   630                     "<a href=\"../pkg5/EnumTest.html#FOUR\">FOUR</a>",
   454         "add0/add/Add.html#ADDADD\"",
   631                     "<a href=\"../pkg5/EnumTest.html#ONE\">ONE</a>",
   455         "add0/Add.html#ADDADD\"",
   632                     "<a href=\"../pkg5/EnumTest.html#THREE\">THREE</a>",
   456         "add1/add/add/add/Add.html#ADDADD\"",
   633                     "<a href=\"../pkg5/EnumTest.html#TWO\">TWO</a>",
   457         "add1/add/add/Add.html#ADDADD\"",
   634                     "<h3>Enum Constant Detail</h3>",
   458         "add1/add/Add.html#ADDADD\"",
   635                     "<h4>ONE</h4>",
   459         "add1/Add.html#ADDADD\"",
   636                     "<h4>TWO</h4>",
   460         "add2/add/add/add/Add.html#ADDADD\"",
   637                     "<h4>THREE</h4>",
   461         "add2/add/add/Add.html#ADDADD\"",
   638                     "<h4>FOUR</h4>");
   462         "add2/add/Add.html#ADDADD\"",
   639 
   463         "add2/Add.html#ADDADD\"",
   640             tester.checkOrder("pkg5/FieldTest.html",
   464         "add3/add/add/add/Add.html#ADDADD\"",
   641                     "<h3>Field Summary</h3>",
   465         "add3/add/add/Add.html#ADDADD\"",
   642                     "<a href=\"../pkg5/FieldTest.html#four\">four</a>",
   466         "add3/add/Add.html#ADDADD\"",
   643                     "<a href=\"../pkg5/FieldTest.html#one\">one</a>",
   467         "add3/Add.html#ADDADD\""
   644                     "<a href=\"../pkg5/FieldTest.html#three\">three</a>",
   468     };
   645                     "<a href=\"../pkg5/FieldTest.html#two\">two</a>",
   469 
   646                     "<h3>Field Detail</h3>",
   470     final String expectedPackageTreeOrdering[] = {
   647                     "<h4>one</h4>",
   471         "<a href=\"../../add0/add/Add.add.html\" title=\"enum in add0.add\">",
   648                     "<h4>two</h4>",
   472         "<a href=\"../../add0/add/Add.ADD.html\" title=\"enum in add0.add\">"
   649                     "<h4>three</h4>",
   473     };
   650                     "<h4>four</h4>");
   474 
   651 
   475     final String expectedOverviewOrdering[] = {
   652             tester.checkOrder("pkg5/IntfTest.html",
   476         "<a href=\"Add.add.html\" title=\"enum in &lt;Unnamed&gt;\">",
   653                     "<h3>Method Summary</h3>",
   477         "<a href=\"add0/Add.add.html\" title=\"enum in add0\">",
   654                     "<a href=\"../pkg5/IntfTest.html#four--\">four</a>",
   478         "<a href=\"add0/add/Add.add.html\" title=\"enum in add0.add\">",
   655                     "<a href=\"../pkg5/IntfTest.html#one--\">one</a>",
   479         "<a href=\"add0/add/add/Add.add.html\" title=\"enum in add0.add.add\">",
   656                     "<a href=\"../pkg5/IntfTest.html#three--\">three</a>",
   480         "<a href=\"add0/add/add/add/Add.add.html\" title=\"enum in add0.add.add.add\">",
   657                     "<a href=\"../pkg5/IntfTest.html#two--\">two</a>",
   481         "<a href=\"add1/Add.add.html\" title=\"enum in add1\">",
   658                     "<h3>Method Detail</h3>",
   482         "<a href=\"add1/add/Add.add.html\" title=\"enum in add1.add\">",
   659                     "<h4>one</h4>",
   483         "<a href=\"add1/add/add/Add.add.html\" title=\"enum in add1.add.add\">",
   660                     "<h4>two</h4>",
   484         "<a href=\"add1/add/add/add/Add.add.html\" title=\"enum in add1.add.add.add\">",
   661                     "<h4>three</h4>",
   485         "<a href=\"add2/Add.add.html\" title=\"enum in add2\">",
   662                     "<h4>four</h4>");
   486         "<a href=\"add2/add/Add.add.html\" title=\"enum in add2.add\">",
   663 
   487         "<a href=\"add2/add/add/Add.add.html\" title=\"enum in add2.add.add\">",
   664             tester.checkOrder("pkg5/MethodTest.html",
   488         "<a href=\"add2/add/add/add/Add.add.html\" title=\"enum in add2.add.add.add\">",
   665                     "<h3>Method Summary</h3>",
   489         "<a href=\"add3/Add.add.html\" title=\"enum in add3\">",
   666                     "<a href=\"../pkg5/MethodTest.html#four--\">four</a>",
   490         "<a href=\"add3/add/Add.add.html\" title=\"enum in add3.add\">",
   667                     "<a href=\"../pkg5/MethodTest.html#one--\">one</a>",
   491         "<a href=\"add3/add/add/Add.add.html\" title=\"enum in add3.add.add\">",
   668                     "<a href=\"../pkg5/MethodTest.html#three--\">three</a>",
   492         "<a href=\"add3/add/add/add/Add.add.html\" title=\"enum in add3.add.add.add\">",
   669                     "<a href=\"../pkg5/MethodTest.html#two--\">two</a>",
   493         "<a href=\"Add.ADD.html\" title=\"enum in &lt;Unnamed&gt;\">",
   670                     "<h3>Method Detail</h3>",
   494         "<a href=\"add0/Add.ADD.html\" title=\"enum in add0\">",
   671                     "<h4>one</h4>",
   495         "<a href=\"add0/add/Add.ADD.html\" title=\"enum in add0.add\">",
   672                     "<h4>two</h4>",
   496         "<a href=\"add0/add/add/Add.ADD.html\" title=\"enum in add0.add.add\">",
   673                     "<h4>three</h4>",
   497         "<a href=\"add0/add/add/add/Add.ADD.html\" title=\"enum in add0.add.add.add\">",
   674                     "<h4>four</h4>");
   498         "<a href=\"add1/Add.ADD.html\" title=\"enum in add1\">",
   675 
   499         "<a href=\"add1/add/Add.ADD.html\" title=\"enum in add1.add\">",
   676             tester.checkOrder("pkg5/PropertyTest.html",
   500         "<a href=\"add1/add/add/Add.ADD.html\" title=\"enum in add1.add.add\">",
   677                     "<h3>Property Summary</h3>",
   501         "<a href=\"add1/add/add/add/Add.ADD.html\" title=\"enum in add1.add.add.add\">",
   678                     "<a href=\"../pkg5/PropertyTest.html#fourProperty\">four</a>",
   502         "<a href=\"add2/Add.ADD.html\" title=\"enum in add2\">",
   679                     "<a href=\"../pkg5/PropertyTest.html#oneProperty\">one</a>",
   503         "<a href=\"add2/add/Add.ADD.html\" title=\"enum in add2.add\">",
   680                     "<a href=\"../pkg5/PropertyTest.html#threeProperty\">three</a>",
   504         "<a href=\"add2/add/add/Add.ADD.html\" title=\"enum in add2.add.add\">",
   681                     "<a href=\"../pkg5/PropertyTest.html#twoProperty\">two</a>",
   505         "<a href=\"add2/add/add/add/Add.ADD.html\" title=\"enum in add2.add.add.add\">",
   682                     "<h3>Property Detail</h3>",
   506         "<a href=\"add3/Add.ADD.html\" title=\"enum in add3\">",
   683                     "<h4>oneProperty</h4>",
   507         "<a href=\"add3/add/Add.ADD.html\" title=\"enum in add3.add\">",
   684                     "<h4>twoProperty</h4>",
   508         "<a href=\"add3/add/add/Add.ADD.html\" title=\"enum in add3.add.add\">",
   685                     "<h4>threeProperty</h4>",
   509         "<a href=\"add3/add/add/add/Add.ADD.html\" title=\"enum in add3.add.add.add\">",
   686                     "<h4>fourProperty</h4>");
   510     };
   687         }
   511 
   688     }
   512     final static String expectedOverviewFrameOrdering[] = {
       
   513         "<a href=\"package-frame.html\" target=\"packageFrame\">&lt;unnamed package&gt;</a>",
       
   514         "<a href=\"add0/package-frame.html\" target=\"packageFrame\">add0</a>",
       
   515         "<a href=\"add0/add/package-frame.html\" target=\"packageFrame\">add0.add</a>",
       
   516         "<a href=\"add0/add/add/package-frame.html\" target=\"packageFrame\">add0.add.add</a>",
       
   517         "<a href=\"add0/add/add/add/package-frame.html\" target=\"packageFrame\">add0.add.add.add</a>",
       
   518         "<a href=\"add1/package-frame.html\" target=\"packageFrame\">add1</a>",
       
   519         "<a href=\"add1/add/package-frame.html\" target=\"packageFrame\">add1.add</a>",
       
   520         "<a href=\"add1/add/add/package-frame.html\" target=\"packageFrame\">add1.add.add</a>",
       
   521         "<a href=\"add1/add/add/add/package-frame.html\" target=\"packageFrame\">add1.add.add.add</a>",
       
   522         "<a href=\"add2/package-frame.html\" target=\"packageFrame\">add2</a>",
       
   523         "<a href=\"add2/add/package-frame.html\" target=\"packageFrame\">add2.add</a>",
       
   524         "<a href=\"add2/add/add/package-frame.html\" target=\"packageFrame\">add2.add.add</a>",
       
   525         "<a href=\"add2/add/add/add/package-frame.html\" target=\"packageFrame\">add2.add.add.add</a>",
       
   526         "<a href=\"add3/package-frame.html\" target=\"packageFrame\">add3</a>",
       
   527         "<a href=\"add3/add/package-frame.html\" target=\"packageFrame\">add3.add</a>",
       
   528         "<a href=\"add3/add/add/package-frame.html\" target=\"packageFrame\">add3.add.add</a>",
       
   529         "<a href=\"add3/add/add/add/package-frame.html\" target=\"packageFrame\">add3.add.add.add</a></li>"
       
   530     };
       
   531 
       
   532     final static String expectedImplementsOrdering[] = {
       
   533         "<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.lang.AutoCloseable</code></dd>",
       
   534         "<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.nio.channels.Channel</code></dd>",
       
   535         "<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.io.Closeable</code></dd>"
       
   536     };
       
   537 
       
   538     final static String expectedOverrideOrdering[] = {
       
   539         "<dd><code>iterator</code>&nbsp;in interface&nbsp;<code>java.util.Collection&lt;",
       
   540         "<dd><code>iterator</code>&nbsp;in interface&nbsp;<code>java.lang.Iterable&lt;"
       
   541     };
       
   542 }
   689 }