author | amurillo |
Thu, 13 Aug 2015 15:50:52 -0700 | |
changeset 32224 | dae855d05f6c |
parent 30730 | d3ce7619db2c |
child 32337 | c9d3ab9f601c |
permissions | -rw-r--r-- |
28799 | 1 |
/* |
2 |
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
/* |
|
27 |
* @test |
|
28 |
* @summary Test to check that -j option works with more than one value |
|
29 |
* @bug 8071629 |
|
30 |
* @author sogoel |
|
31 |
* @library /tools/lib |
|
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
28799
diff
changeset
|
32 |
* @modules jdk.compiler/com.sun.tools.javac.api |
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
28799
diff
changeset
|
33 |
* jdk.compiler/com.sun.tools.javac.file |
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
28799
diff
changeset
|
34 |
* jdk.compiler/com.sun.tools.javac.main |
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
28799
diff
changeset
|
35 |
* jdk.compiler/com.sun.tools.sjavac |
28799 | 36 |
* @build Wrapper ToolBox |
37 |
* @run main Wrapper ParallelCompilations |
|
38 |
*/ |
|
39 |
||
40 |
import java.io.*; |
|
41 |
import java.nio.file.*; |
|
42 |
import com.sun.tools.sjavac.Main; |
|
43 |
||
44 |
class ParallelCompilations extends SJavacTester { |
|
45 |
public static void main(String[] args) throws Exception { |
|
46 |
new ParallelCompilations().run(); |
|
47 |
} |
|
48 |
||
49 |
public void run() throws Exception { |
|
50 |
ToolBox tb = new ToolBox(); |
|
51 |
final String SERVER_ARG = "--server:" |
|
52 |
+ "portfile=testportfile," |
|
53 |
+ "background=false"; |
|
54 |
||
55 |
// Generate 10 files |
|
56 |
for (int i = 0; i < 10; i++) { |
|
57 |
String fileName = "Test" + i; |
|
58 |
String content = "package foo"+ i + ";\n" + |
|
59 |
"public class "+ fileName + "{\n" + |
|
60 |
" public static void main(String[] args) {}\n" + |
|
61 |
"\n}"; |
|
62 |
Path srcDir = Paths.get("src"); |
|
63 |
tb.writeJavaFiles(srcDir,content); |
|
64 |
} |
|
65 |
//Method will throw an exception if compilation fails |
|
66 |
compile("src", "-d", "classes", "-j", "10", SERVER_ARG, "--log=debug"); |
|
67 |
} |
|
68 |
} |