langtools/test/jdk/javadoc/tool/modules/FilterOptions.java
author ksrini
Wed, 19 Oct 2016 14:51:20 -0700
changeset 41633 eec0f5b0465f
parent 41252 058d83c9b1c7
child 41634 3f9c491b05aa
permissions -rw-r--r--
8167383: Javadoc does not handle packages correctly when used with module option. Reviewed-by: bpatel, jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
     1
/*
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
     4
 *
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
     7
 * published by the Free Software Foundation.
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
     8
 *
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    13
 * accompanied this code).
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    14
 *
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    18
 *
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    21
 * questions.
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    22
 */
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    23
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    24
/**
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    25
 * @test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    26
 * @bug 8159305
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    27
 * @summary Tests elements filtering options
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    28
 * @modules
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    29
 *      jdk.javadoc/jdk.javadoc.internal.api
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    30
 *      jdk.javadoc/jdk.javadoc.internal.tool
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    31
 *      jdk.compiler/com.sun.tools.javac.api
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    32
 *      jdk.compiler/com.sun.tools.javac.main
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    33
 * @library /tools/lib
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    34
 * @build toolbox.ToolBox toolbox.TestRunner
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    35
 * @run main FilterOptions
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    36
 */
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    37
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    38
import java.io.IOException;
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    39
import java.nio.file.Path;
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    40
import java.nio.file.Paths;
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    41
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    42
import toolbox.*;
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    43
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    44
public class FilterOptions extends ModuleTestBase {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    45
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    46
    private static final String NL = System.getProperty("line.separator");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    47
    private static final String INDENT = "    ";
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    48
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    49
    // the sources are shared, so create it once
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    50
    private final String src;
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    51
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    52
    public static void main(String... args) throws Exception {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    53
        new FilterOptions().runTests();
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    54
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    55
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    56
    FilterOptions() throws IOException {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    57
        this.src = createSources(Paths.get(".").resolve("src"));
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    58
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    59
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    60
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    61
    public void testDefault(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
    62
        execTask("--module-source-path", src, "--module", "m1");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    63
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    64
        checkModulesSpecified("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    65
        checkModulesIncluded("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    66
        checkPackagesIncluded("pub");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    67
        checkTypesIncluded("pub.A", "pub.A.ProtectedNested", "pub.A.PublicNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    68
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    69
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    70
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    71
    public void testModuleModeApi(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
    72
        execTask("--module-source-path", src,
41252
058d83c9b1c7 8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents: 40599
diff changeset
    73
                "--module", "m1", "--show-module-contents", "api");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    74
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    75
        checkModuleMode("API");
41633
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
    76
        checkModulesSpecified("m1");
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
    77
        checkModulesIncluded("m1");
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
    78
        checkPackagesIncluded("pub");
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
    79
        checkPackagesNotIncluded("pro", "pqe");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    80
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    81
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    82
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    83
    public void testModuleModeAll(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
    84
        execTask("--module-source-path", src,
41252
058d83c9b1c7 8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents: 40599
diff changeset
    85
                "--module", "m1", "--show-module-contents", "all");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    86
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    87
        checkModuleMode("ALL");
41633
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
    88
        checkModulesSpecified("m1");
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
    89
        checkModulesIncluded("m1");
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
    90
        checkPackagesIncluded("pub", "pqe");
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
    91
        checkPackagesNotIncluded("pro");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    92
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    93
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    94
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    95
    public void testShowPackagesExported(Path base)  throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
    96
        execTask("--module-source-path", src,
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    97
                "--module", "m1",
41252
058d83c9b1c7 8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents: 40599
diff changeset
    98
                "--show-packages", "exported"); // default
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
    99
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   100
        checkModulesSpecified("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   101
        checkModulesIncluded("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   102
        checkPackagesIncluded("pub");
41633
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   103
        checkPackagesNotIncluded("pqe", "pro");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   104
        checkTypesIncluded("pub.A", "pub.A.ProtectedNested", "pub.A.PublicNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   105
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   106
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   107
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   108
    public void testShowPackagesAll(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
   109
        execTask("--module-source-path", src,
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   110
                "--module", "m1",
41252
058d83c9b1c7 8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents: 40599
diff changeset
   111
                "--show-packages", "all");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   112
        checkModulesSpecified("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   113
        checkModulesIncluded("m1");
41633
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   114
        checkPackagesIncluded("pub", "pqe", "pro");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   115
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   116
        checkTypesIncluded("pub.A", "pub.A.ProtectedNested", "pub.A.PublicNested",
41633
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   117
                           "pqe.A", "pqe.A.ProtectedNested", "pqe.A.PublicNested",
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   118
                           "pro.A", "pro.A.ProtectedNested", "pro.A.PublicNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   119
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   120
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   121
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   122
    public void testShowTypesPrivate(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
   123
        execTask("--module-source-path", src,
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   124
                "--module", "m1",
41252
058d83c9b1c7 8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents: 40599
diff changeset
   125
                "--show-types", "private");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   126
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   127
        checkModulesSpecified("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   128
        checkModulesIncluded("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   129
        checkPackagesIncluded("pub");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   130
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   131
        checkTypesIncluded("pub.A", "pub.A.PrivateNested", "pub.A.Nested", "pub.A.ProtectedNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   132
                           "pub.A.PublicNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   133
                           "pub.B", "pub.B.PrivateNested", "pub.B.Nested", "pub.B.ProtectedNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   134
                           "pub.B.PublicNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   135
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   136
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   137
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   138
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   139
    public void testShowTypesPackage(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
   140
        execTask("--module-source-path", src,
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   141
                "--module", "m1",
41252
058d83c9b1c7 8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents: 40599
diff changeset
   142
                "--show-types", "package");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   143
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   144
        checkModulesSpecified("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   145
        checkModulesIncluded("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   146
        checkPackagesIncluded("pub");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   147
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   148
        checkTypesIncluded("pub.A", "pub.A.Nested", "pub.A.ProtectedNested", "pub.A.PublicNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   149
                           "pub.B", "pub.B.Nested", "pub.B.ProtectedNested", "pub.B.PublicNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   150
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   151
        checkTypesNotIncluded(".*private.*");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   152
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   153
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   154
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   155
    public void testShowTypesProtected(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
   156
        execTask("--module-source-path", src,
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   157
                "--module", "m1",
41252
058d83c9b1c7 8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents: 40599
diff changeset
   158
                "--show-types", "protected");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   159
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   160
        checkModulesSpecified("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   161
        checkModulesIncluded("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   162
        checkPackagesIncluded("pub");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   163
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   164
        checkTypesIncluded("pub.A", "pub.A.ProtectedNested", "pub.A.PublicNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   165
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   166
        checkTypesNotIncluded("pub.A.Nested", "pub.A.PrivateNested", "pub.B.Nested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   167
                              "pub.B.PrivateNested", "pub.B.ProtectedNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   168
                              "pub.B.PublicNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   169
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   170
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   171
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   172
    public void testShowTypesPublic(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
   173
        execTask("--module-source-path", src,
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   174
                "--module", "m1",
41252
058d83c9b1c7 8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents: 40599
diff changeset
   175
                "--show-types", "public");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   176
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   177
        checkModulesSpecified("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   178
        checkModulesIncluded("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   179
        checkPackagesIncluded("pub");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   180
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   181
        checkTypesIncluded("pub.A", "pub.A.PublicNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   182
        checkTypesNotIncluded("pub.A.Nested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   183
                              "pub.A.ProtectedNested", "pub.A.PrivateNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   184
                              "pub.B.Nested", "pub.B.ProtectedNested", "pub.B.PrivateNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   185
                              "pub.B.PublicNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   186
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   187
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   188
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   189
    public void testShowMembersPrivate(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
   190
        execTask("--module-source-path", src,
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   191
                "--module", "m1",
41252
058d83c9b1c7 8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents: 40599
diff changeset
   192
                "--show-members", "private");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   193
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   194
        checkMembers(Visibility.PRIVATE);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   195
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   196
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   197
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   198
    public void testShowMembersPackage(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
   199
        execTask("--module-source-path", src,
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   200
                "--module", "m1",
41252
058d83c9b1c7 8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents: 40599
diff changeset
   201
                "--show-members", "package");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   202
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   203
        checkMembers(Visibility.PACKAGE);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   204
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   205
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   206
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   207
    public void testShowMembersProtected(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
   208
        execTask("--module-source-path", src,
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   209
                "--module", "m1",
41252
058d83c9b1c7 8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents: 40599
diff changeset
   210
                "--show-members", "protected");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   211
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   212
        checkMembers(Visibility.PROTECTED);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   213
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   214
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   215
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   216
    public void testShowMembersPublic(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
   217
        execTask("--module-source-path", src,
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   218
                "--module", "m1",
41252
058d83c9b1c7 8166144: New javadoc options don't conform to JEP 293 (GNU style options)
jjg
parents: 40599
diff changeset
   219
                "--show-members", "public");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   220
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   221
        checkMembers(Visibility.PUBLIC);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   222
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   223
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   224
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   225
    public void testLegacyPublic(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
   226
        execTask("--module-source-path", src,
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   227
                "--module", "m1",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   228
                "-public");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   229
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   230
        checkModuleMode("API");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   231
        checkModulesSpecified("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   232
        checkModulesIncluded("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   233
        checkPackagesIncluded("pub");
41633
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   234
        checkPackagesNotIncluded("pqe", "pro");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   235
        checkTypesIncluded("pub.A", "pub.A.PublicNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   236
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   237
        checkMembers(Visibility.PUBLIC);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   238
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   239
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   240
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   241
    public void testLegacyDefault(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
   242
        execTask("--module-source-path", src,
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   243
                "--module", "m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   244
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   245
        checkModuleMode("API");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   246
        checkModulesSpecified("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   247
        checkModulesIncluded("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   248
        checkPackagesIncluded("pub");
41633
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   249
        checkPackagesNotIncluded("pqe", "pro");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   250
        checkTypesIncluded("pub.A", "pub.A.ProtectedNested", "pub.A.PublicNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   251
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   252
        checkMembers(Visibility.PROTECTED);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   253
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   254
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   255
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   256
    public void testLegacyProtected(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
   257
        execTask("--module-source-path", src,
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   258
                "--module", "m1",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   259
                "-protected");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   260
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   261
        checkModuleMode("API");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   262
        checkModulesSpecified("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   263
        checkModulesIncluded("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   264
        checkPackagesIncluded("pub");
41633
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   265
        checkPackagesNotIncluded("pqe", "pro");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   266
        checkTypesIncluded("pub.A", "pub.A.ProtectedNested", "pub.A.PublicNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   267
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   268
        checkMembers(Visibility.PROTECTED);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   269
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   270
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   271
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   272
    public void testLegacyPackage(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
   273
        execTask("--module-source-path", src,
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   274
                "--module", "m1",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   275
                "-package");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   276
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   277
        checkModuleMode("ALL");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   278
        checkModulesSpecified("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   279
        checkModulesIncluded("m1");
41633
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   280
        checkPackagesIncluded("pub", "pqe", "pro");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   281
        checkTypesIncluded("pub.B", "pub.B.Nested", "pub.B.ProtectedNested", "pub.B.PublicNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   282
                           "pub.A", "pub.A.Nested", "pub.A.ProtectedNested", "pub.A.PublicNested",
41633
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   283
                           "pqe.A", "pqe.A.Nested", "pqe.A.ProtectedNested", "pqe.A.PublicNested",
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   284
                           "pro.B", "pro.B.Nested", "pro.B.ProtectedNested", "pro.B.PublicNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   285
                           "pro.A", "pro.A.Nested", "pro.A.ProtectedNested", "pro.A.PublicNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   286
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   287
        checkMembers(Visibility.PACKAGE);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   288
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   289
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   290
    @Test
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   291
    public void testLegacyPrivate(Path base) throws Exception {
40599
be40838eb215 8164887: update tests to remove use of old-style options
jjg
parents: 40508
diff changeset
   292
        execTask("--module-source-path", src,
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   293
                "--module", "m1",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   294
                "-private");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   295
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   296
        checkModuleMode("ALL");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   297
        checkModulesSpecified("m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   298
        checkModulesIncluded("m1");
41633
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   299
        checkPackagesIncluded("pub", "pqe", "pro");
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   300
        checkTypesIncluded("pub.B", "pub.B.PrivateNested", "pub.B.Nested", "pub.B.ProtectedNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   301
                           "pub.B.PublicNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   302
                           "pub.A", "pub.A.PrivateNested", "pub.A.Nested", "pub.A.ProtectedNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   303
                           "pub.A.PublicNested",
41633
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   304
                           "pqe.A", "pqe.A.PrivateNested", "pqe.A.Nested", "pqe.A.ProtectedNested",
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   305
                           "pqe.A.PublicNested",
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   306
                           "pro.B", "pro.B.PrivateNested", "pro.B.Nested", "pro.B.ProtectedNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   307
                           "pro.B.PublicNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   308
                           "pro.A", "pro.A.PrivateNested", "pro.A.Nested", "pro.A.ProtectedNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   309
                           "pro.A.PublicNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   310
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   311
        checkMembers(Visibility.PRIVATE);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   312
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   313
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   314
    private static enum Visibility {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   315
        PRIVATE, PACKAGE, PROTECTED, PUBLIC;
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   316
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   317
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   318
    void checkMembers(Visibility v) throws Exception {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   319
        checkMembersPresence(v);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   320
        checkMembersAbsence(v);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   321
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   322
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   323
    void checkMembersPresence(Visibility v) throws Exception {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   324
        switch (v) {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   325
            case PRIVATE:
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   326
                checkMembersSelected("pub.A.privateFieldA",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   327
                                     "pub.A.PublicNested.privateFieldPublicNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   328
                                     "pub.A.ProtectedNested.privateFieldProtectedNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   329
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   330
            case PACKAGE:
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   331
                checkMembersSelected("pub.A.FieldA",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   332
                                     "pub.A.PublicNested.FieldPublicNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   333
                                     "pub.A.ProtectedNested.FieldProtectedNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   334
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   335
            case PROTECTED:
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   336
                checkMembersSelected("pub.A.<init>",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   337
                                     "pub.A.protectedFieldA",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   338
                                     "pub.A.PublicNested.protectedFieldPublicNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   339
                                     "pub.A.ProtectedNested.<init>",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   340
                                     "pub.A.ProtectedNested.protectedFieldProtectedNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   341
                                     "pub.A.ProtectedNested.publicFieldProtectedNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   342
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   343
            case PUBLIC:
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   344
                checkMembersSelected("pub.A.publicFieldA",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   345
                                     "pub.A.PublicNested.<init>",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   346
                                     "pub.A.PublicNested.publicFieldPublicNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   347
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   348
                break;
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   349
        }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   350
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   351
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   352
    void checkMembersAbsence(Visibility v) throws Exception {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   353
        switch (v) {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   354
            case PUBLIC:
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   355
                checkMembersNotSelected("pub.A.protectedFieldA",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   356
                                        "pub.A.PublicNested.protectedFieldPublicNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   357
                                        "pub.A.ProtectedNested.<init>",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   358
                                        "pub.A.ProtectedNested.protectedFieldProtectedNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   359
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   360
            case PROTECTED:
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   361
                checkMembersNotSelected("pub.A.FieldA",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   362
                                        "pub.A.PublicNested.FieldPublicNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   363
                                        "pub.A.ProtectedNested.FieldProtectedNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   364
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   365
            case PACKAGE:
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   366
                checkMembersNotSelected("pub.A.privateFieldA",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   367
                                        "pub.A.PublicNested.privateFieldPublicNested",
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   368
                                        "pub.A.ProtectedNested.privateFieldProtectedNested");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   369
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   370
            case PRIVATE:
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   371
                break;
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   372
        }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   373
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   374
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   375
    String createSources(Path src) throws IOException {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   376
        ModuleBuilder mb1 = new ModuleBuilder(tb, "m1");
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   377
        mb1.comment("The first module.")
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   378
                .classes(createClass("pub", "A", true))
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   379
                .classes(createClass("pub", "B", false))
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   380
                .classes(createClass("pro", "A", true))
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   381
                .classes(createClass("pro", "B", false))
41633
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   382
                .classes(createClass("pqe", "A", true))
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   383
                .exports("pub")
41633
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   384
                .exportsTo("pqe", "m2")
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   385
                .write(src);
41633
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   386
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   387
        ModuleBuilder mb2 = new ModuleBuilder(tb, "m2");
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   388
        mb2.comment("The second module")
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   389
                .classes(createClass("m2pub", "A", true))
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   390
                .requires("m1")
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   391
                .write(src);
eec0f5b0465f 8167383: Javadoc does not handle packages correctly when used with module option.
ksrini
parents: 41252
diff changeset
   392
40508
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   393
        return src.toString();
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   394
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   395
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   396
    String createClass(String pkg, String name, boolean isPublic) {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   397
        StringBuilder sb = new StringBuilder("package ")
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   398
                .append(pkg)
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   399
                .append("; ")
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   400
                .append(NL);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   401
        sb.append(" /** Klass ")
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   402
                .append(name)
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   403
                .append(" */")
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   404
                .append(NL);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   405
        sb.append(isPublic ? "public " : " ")
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   406
                .append("class ")
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   407
                .append(name)
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   408
                .append(" {")
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   409
                .append(NL);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   410
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   411
        sb.append(createMembers(INDENT, name));
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   412
        sb.append(createNestedClass(INDENT, "PublicNested", name, "public"));
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   413
        sb.append(createNestedClass(INDENT, "ProtectedNested", name, "protected"));
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   414
        sb.append(createNestedClass(INDENT, "Nested", name, ""));
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   415
        sb.append(createNestedClass(INDENT, "PrivateNested", name, "private"));
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   416
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   417
        return sb.append("}").toString();
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   418
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   419
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   420
    StringBuilder createNestedClass(String indent, String name, String enclosing, String visibility) {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   421
        return new StringBuilder()
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   422
                .append(indent).append(" /** Klass ").append(name).append(" */").append(NL)
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   423
                .append(indent).append(visibility).append(" class ").append(name).append(" {").append(NL)
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   424
                .append(createMembers(indent + INDENT, name)).append(indent).append("}").append(NL);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   425
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   426
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   427
    StringBuilder createMembers(String indent, String enclosing) {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   428
        return new StringBuilder()
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   429
                .append(indent).append(createMember(enclosing, "public"))
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   430
                .append(indent).append(createMember(enclosing, "protected"))
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   431
                .append(indent).append(createMember(enclosing, ""))
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   432
                .append(indent).append(createMember(enclosing, "private"))
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   433
                .append(NL);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   434
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   435
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   436
    StringBuilder createMember(String enclosingClass, String visibility) {
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   437
        return new StringBuilder()
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   438
                .append("/** a ")
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   439
                .append(visibility)
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   440
                .append("Field in ")
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   441
                .append(enclosingClass)
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   442
                .append(" */ ")
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   443
                .append(visibility)
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   444
                .append(" String ")
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   445
                .append(visibility)
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   446
                .append("Field")
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   447
                .append(enclosingClass)
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   448
                .append(";")
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   449
                .append(NL);
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   450
    }
74ef30d16fb9 8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
diff changeset
   451
}