Java Code Examples for com.oracle.java.testlibrary.ProcessTools#executeTestJvm()

The following examples show how to use com.oracle.java.testlibrary.ProcessTools#executeTestJvm() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransitionsTestExecutor.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private static void executeTestFor(int compilationPolicy, String testName) throws Throwable {
    String policy = "-XX:CompilationPolicyChoice=" + compilationPolicy;

    // Get runtime arguments including VM options given to this executor
    RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
    List<String> vmArgs = runtime.getInputArguments();

    // Construct execution command with compilation policy choice and test name
    List<String> args = new ArrayList<>(vmArgs);
    Collections.addAll(args, policy, testName);

    OutputAnalyzer out = ProcessTools.executeTestJvm(args.toArray(new String[args.size()]));
    int exitCode = out.getExitValue();
    if (exitCode != 0) {
        throw new Error("Test execution failed with exit code " + exitCode);
    }
}
 
Example 2
Source File: TransitionsTestExecutor.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private static void executeTestFor(int compilationPolicy, String testName) throws Throwable {
    String policy = "-XX:CompilationPolicyChoice=" + compilationPolicy;

    // Get runtime arguments including VM options given to this executor
    RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
    List<String> vmArgs = runtime.getInputArguments();

    // Construct execution command with compilation policy choice and test name
    List<String> args = new ArrayList<>(vmArgs);
    Collections.addAll(args, policy, testName);

    OutputAnalyzer out = ProcessTools.executeTestJvm(args.toArray(new String[args.size()]));
    int exitCode = out.getExitValue();
    if (exitCode != 0) {
        throw new Error("Test execution failed with exit code " + exitCode);
    }
}
 
Example 3
Source File: TestRedefineWithUnresolvedClass.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void launchTest() throws Throwable {
    String[] args = {
        "-javaagent:" + testClasses + "UnresolvedClassAgent.jar",
        "-Dtest.classes=" + testClasses,
        "UnresolvedClassAgent" };
    OutputAnalyzer output = ProcessTools.executeTestJvm(args);
    output.shouldHaveExitValue(0);
}
 
Example 4
Source File: TestRedefineWithUnresolvedClass.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static void launchTest() throws Throwable {
    String[] args = {
        "-javaagent:" + testClasses + "UnresolvedClassAgent.jar",
        "-Dtest.classes=" + testClasses,
        "UnresolvedClassAgent" };
    OutputAnalyzer output = ProcessTools.executeTestJvm(args);
    output.shouldHaveExitValue(0);
}
 
Example 5
Source File: TestRedefineWithUnresolvedClass.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static void launchTest() throws Throwable {
    String[] args = {
        "-javaagent:" + testClasses + "UnresolvedClassAgent.jar",
        "-Dtest.classes=" + testClasses,
        "UnresolvedClassAgent" };
    OutputAnalyzer output = ProcessTools.executeTestJvm(args);
    output.shouldHaveExitValue(0);
}
 
Example 6
Source File: TestRedefineWithUnresolvedClass.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static void launchTest() throws Throwable {
    String[] args = {
        "-javaagent:" + testClasses + "UnresolvedClassAgent.jar",
        "-Dtest.classes=" + testClasses,
        "UnresolvedClassAgent" };
    OutputAnalyzer output = ProcessTools.executeTestJvm(args);
    output.shouldHaveExitValue(0);
}
 
Example 7
Source File: TestRedefineWithUnresolvedClass.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static void launchTest() throws Throwable {
    String[] args = {
        "-javaagent:" + testClasses + "UnresolvedClassAgent.jar",
        "-Dtest.classes=" + testClasses,
        "UnresolvedClassAgent" };
    OutputAnalyzer output = ProcessTools.executeTestJvm(args);
    output.shouldHaveExitValue(0);
}