hotspot/test/runtime/MinimalVM/JVMTI.java
author ctornqvi
Tue, 23 Aug 2016 13:20:51 -0400
changeset 40660 d2f433c48708
permissions -rw-r--r--
8155964: Create a set of tests for verifying the Minimal VM Reviewed-by: gtriantafill, dholmes, lmesnik, cjplummer
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
40660
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
     1
/*
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
     4
 *
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
     7
 * published by the Free Software Foundation.
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
     8
 *
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    13
 * accompanied this code).
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    14
 *
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    18
 *
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    21
 * questions.
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    22
 */
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    23
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    24
/*
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    25
 * @test
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    26
 * @requires vm.flavor == "minimal"
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    27
 * @modules java.base/jdk.internal.misc
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    28
 * @library /test/lib
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    29
 * @run driver JVMTI
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    30
 */
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    31
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    32
import jdk.test.lib.process.OutputAnalyzer;
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    33
import jdk.test.lib.process.ProcessTools;
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    34
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    35
public class JVMTI {
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    36
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    37
    public static void main(String args[]) throws Exception {
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    38
        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    39
                "-minimal",
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    40
                "-agentlib:jdwp=server=y,transport=dt_socket,address=5000,suspend=n",
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    41
                "-version");
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    42
        new OutputAnalyzer(pb.start())
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    43
                .shouldContain("Debugging agents are not supported in this VM")
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    44
                .shouldHaveExitValue(1);
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    45
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    46
    }
d2f433c48708 8155964: Create a set of tests for verifying the Minimal VM
ctornqvi
parents:
diff changeset
    47
}