langtools/test/tools/javac/T8009640/CheckRejectProfileBCPOptionsIfUsedTogetherTest.java
author jjg
Wed, 13 Aug 2014 13:20:31 -0700
changeset 26100 bb7dd001d190
parent 19489 387a4dd51adf
child 26264 a09fedde76be
permissions -rw-r--r--
8050429: Update/cleanup ToolBox Reviewed-by: vromero
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19489
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
     1
/*
26100
bb7dd001d190 8050429: Update/cleanup ToolBox
jjg
parents: 19489
diff changeset
     2
 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
19489
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
     4
 *
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    10
 *
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    15
 * accompanied this code).
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    16
 *
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    20
 *
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    23
 * questions.
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    24
 */
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    25
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    26
/*
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    27
 * @test
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    28
 * @bug 8009640
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    29
 * @summary -profile <compact> does not work when -bootclasspath specified
26100
bb7dd001d190 8050429: Update/cleanup ToolBox
jjg
parents: 19489
diff changeset
    30
 * @library /tools/lib
19489
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    31
 * @build ToolBox
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    32
 * @run main CheckRejectProfileBCPOptionsIfUsedTogetherTest
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    33
 */
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    34
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    35
import com.sun.tools.javac.util.Assert;
26100
bb7dd001d190 8050429: Update/cleanup ToolBox
jjg
parents: 19489
diff changeset
    36
import java.nio.file.Paths;
19489
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    37
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    38
public class CheckRejectProfileBCPOptionsIfUsedTogetherTest {
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    39
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    40
    private static final String TestSrc =
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    41
        "public class Test {\n" +
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    42
        "    javax.swing.JButton b;\n" +
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    43
        "}";
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    44
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    45
    public static void main(String args[]) throws Exception {
26100
bb7dd001d190 8050429: Update/cleanup ToolBox
jjg
parents: 19489
diff changeset
    46
        ToolBox tb = new ToolBox();
19489
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    47
26100
bb7dd001d190 8050429: Update/cleanup ToolBox
jjg
parents: 19489
diff changeset
    48
        ToolBox.Result result = tb.new JavacTask(ToolBox.Mode.CMDLINE)
bb7dd001d190 8050429: Update/cleanup ToolBox
jjg
parents: 19489
diff changeset
    49
                .options("-profile", "compact1",
bb7dd001d190 8050429: Update/cleanup ToolBox
jjg
parents: 19489
diff changeset
    50
                        "-bootclasspath", Paths.get(ToolBox.testJDK, "jre/lib/rt.jar").toString())
bb7dd001d190 8050429: Update/cleanup ToolBox
jjg
parents: 19489
diff changeset
    51
                .sources(TestSrc)
bb7dd001d190 8050429: Update/cleanup ToolBox
jjg
parents: 19489
diff changeset
    52
                .run(ToolBox.Expect.FAIL);
19489
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    53
26100
bb7dd001d190 8050429: Update/cleanup ToolBox
jjg
parents: 19489
diff changeset
    54
        String out = result.getOutput(ToolBox.OutputKind.DIRECT);
bb7dd001d190 8050429: Update/cleanup ToolBox
jjg
parents: 19489
diff changeset
    55
        Assert.check(out.startsWith(
19489
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    56
                "javac: profile and bootclasspath options cannot be used together"),
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    57
                "Incorrect javac error output");
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    58
    }
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    59
387a4dd51adf 8009640: -profile <compact> does not work when -bootclasspath specified
vromero
parents:
diff changeset
    60
}