equal
deleted
inserted
replaced
23 |
23 |
24 |
24 |
25 /* |
25 /* |
26 * @test |
26 * @test |
27 * @summary Test all aspects of sjavac. |
27 * @summary Test all aspects of sjavac. |
28 * @bug 8004658 8042441 8042699 |
28 * @bug 8004658 8042441 8042699 8054461 |
29 * |
29 * |
30 * @build Wrapper |
30 * @build Wrapper |
31 * @run main Wrapper SJavac |
31 * @run main Wrapper SJavac |
32 */ |
32 */ |
33 |
33 |
97 compileWithOverrideSource(); |
97 compileWithOverrideSource(); |
98 compileWithInvisibleSources(); |
98 compileWithInvisibleSources(); |
99 compileCircularSources(); |
99 compileCircularSources(); |
100 compileExcludingDependency(); |
100 compileExcludingDependency(); |
101 incrementalCompileTestFullyQualifiedRef(); |
101 incrementalCompileTestFullyQualifiedRef(); |
|
102 compileWithAtFile(); |
102 |
103 |
103 delete(gensrc); |
104 delete(gensrc); |
104 delete(gensrc2); |
105 delete(gensrc2); |
105 delete(gensrc3); |
106 delete(gensrc3); |
106 delete(bin); |
107 delete(bin); |
461 "bin/alfa/omega/A.class", |
462 "bin/alfa/omega/A.class", |
462 "bin/beta/B.class", |
463 "bin/beta/B.class", |
463 "bin/javac_state"); |
464 "bin/javac_state"); |
464 } |
465 } |
465 |
466 |
|
467 /** |
|
468 * Tests @atfile |
|
469 * @throws Exception If test fails |
|
470 */ |
|
471 void compileWithAtFile() throws Exception { |
|
472 System.out.println("\nTest @atfile with command line content."); |
|
473 System.out.println("---------------------------------------"); |
|
474 |
|
475 delete(gensrc); |
|
476 delete(gensrc2); |
|
477 delete(bin); |
|
478 |
|
479 populate(gensrc, |
|
480 "list.txt", |
|
481 "-if */alfa/omega/A.java\n-if */beta/B.java\ngensrc\n-d bin\n", |
|
482 "alfa/omega/A.java", |
|
483 "package alfa.omega; import beta.B; public class A { B b; }", |
|
484 "beta/B.java", |
|
485 "package beta; public class B { }", |
|
486 "beta/C.java", |
|
487 "broken"); |
|
488 previous_bin_state = collectState(bin); |
|
489 compile("@gensrc/list.txt", "--server:portfile=testserver,background=false"); |
|
490 |
|
491 Map<String,Long> new_bin_state = collectState(bin); |
|
492 verifyThatFilesHaveBeenAdded(previous_bin_state, new_bin_state, |
|
493 "bin/javac_state", |
|
494 "bin/alfa/omega/A.class", |
|
495 "bin/beta/B.class"); |
|
496 } |
|
497 |
466 void removeFrom(Path dir, String... args) throws IOException { |
498 void removeFrom(Path dir, String... args) throws IOException { |
467 for (String filename : args) { |
499 for (String filename : args) { |
468 Path p = dir.resolve(filename); |
500 Path p = dir.resolve(filename); |
469 Files.delete(p); |
501 Files.delete(p); |
470 } |
502 } |