81 "--add-exports=java.base/sun.security.util=ALL-UNNAMED", |
81 "--add-exports=java.base/sun.security.util=ALL-UNNAMED", |
82 "--add-exports=java.xml/jdk.xml.internal=ALL-UNNAMED" |
82 "--add-exports=java.xml/jdk.xml.internal=ALL-UNNAMED" |
83 )); |
83 )); |
84 } |
84 } |
85 |
85 |
|
86 @DataProvider(name = "jdkModules") |
|
87 public Object[][] jdkModules() { |
|
88 return new Object[][]{ |
|
89 {"jdk.compiler", new String[]{ |
|
90 "java.base/sun.reflect.annotation", |
|
91 "java.compiler", |
|
92 } |
|
93 }, |
|
94 }; |
|
95 } |
|
96 |
|
97 @Test(dataProvider = "jdkModules") |
|
98 public void testJDKModule(String moduleName, String[] expected) { |
|
99 JdepsRunner jdeps = JdepsRunner.run( |
|
100 "--list-deps", "-m", moduleName |
|
101 ); |
|
102 String[] output = Arrays.stream(jdeps.output()) |
|
103 .map(s -> s.trim()) |
|
104 .toArray(String[]::new); |
|
105 assertEquals(output, expected); |
|
106 } |
|
107 |
86 @Test(dataProvider = "listdeps") |
108 @Test(dataProvider = "listdeps") |
87 public void testListDeps(Path classes, String[] expected) { |
109 public void testListDeps(Path classes, String[] expected) { |
88 JdepsRunner jdeps = JdepsRunner.run( |
110 JdepsRunner jdeps = JdepsRunner.run( |
89 "--class-path", LIB_DIR.toString(), |
111 "--class-path", LIB_DIR.toString(), |
90 "--list-deps", classes.toString() |
112 "--list-deps", classes.toString() |