langtools/test/tools/jdeps/listdeps/ListModuleDeps.java
author mchung
Tue, 03 Jan 2017 17:53:34 -0800
changeset 43026 8e8b50c7491d
parent 41998 feae61dc2280
permissions -rw-r--r--
8172212: jdeps --require and --check should detect the specified module in the image Reviewed-by: psandoz, lancea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41860
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
     1
/*
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
     4
 *
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
     7
 * published by the Free Software Foundation.
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
     8
 *
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    13
 * accompanied this code).
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    14
 *
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    18
 *
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    21
 * questions.
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    22
 */
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    23
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    24
/*
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    25
 * @test
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    26
 * @bug 8167057
41998
feae61dc2280 8169606: jdeps --list-reduced-deps should not show java.base as all modules require it
mchung
parents: 41860
diff changeset
    27
 * @summary Tests --list-deps and --list-reduced-deps options
41860
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    28
 * @modules java.logging
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    29
 *          java.xml
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    30
 *          jdk.compiler
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    31
 *          jdk.jdeps
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    32
 *          jdk.unsupported
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    33
 * @library ../lib
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    34
 * @build CompilerUtils JdepsRunner
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    35
 * @run testng ListModuleDeps
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    36
 */
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    37
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    38
import java.nio.file.Path;
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    39
import java.nio.file.Paths;
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    40
import java.util.Arrays;
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    41
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    42
import org.testng.annotations.BeforeTest;
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    43
import org.testng.annotations.DataProvider;
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    44
import org.testng.annotations.Test;
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    45
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    46
import static org.testng.Assert.assertEquals;
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    47
import static org.testng.Assert.assertTrue;
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    48
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    49
public class ListModuleDeps {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    50
    private static final String TEST_SRC = System.getProperty("test.src");
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    51
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    52
    private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    53
    private static final Path CLASSES_DIR = Paths.get("classes");
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    54
    private static final Path LIB_DIR = Paths.get("lib");
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    55
41998
feae61dc2280 8169606: jdeps --list-reduced-deps should not show java.base as all modules require it
mchung
parents: 41860
diff changeset
    56
    private static final Path HI_CLASS =
feae61dc2280 8169606: jdeps --list-reduced-deps should not show java.base as all modules require it
mchung
parents: 41860
diff changeset
    57
        CLASSES_DIR.resolve("hi").resolve("Hi.class");
41860
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    58
    private static final Path FOO_CLASS =
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    59
        CLASSES_DIR.resolve("z").resolve("Foo.class");
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    60
    private static final Path BAR_CLASS =
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    61
        CLASSES_DIR.resolve("z").resolve("Bar.class");
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    62
    private static final Path UNSAFE_CLASS =
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    63
        CLASSES_DIR.resolve("z").resolve("UseUnsafe.class");
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    64
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    65
    /**
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    66
     * Compiles classes used by the test
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    67
     */
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    68
    @BeforeTest
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    69
    public void compileAll() throws Exception {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    70
        // compile library
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    71
        assertTrue(CompilerUtils.compile(Paths.get(TEST_SRC, "src", "lib"), LIB_DIR));
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    72
41998
feae61dc2280 8169606: jdeps --list-reduced-deps should not show java.base as all modules require it
mchung
parents: 41860
diff changeset
    73
        // simple program depends only on java.base
feae61dc2280 8169606: jdeps --list-reduced-deps should not show java.base as all modules require it
mchung
parents: 41860
diff changeset
    74
        assertTrue(CompilerUtils.compile(Paths.get(TEST_SRC, "src", "hi"), CLASSES_DIR));
feae61dc2280 8169606: jdeps --list-reduced-deps should not show java.base as all modules require it
mchung
parents: 41860
diff changeset
    75
41860
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    76
        // compile classes in unnamed module
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    77
        assertTrue(CompilerUtils.compile(Paths.get(TEST_SRC, "src", "z"),
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    78
            CLASSES_DIR,
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    79
            "-cp", LIB_DIR.toString(),
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    80
            "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    81
            "--add-exports=java.base/sun.security.util=ALL-UNNAMED",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    82
            "--add-exports=java.xml/jdk.xml.internal=ALL-UNNAMED"
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    83
        ));
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    84
    }
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
    85
43026
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
    86
    @DataProvider(name = "jdkModules")
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
    87
    public Object[][] jdkModules() {
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
    88
        return new Object[][]{
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
    89
            {"jdk.compiler", new String[]{
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
    90
                                "java.base/sun.reflect.annotation",
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
    91
                                "java.compiler",
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
    92
                             }
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
    93
            },
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
    94
        };
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
    95
    }
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
    96
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
    97
    @Test(dataProvider = "jdkModules")
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
    98
    public void testJDKModule(String moduleName, String[] expected) {
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
    99
        JdepsRunner jdeps = JdepsRunner.run(
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
   100
            "--list-deps", "-m", moduleName
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
   101
        );
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
   102
        String[] output = Arrays.stream(jdeps.output())
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
   103
                                .map(s -> s.trim())
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
   104
                                .toArray(String[]::new);
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
   105
        assertEquals(output, expected);
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
   106
    }
8e8b50c7491d 8172212: jdeps --require and --check should detect the specified module in the image
mchung
parents: 41998
diff changeset
   107
41860
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   108
    @Test(dataProvider = "listdeps")
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   109
    public void testListDeps(Path classes, String[] expected) {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   110
        JdepsRunner jdeps = JdepsRunner.run(
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   111
            "--class-path", LIB_DIR.toString(),
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   112
            "--list-deps", classes.toString()
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   113
        );
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   114
        String[] output = Arrays.stream(jdeps.output())
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   115
                                .map(s -> s.trim())
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   116
                                .toArray(String[]::new);
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   117
        assertEquals(output, expected);
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   118
    }
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   119
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   120
    @Test(dataProvider = "reduceddeps")
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   121
    public void testListReducedDeps(Path classes, String[]  expected) {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   122
        JdepsRunner jdeps = JdepsRunner.run(
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   123
            "--class-path", LIB_DIR.toString(),
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   124
            "--list-reduced-deps", classes.toString()
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   125
        );
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   126
        String[] output = Arrays.stream(jdeps.output())
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   127
                                .map(s -> s.trim())
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   128
                                .toArray(String[]::new);
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   129
        assertEquals(output, expected);
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   130
    }
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   131
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   132
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   133
    @DataProvider(name = "listdeps")
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   134
    public Object[][] listdeps() {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   135
        return new Object[][] {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   136
            { CLASSES_DIR,  new String[] {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   137
                                "java.base/jdk.internal.misc",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   138
                                "java.base/sun.security.util",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   139
                                "java.logging",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   140
                                "java.sql",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   141
                                "java.xml/jdk.xml.internal",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   142
                                "jdk.unsupported",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   143
                                "unnamed module: lib"
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   144
                            }
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   145
            },
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   146
41998
feae61dc2280 8169606: jdeps --list-reduced-deps should not show java.base as all modules require it
mchung
parents: 41860
diff changeset
   147
            { HI_CLASS,     new String[] {
feae61dc2280 8169606: jdeps --list-reduced-deps should not show java.base as all modules require it
mchung
parents: 41860
diff changeset
   148
                                "java.base"
feae61dc2280 8169606: jdeps --list-reduced-deps should not show java.base as all modules require it
mchung
parents: 41860
diff changeset
   149
                            }
feae61dc2280 8169606: jdeps --list-reduced-deps should not show java.base as all modules require it
mchung
parents: 41860
diff changeset
   150
            },
feae61dc2280 8169606: jdeps --list-reduced-deps should not show java.base as all modules require it
mchung
parents: 41860
diff changeset
   151
41860
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   152
            { FOO_CLASS,    new String[] {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   153
                                "java.base",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   154
                                "java.logging",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   155
                                "java.sql",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   156
                                "java.xml",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   157
                                "unnamed module: lib"
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   158
                            }
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   159
            },
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   160
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   161
            { BAR_CLASS,    new String[] {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   162
                                "java.base/sun.security.util",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   163
                                "java.xml/jdk.xml.internal",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   164
                            }
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   165
            },
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   166
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   167
            { UNSAFE_CLASS, new String[] {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   168
                                "java.base/jdk.internal.misc",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   169
                                "jdk.unsupported",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   170
                            }
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   171
            },
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   172
        };
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   173
    }
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   174
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   175
    @DataProvider(name = "reduceddeps")
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   176
    public Object[][] reduceddeps() {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   177
        Path barClass = CLASSES_DIR.resolve("z").resolve("Bar.class");
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   178
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   179
        return new Object[][] {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   180
            { CLASSES_DIR,  new String[] {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   181
                                "java.base/jdk.internal.misc",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   182
                                "java.base/sun.security.util",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   183
                                "java.sql",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   184
                                "java.xml/jdk.xml.internal",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   185
                                "jdk.unsupported",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   186
                                "unnamed module: lib"
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   187
                            }
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   188
            },
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   189
41998
feae61dc2280 8169606: jdeps --list-reduced-deps should not show java.base as all modules require it
mchung
parents: 41860
diff changeset
   190
            { HI_CLASS,     new String[] {
feae61dc2280 8169606: jdeps --list-reduced-deps should not show java.base as all modules require it
mchung
parents: 41860
diff changeset
   191
                                "java.base"
feae61dc2280 8169606: jdeps --list-reduced-deps should not show java.base as all modules require it
mchung
parents: 41860
diff changeset
   192
                            }
feae61dc2280 8169606: jdeps --list-reduced-deps should not show java.base as all modules require it
mchung
parents: 41860
diff changeset
   193
            },
41860
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   194
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   195
            { FOO_CLASS,    new String[] {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   196
                                "java.sql",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   197
                                "unnamed module: lib"
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   198
                            }
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   199
            },
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   200
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   201
            { BAR_CLASS,    new String[] {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   202
                                "java.base/sun.security.util",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   203
                                "java.xml/jdk.xml.internal",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   204
                            }
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   205
            },
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   206
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   207
            { UNSAFE_CLASS, new String[] {
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   208
                                "java.base/jdk.internal.misc",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   209
                                "jdk.unsupported",
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   210
                            }
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   211
            },
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   212
        };
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   213
    }
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   214
906670ff49c7 8167057: jdeps option to list modules and internal APIs for @modules for test dev
mchung
parents:
diff changeset
   215
}