author | duke |
Wed, 05 Jul 2017 23:01:50 +0200 | |
changeset 44228 | e46434c65a2b |
parent 36778 | e04318f39f92 |
permissions | -rw-r--r-- |
26392
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
1 |
/* |
36778
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
2 |
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. |
26392
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
4 |
* |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
8 |
* |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
13 |
* accompanied this code). |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
14 |
* |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
18 |
* |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
21 |
* questions. |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
22 |
*/ |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
23 |
|
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
24 |
/* |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
25 |
* @test |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
26 |
* @bug 8025141 |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
27 |
* @summary Interfaces must not contain non-public fields, ensure $assertionsDisabled |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
28 |
* is not generated into an interface |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
29 |
* @library /tools/lib |
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
26392
diff
changeset
|
30 |
* @modules jdk.compiler/com.sun.tools.javac.api |
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
26392
diff
changeset
|
31 |
* jdk.compiler/com.sun.tools.javac.main |
36778
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
32 |
* @build toolbox.ToolBox toolbox.JavaTask Assertions AssertionsTest |
26392
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
33 |
* @run main AssertionsTest -da |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
34 |
* @run main AssertionsTest -ea:test.Assertions Inner |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
35 |
* @run main AssertionsTest -ea:test.Outer Outer |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
36 |
* @run main AssertionsTest -ea:test.Another Another.Inner |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
37 |
* @run main AssertionsTest -ea:test... Inner Outer Another.Inner |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
38 |
*/ |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
39 |
|
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
40 |
import java.util.Arrays; |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
41 |
|
36778
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
42 |
import toolbox.JavaTask; |
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
43 |
import toolbox.Task; |
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
44 |
import toolbox.ToolBox; |
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
45 |
|
26392
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
46 |
public class AssertionsTest { |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
47 |
|
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
48 |
public static void main(String... args) throws Exception { |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
49 |
String testClasses = System.getProperty("test.classes"); |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
50 |
ToolBox tb = new ToolBox(); |
36778
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
51 |
new JavaTask(tb).classpath(testClasses) |
26392
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
52 |
.vmOptions(args[0]) |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
53 |
.className("test.Assertions") |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
54 |
.classArgs(Arrays.copyOfRange(args, 1, args.length)) |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
55 |
.includeStandardOptions(false) |
36778
e04318f39f92
8152897: refactor ToolBox to allow reduced documented dependencies
jjg
parents:
36526
diff
changeset
|
56 |
.run(Task.Expect.SUCCESS) |
26392
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
57 |
.writeAll(); |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
58 |
} |
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
59 |
|
2bda2002e2f2
8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff
changeset
|
60 |
} |