author | avstepan |
Tue, 19 May 2015 16:04:14 +0400 | |
changeset 30655 | d83f50188ca9 |
parent 28276 | ec66954fa850 |
child 30730 | d3ce7619db2c |
permissions | -rw-r--r-- |
28276
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
1 |
/* |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
2 |
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
4 |
* |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
10 |
* |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
15 |
* accompanied this code). |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
16 |
* |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
20 |
* |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
23 |
* questions. |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
24 |
*/ |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
25 |
|
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
26 |
/* |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
27 |
* @test |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
28 |
* @summary Test \@atfile with command line content |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
29 |
* @bug 8054689 |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
30 |
* @author Fredrik O |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
31 |
* @author sogoel (rewrite) |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
32 |
* @library /tools/lib |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
33 |
* @build Wrapper ToolBox |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
34 |
* @run main Wrapper CompileWithAtFile |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
35 |
*/ |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
36 |
|
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
37 |
import java.util.*; |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
38 |
import java.nio.file.*; |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
39 |
|
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
40 |
public class CompileWithAtFile extends SJavacTester { |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
41 |
public static void main(String... args) throws Exception { |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
42 |
CompileWithAtFile cwf = new CompileWithAtFile(); |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
43 |
cwf.test(); |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
44 |
} |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
45 |
|
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
46 |
void test() throws Exception { |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
47 |
ToolBox tb = new ToolBox(); |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
48 |
tb.writeFile(GENSRC.resolve("list.txt"), |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
49 |
"-if */alfa/omega/A.java\n-if */beta/B.java\ngensrc\n-d bin\n"); |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
50 |
tb.writeFile(GENSRC.resolve("alfa/omega/A.java"), |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
51 |
"package alfa.omega; import beta.B; public class A { B b; }"); |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
52 |
tb.writeFile(GENSRC.resolve("beta/B.java"), |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
53 |
"package beta; public class B { }"); |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
54 |
tb.writeFile(GENSRC.resolve("beta/C.java"), |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
55 |
"broken"); |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
56 |
|
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
57 |
Files.createDirectory(BIN); |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
58 |
Map<String,Long> previous_bin_state = collectState(BIN); |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
59 |
compile("@gensrc/list.txt", "--server:portfile=testserver,background=false"); |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
60 |
|
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
61 |
Map<String,Long> new_bin_state = collectState(BIN); |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
62 |
verifyThatFilesHaveBeenAdded(previous_bin_state, new_bin_state, |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
63 |
"bin/javac_state", |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
64 |
"bin/alfa/omega/A.class", |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
65 |
"bin/beta/B.class"); |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
66 |
clean(GENSRC, BIN); |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
67 |
} |
ec66954fa850
8054689: Split large SJavac.java test source into multiple files
sogoel
parents:
diff
changeset
|
68 |
} |