35 import java.io.IOException; |
35 import java.io.IOException; |
36 import java.io.PrintWriter; |
36 import java.io.PrintWriter; |
37 import java.io.StringWriter; |
37 import java.io.StringWriter; |
38 import java.nio.file.Files; |
38 import java.nio.file.Files; |
39 import java.nio.file.Path; |
39 import java.nio.file.Path; |
|
40 import java.nio.file.Paths; |
40 import java.util.*; |
41 import java.util.*; |
41 import java.util.regex.*; |
42 import java.util.regex.*; |
42 import java.util.stream.Collectors; |
43 import java.util.stream.Collectors; |
43 |
44 |
44 import static java.nio.file.StandardCopyOption.*; |
45 import static java.nio.file.StandardCopyOption.*; |
133 cpath.append(File.pathSeparator).append(dir2.toString()); |
134 cpath.append(File.pathSeparator).append(dir2.toString()); |
134 test(new File(testDir, "Test.class"), |
135 test(new File(testDir, "Test.class"), |
135 new String[] {"java.lang.Object", "java.lang.String", "p.Foo", "p.Bar"}, |
136 new String[] {"java.lang.Object", "java.lang.String", "p.Foo", "p.Bar"}, |
136 new String[] {"compact1", "compact1", dir1.toFile().getName(), dir2.toFile().getName()}, |
137 new String[] {"compact1", "compact1", dir1.toFile().getName(), dir2.toFile().getName()}, |
137 new String[] {"-v", "-classpath", cpath.toString(), "Test.class"}); |
138 new String[] {"-v", "-classpath", cpath.toString(), "Test.class"}); |
|
139 |
|
140 // tests --missing-deps option |
|
141 test(new File(testDir, "Test.class"), |
|
142 new String[] {"p.Foo", "p.Bar"}, |
|
143 new String[] {"not found", "not found"}, |
|
144 new String[] {"--missing-deps"}); |
|
145 |
|
146 // no missing dependence |
|
147 test(new File(testDir, "Test.class"), |
|
148 new String[0], |
|
149 new String[0], |
|
150 new String[] {"--missing-deps", "-classpath", cpath.toString()}); |
|
151 |
138 return errors; |
152 return errors; |
139 } |
153 } |
140 |
154 |
141 void test(File file, String[] expect, String[] profiles) { |
155 void test(File file, String[] expect, String[] profiles) { |
142 test(file, expect, profiles, new String[0]); |
156 test(file, expect, profiles, new String[0]); |