langtools/test/tools/javac/defaultMethods/AssertionsTest.java
changeset 36778 e04318f39f92
parent 36526 3b41f1c69604
equal deleted inserted replaced
36777:28d33fb9097f 36778:e04318f39f92
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    26  * @bug 8025141
    26  * @bug 8025141
    27  * @summary Interfaces must not contain non-public fields, ensure $assertionsDisabled
    27  * @summary Interfaces must not contain non-public fields, ensure $assertionsDisabled
    28  *          is not generated into an interface
    28  *          is not generated into an interface
    29  * @library /tools/lib
    29  * @library /tools/lib
    30  * @modules jdk.compiler/com.sun.tools.javac.api
    30  * @modules jdk.compiler/com.sun.tools.javac.api
    31  *          jdk.compiler/com.sun.tools.javac.file
       
    32  *          jdk.compiler/com.sun.tools.javac.main
    31  *          jdk.compiler/com.sun.tools.javac.main
    33  *          jdk.jdeps/com.sun.tools.javap
    32  * @build toolbox.ToolBox toolbox.JavaTask Assertions AssertionsTest
    34  * @build ToolBox Assertions AssertionsTest
       
    35  * @run main AssertionsTest -da
    33  * @run main AssertionsTest -da
    36  * @run main AssertionsTest -ea:test.Assertions Inner
    34  * @run main AssertionsTest -ea:test.Assertions Inner
    37  * @run main AssertionsTest -ea:test.Outer Outer
    35  * @run main AssertionsTest -ea:test.Outer Outer
    38  * @run main AssertionsTest -ea:test.Another Another.Inner
    36  * @run main AssertionsTest -ea:test.Another Another.Inner
    39  * @run main AssertionsTest -ea:test... Inner Outer Another.Inner
    37  * @run main AssertionsTest -ea:test... Inner Outer Another.Inner
    40  */
    38  */
    41 
    39 
    42 import java.util.Arrays;
    40 import java.util.Arrays;
    43 
    41 
       
    42 import toolbox.JavaTask;
       
    43 import toolbox.Task;
       
    44 import toolbox.ToolBox;
       
    45 
    44 public class AssertionsTest {
    46 public class AssertionsTest {
    45 
    47 
    46     public static void main(String... args) throws Exception {
    48     public static void main(String... args) throws Exception {
    47         String testClasses = System.getProperty("test.classes");
    49         String testClasses = System.getProperty("test.classes");
    48         ToolBox tb = new ToolBox();
    50         ToolBox tb = new ToolBox();
    49         tb.new JavaTask().classpath(testClasses)
    51         new JavaTask(tb).classpath(testClasses)
    50                          .vmOptions(args[0])
    52                          .vmOptions(args[0])
    51                          .className("test.Assertions")
    53                          .className("test.Assertions")
    52                          .classArgs(Arrays.copyOfRange(args, 1, args.length))
    54                          .classArgs(Arrays.copyOfRange(args, 1, args.length))
    53                          .includeStandardOptions(false)
    55                          .includeStandardOptions(false)
    54                          .run(ToolBox.Expect.SUCCESS)
    56                          .run(Task.Expect.SUCCESS)
    55                          .writeAll();
    57                          .writeAll();
    56     }
    58     }
    57 
    59 
    58 }
    60 }