langtools/test/tools/javac/defaultMethods/AssertionsTest.java
author akulyakh
Thu, 21 May 2015 11:41:04 -0700
changeset 30730 d3ce7619db2c
parent 26392 2bda2002e2f2
child 36526 3b41f1c69604
permissions -rw-r--r--
8076543: Add @modules as needed to the langtools tests Reviewed-by: jjg, shurailine
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26392
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
     1
/*
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 26392
diff changeset
     2
 * Copyright (c) 2013, 2015, 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.file
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 26392
diff changeset
    32
 *          jdk.compiler/com.sun.tools.javac.main
26392
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    33
 * @build ToolBox Assertions AssertionsTest
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    34
 * @run main AssertionsTest -da
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    35
 * @run main AssertionsTest -ea:test.Assertions Inner
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    36
 * @run main AssertionsTest -ea:test.Outer Outer
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    37
 * @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
    38
 * @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
    39
 */
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    40
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    41
import java.util.Arrays;
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    42
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    43
public class AssertionsTest {
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    44
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    45
    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
    46
        String testClasses = System.getProperty("test.classes");
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    47
        ToolBox tb = new ToolBox();
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    48
        tb.new JavaTask().classpath(testClasses)
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    49
                         .vmOptions(args[0])
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    50
                         .className("test.Assertions")
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    51
                         .classArgs(Arrays.copyOfRange(args, 1, args.length))
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    52
                         .includeStandardOptions(false)
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    53
                         .run(ToolBox.Expect.SUCCESS)
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    54
                         .writeAll();
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    55
    }
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    56
2bda2002e2f2 8047675: tools/javac/defaultMethods/Assertions.java fails if run with -enableassertions (-ea)
jlahoda
parents:
diff changeset
    57
}